如何使用Play在子包中设置CRUD

时间:2012-01-04 08:09:42

标签: module playframework crud

我正在尝试在子包中使用CRUD模块而不是默认模块。

package controllers.admin;

import models.Branch;
import controllers.CRUD;

    @CRUD.For(Branch.class)
    public class Branches extends CRUD {

        public static void index() {
            render();
        }

    }

我的路线档案是:

# Import CRUD routes
*       /admin                                       module:crud

但是当我使用默认网址时:http://localhost:9000/admin/ 我找不到模板错误:

Template not found
The template admin/Branches/index.html does not exist.

如何指定CRUD模块在子包中查找视图?

1 个答案:

答案 0 :(得分:0)

确定。 controller是用eclipse插件生成的,包含了index()方法。 删除它解决了问题,模块现在正常工作。