ses
ses

Reputation: 13372

playframework modules and routes

I use Play! Framework 1.2.5

I have a module 'businessmodel'. Here in conf/routes:

GET / businessmodel.Admin.index

There I have controller:

package controllers.businessmodel;

import play.mvc.Controller;

public class Admin extends Controller { ...

and a view:

/view/businessmodel/Admin/index.html

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

GET /admin module:businessmodel

When go to myhost:9000/admin I have on the page the error:

Not found
GET /admin

Also, on the same error page I have 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}

--

But if change the module's routes to this line (adding '?'):

GET     /?                      businessmodel.Admin.index

then we have different error:

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

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

Do I miss something to define?

Upvotes: 3

Views: 1137

Answers (1)

ses
ses

Reputation: 13372

I found the solution.. This strange error still appears:

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

Here is the issue:

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

(I've add my final comment into this issue.)

If one forgets static in controller's method. I've spent one hour on this..

Upvotes: 7

Related Questions