java公司已经在play framework 2.2.1中定义为对象公司错误
我正在做一个正在进行的项目。它工作正常,但当我添加一个名为CompanyController的新控制器时,它在我看来给了我一个编译错误company is already defined as object company
公司控制器:
public static Result login() {
return ok(views.html.admin.company.login.render("Your new application is ready."));
}
路由文件:
GET /company/login controllers.companypac.CompanyController.login()
GET /assets/*file controllers.Assets.at(path="/public", file)
我不明白为什么会发生这个问题
搜索problem并没有解决问题
注意:以上路线是我的路线文件的一部分,不包含所有路线
# 1 楼答案
我认为这个问题之所以存在,是因为你的SBT没有机会重新编译你的观点。您说过,将目录更改为视图改变了问题,这可能会触发SBT重新编译视图
我也遇到过类似的问题,大多数问题在重新编译后就消失了