在播放框架中找不到操作

Hen*_*que 5 playframework

我刚刚创建了一个新的游戏框架项目,它运行良好。现在,一旦我修改了我的路由文件(我所做的就是添加该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)
Run Code Online (Sandbox Code Playgroud)

现在在我的控制器中,我添加了处理程序:

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));
    }
}
Run Code Online (Sandbox Code Playgroud)

由于某种原因,我在尝试访问时收到“未找到操作”消息http://127.0.0.1:9000/popular

我只是想尝试一个简单的动作。知道为什么我会收到此错误吗?

Hen*_*que 4

显然进入游戏控制台并执行命令clean可以解决此问题。如果这不起作用,请尝试手动执行compile命令。

  • 我用的是“运行”。我应该使用“开始”吗? (2认同)