2

Is it possible to put a controller from package controllers to package controllers.subpackage and get the reverse routing in play 1.2.5 working?

Adding

GET     /myMethod           controllers.subpackage.MyController.myMethod

to conf/routes works fine but if I call

Router.reverse("controllers.subpackage.MyController.myMethod")

in Application.java it fails to compile, saying "No route found".

4

1 回答 1

2

事实上,您的路线定义应该是:

GET     /myMethod           subpackage.MyController.myMethod

然后反过来就好了

Router.reverse("subpackage.MyController.myMethod")
于 2012-12-20T08:58:20.013 回答