I have REST resources like author
and article
. There can be multiple Author
s and each author
can own multiple articles
. I know it is possible to model their Scalatra handlers in one servlet like
/author/:id/article
/author/:id/article/:id
etc. but doing this my servlet file gets big. It looks that everything under author
needs to be handled within one servlet.
I'd like to split this stuff into several independent servlets that would make up whole resources adresses when registered together. So I'd like to have author
-related things in one servlet and article
-related things in another.
Is there a way to do that in Scalatra? I found similar question regarding Sinatra but with no good answer Sub routing in Sinatra