playframework - 在游戏框架中找不到 Action

标签 playframework

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

现在在我的 Controller 中,我添加了处理程序:
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 时收到“找不到操作”的消息。 .

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

最佳答案

显然进入游戏控制台并执行 clean命令修复了这个问题。如果这不起作用,请尝试手动执行 compile命令。

关于playframework - 在游戏框架中找不到 Action ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19919831/

相关文章:

java - 单例对象在java中的发挥!框架

java - Play : Is it possible to extract form data without binding it to a model?

mysql - 具有多个连接、分组依据和具有的光滑查询

java - 如何在Actor的onReceive方法中执行异步数据库插入?

java - 在play 1.2.5中使用@before注释?

java - 如何从play框架中的application.conf文件中读取属性?

postgresql - 没有时区的 playframework 异常 postgresql 时间戳

scala - 为什么我不能在 Play Framework 2 View 中将 Scala 代码与 HTML 混合?

scala - 在 Play 中,如何在反向路由 URL 中包含自定义查询参数? (称呼)

java - 在作业/离线中生成 pdf 时,Play Framework 1.2.x Pdf 模块出现问题