Playframework 在play框架中找不到操作
我刚刚创建了一个新的play框架项目,它运行良好。现在,一旦我修改了路由文件(我所做的就是添加Playframework 在play框架中找不到操作,playframework,Playframework,我刚刚创建了一个新的play框架项目,它运行良好。现在,一旦我修改了路由文件(我所做的就是添加GET/popular行): 现在在控制器中,我添加了处理程序: public class Application extends Controller { public static Result index() { return ok(index.render("Your new application is ready.")); } public sta
GET/popular
行):
现在在控制器中,我添加了处理程序:
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));
}
}
公共类应用程序扩展控制器{
公共静态结果索引(){
返回ok(index.render(“新应用程序准备就绪”);
}
公共静态结果popular(){
ArrayList popular=新的ArrayList();
添加(“测试”);
普通。添加(“123”);
返回ok(Json.toJson(popular));
}
}
由于某些原因,我在尝试访问http://127.0.0.1:9000/popular
我只是想尝试一个简单的动作。知道我为什么会出现这个错误吗?显然进入游戏控制台并执行
clean
命令可以解决这个问题。如果这不起作用,请尝试手动执行compile
命令
activator clean compile
“播放应用程序”文件夹中的内容对我有用
然后
好啊很明显,进入游戏控制台并执行“clean”命令可以修复此问题。对不起,这实际上是一个复制/粘贴错误。您如何运行游戏?使用“运行”或“启动”?我使用的是“运行”。我应该用“开始”吗?
activator clean compile
activator run