Srini Srini - 10 months ago 34
Scala Question

How to do reverse routing from subcontroller to the sub routes in play scala?

I have created the sub routes from main route and I have created the subcontroller package e.g controllers.subcontrollers. Now how to access my sub routes from sub controllers.

Trp Trp

You can access by using this:

// Redirect to /hello/Bob
def helloBob = Action {

As you can see in the playframework documentation.

But, if you meant that you have multiples controllers and divided them into packages and want to access them inside another another controller. You can achieve it using something like this: