Java – playframework module and routing

I use play! Frame 1.2 five

I have a module 'business model' In conf / routes:

I have a controller:

package controllers.businessmodel;

import play.mvc.Controller;

public class Admin extends Controller { ...

And a point of view:

In the main application that depends on this module, in conf / routes, I have:

When I go to myhost: 9000 / Admin, I have an error on the page:

In addition, on the same error page, I have a list of defined routes:

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

However, if you change the route of the module to this line (add '?'):

GET     /?                      businessmodel.Admin.index

Then we have different mistakes:

Do I want to miss some definitions?

Solution

I found a solution This strange error still occurs:

This is the problem:

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

(I added my final comment on this issue.)

If you forget static in the controller's method I spent an hour here

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>