Two models named "Post" and "Comment", and I want to build RESTful route like /post/123/comment/8 and CommentsController handles all RESTful actions.
I have tried
route("/posts/{post_id}/comments/*").to(CommentsController.class);
and
route("/posts/{post_id}/comments/*").to(CommentsController.class).get().post().put().delete();
And none works:(
What you need is not a RESTful set of routes from the point of AvctiveWeb framework: http://javalite.io/routing#restful-routing.
What you are trying to do is to define some custom routes. Not to say that they are not REST - based though.
Here is the example that works:
The route:
The controller:
then hit this:
http://localhost:8080/posts/123/comments/456
and observe:
index, post:123, comment: 456