5

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

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

4

2 回答 2

4

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

于 2013-11-12T02:58:47.807 回答
0
activator clean compile 

从播放应用程序文件夹中为我工作。

然后

activator run
于 2016-04-01T19:05:12.267 回答