如何让Eclipse看到Play中的变化!编译模板? [英] How to make Eclipse see the changes in Play! compiled templates?

查看:98
本文介绍了如何让Eclipse看到Play中的变化!编译模板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我正在尝试使用Eclipse播放2。我创建一个新项目,编译它,运行eclipsify并将其导入Eclipse。到目前为止这么好。



我遇到的问题是,当我在Scala模板中进行更改时,我的Java控制器看不到它,Eclipse标记代码无效。例如:



我在索引模板中添加了第二个参数

  @(message:String,nesto:Integer)

当我尝试从控制器呈现我的文件,以下行显示错误,因为Eclipse仍然认为index.render需要一个String。

  return ok(index。 render(你的新应用程序准备就绪,2)); 

我打开了Eclipse中的工作空间,并播放eclipsify会自动将classes_managed目录添加到构建路径

解决方案

我做了以下事情:


  1. 如你所做,我打开工作区自动刷新(在设置中,通用 - >工作区,然后选择使用本机挂接或池刷新)

  2. 我删除了 classes_managed 生成的目录,从我的构建路径播放eclipsify ,我用添加外部类文件夹手动添加它

然后它对我有用。
似乎有一个错误与 eclipsify 命令。


So, I'm trying out Play 2 with Eclipse. I create a new project, compile it, run eclipsify and import it into Eclipse. So far so good.

The problem I'm having is that when I make a change in the Scala template, my Java controllers can't see it, and Eclipse marks the code as invalid. For example:

I added a second parameter in my index template

@(message: String, nesto:Integer)

When I try to render my file from the controller, the following line displays an error, because Eclipse still thinks that the index.render takes one String.

return ok(index.render("Your new application is ready.",2));

I turned on the workspace refreshing in Eclipse, and play eclipsify automatically added the classes_managed directory to the build path.

解决方案

I did the following things :

  1. As you did, I turned on the workspace auto-refresh (in settings, General -> Workspace, then select "Refresh using native hooks or pooling")
  2. I removed the classes_managed directory generated by play eclipsify from my build path, and I added it manually using "Add external class folder"

And then it worked for me. It seems that there is a bug with the eclipsify command.

这篇关于如何让Eclipse看到Play中的变化!编译模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆