【发布时间】:2013-11-12 02:32:10
【问题描述】:
我刚刚创建了一个新的游戏框架项目,它运行良好。现在,一旦我修改了我的路由文件(我所做的就是添加GET /popular 行):
# Home page
GET /popular controllers.Application.popular()
GET / controllers.Application.index()
# Map static resources from the /public folder to the /assets URL path
GET /assets/*file controllers.Assets.at(path="/public", file)
现在在我的控制器中,我添加了处理程序:
public class Application extends Controller {
public static Result index() {
return ok(index.render("Your new application is ready."));
}
public static Result popular() {
ArrayList<String> popular = new ArrayList<String>();
popular.add("testing");
popular.add("123");
return ok(Json.toJson(popular));
}
}
由于某种原因,我在尝试访问 http://127.0.0.1:9000/popular 时收到“未找到操作”。
我只是想尝试一个简单的动作。知道为什么会出现此错误吗?
【问题讨论】:
-
好的。显然进入播放控制台并执行“清理”命令可以解决此问题。
-
对不起,这实际上是一个复制/粘贴错字。
标签: playframework