自动完成对播放2.0在Eclipse斯卡拉控制器的看法路径 [英] Autocomplete for Play 2.0 views paths in Scala controllers in Eclipse
问题描述
这是一个视觉参考,以谷歌的小组讨论:<一href=\"https://groups.google.com/group/play-framework/browse_thread/thread/14660fd7056d577e/a3afb4ca06d25ce5#a3afb4ca06d25ce5\" rel=\"nofollow\">https://groups.google.com/group/play-framework/browse_thread/thread/14660fd7056d577e/a3afb4ca06d25ce5#a3afb4ca06d25ce5
This is a visual reference to the google group discussion: https://groups.google.com/group/play-framework/browse_thread/thread/14660fd7056d577e/a3afb4ca06d25ce5#a3afb4ca06d25ce5
所以,我只是想一些冗长增加访问量:
So, I'm simply trying to add some verbosity to views:
当我引用上述两个文件,或尝试在斯卡拉控制器,基于谷歌集团提供的例子,我得到一个错误:
When I reference either of the files, or try to, in the Scala controller, based on the example provided in the Google Group, I get an error:
怎么办?
推荐答案
声明: 我不是一个Eclipse用户,刚刚创建的和进口的空白播放的专案以检查这个问题!我没有时间来测试Eclipse中的configs,刚刚导入截至播放的文档descriped。也许这是一些方法来更好的配置,但你需要寻找它自己:)的
我不会怪播放,它正确地做它的工作,否则将无法编译的。正如我在谷歌集团的话题写您需要将您的视图中包:嵌套 /views/nested/index.scala.html
(当然
只是一些名字也可以是其他任何),那么你就可以抓住它。确定(views.html
nested.index()
)
I wouldn't blame Play, it does its job properly, otherwise it wouldn't compile at all. As I wrote in Google Group's topic you need to place your view in package: /views/nested/index.scala.html
(of course nested
is just a some name it can be whatever else), then you can catch it with: Ok(views.html.
nested.index()
)
在Eclipse中:
- 在
Package Explorer中
点击与的意见
包:鼠标右键
>新
>套餐
,写包的名称views.nested
或views.one
或别的东西,甚至也可能是:views.nested.one.two.three
- 添加新视图到这个包
myNewView.scala.html
- 运行在浏览器中的任何要求(让玩编译新的观点),可选您可以运行命令
玩玩〜运行
所以它会编译你的新的或修改意见在IDE中保存后的权利。 - 在Eclipse的菜单中选择
项目
>清洁...
。事实上,这就是线索,我不明白为什么作为播放编译一切正常,请阅读开头免责声明需要此清洗。 - 从现在您的Eclipse会看到这个新的视图(S)
- in
Package Explorer
clickviews
package with:right mouse button
>New
>Package
and write package's nameviews.nested
orviews.one
or something else, even it could be:views.nested.one.two.three
- Add new view into this package
myNewView.scala.html
- Run any request in browser (to let the Play compile new views), optionally you can run Play with command
play ~run
so it will compile your new or changed views right after saving in IDE. - in Eclipse menu choose
Project
>Clean...
. De facto, that's the clue, I'm not quite sure why this cleaning is required as Play compiles everything properly, read the disclaimer at the beginning. - From now your Eclipse will see this new view(s)
屏幕截图
这篇关于自动完成对播放2.0在Eclipse斯卡拉控制器的看法路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!