可能重複:
How to make Eclipse see the changes in Play! compiled templates?Playframework - Eclipse中無法檢測到新的模板
我做我的播放第一步!框架和我遇到了一些問題。 我可以創建和消除一個項目沒有任何問題。
現在,如果我添加一個新視圖,例如'sometest.scala.html',我嘗試在'應用程序'中使用它,Eclipse會將此文件標記爲錯誤。
package controllers;
import play.*;
import play.mvc.*;
import views.html.*;;
public class Application extends Controller {
public static Result index() {
return ok(sometest.render("test")); // this line is marked red
}
}
Eclipse標記了一些紅色,即使它有效。如果我去localhost:9000,我可以看到我的變化。
我的視圖文件夾是這樣的:
app
--views
----index.scala.html
----main.scala.html
----sometest.scala.html
我創建sometest爲HTML文件,並設置文件名.scala.html
簡單的解決方案:
運行應用程序
$ cd myapp
$ play
$ run
轉到喲您的webrwoser和類型:localhost:9000
在您的視圖文件夾中創建一個新的.scala.html文件。
刷新您的網站在localhost:9000
完成。
我不知道發生了什麼,但我創建了一個新的項目,現在eclipse自動刷新新的Scala類,它工作得很好。 – 2012-07-31 12:00:54
所以儘量實現:)雖然我不需要Eclipse支持我很確定,大多數人會對這方面的知識感興趣,Thanx的信息。 – biesior 2012-07-31 12:05:24
我有同樣的問題,並且Build All被禁用。我只是刷新了這個項目,錯誤消失了!右鍵單擊該項目並刷新。 – Madhan 2013-11-14 03:10:17