加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – playframework模块和路由

发布时间:2020-12-15 08:49:18 所属栏目:Java 来源:网络整理
导读:我用Play!框架1.2.5 我有一个模块’businessmodel’.在conf / routes中: GET / businessmodel.Admin.index 我有控制器: package controllers.businessmodel;import play.mvc.Controller;public class Admin extends Controller { ... 和一个观点: /view/
我用Play!框架1.2.5

我有一个模块’businessmodel’.在conf / routes中:

GET / businessmodel.Admin.index

我有控制器:

package controllers.businessmodel;

import play.mvc.Controller;

public class Admin extends Controller { ...

和一个观点:

/view/businessmodel/Admin/index.html

在依赖于此模块的主应用程序中,在conf / routes中我有:

GET /admin module:businessmodel

当转到myhost:9000 / admin我在页面上有错误:

Not found
GET /admin

此外,在同一个错误页面上,我有已定义路由的列表:

GET       /                                                 Application.index
GET       /admin/                                           businessmodel.Admin.index
GET       /favicon.ico                                      404
GET       /public/                                          staticDir:public
*         /{controller}/{action}                            {controller}.{action}                      {controller}.{action}

但是如果将模块的路由更改为此行(添加’?’):

GET     /?                      businessmodel.Admin.index

然后我们有不同的错误:

@6cpelo7bh Internal Server Error (500) for request GET /admin

Action not found Action businessmodel.Admin.index could not be found.
Error raised is MODULE$

我想错过一些定义吗?

解决方法

我找到了解决方案..这个奇怪的错误仍然出现:

Action not found Action businessmodel.Admin.index could not be found.
Error raised is MODULE$

这是问题:

https://play.lighthouseapp.com/projects/57987/tickets/414-better-error-message-when-action-method-is-missing-parameter

(我在这个问题上添加了我的最终评论.)

如果在控制器的方法中忘记静态.我花了一个小时在这…

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读