mikemike
mikemike

Reputation: 157

Java play 1.2.5 - Reverse routing to subpackage of controllers

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".

Upvotes: 2

Views: 828

Answers (1)

WiseTechi
WiseTechi

Reputation: 3598

In fact your route definition should be :

GET     /myMethod           subpackage.MyController.myMethod

and then the reverse will be fine

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

Upvotes: 2

Related Questions