PlayFramework2. Using nested classes in router

135 views Asked by At

I would like to know is it possible to use nested class as routing destination.

Here is my method:

package controllers;
public class MainController {
    public static class NestedController {
        public Result submit() {
            return ok();
        }
    }
}

And routing file:

GET  /main/nested controllers.MainController$NestedController.submit()

But I am getting an error:

[error] /home/user/git/play/conf/routes:23: object MainController$NestedController is not a member of package controllers
[error] GET /main/nested controllers.MainController$NestedController.submit()

When I set routing file this way:

GET  /main/nested controllers.MainController.NestedController.submit()

I am getting an error:

[error] /home/user/git/play/conf/routes:23: MainController is already defined as object MainController

Please help

0

There are 0 answers