Lets say I have a Rest API which can be accessed via e.g.: mypage.com/v1/users/1234
And i am using Java EE and HttpServlets for this rest api.
Is it a good idea to send all v1 requests to a single servlet and then pass it to my own structure to be more independent and maybe later switch more easily from HttpServlets to something else? Or better create and register a servlet for all types of ressources, so one for mypage.com/v1/users and one for mypage.com/v1/cars and so on
Is it much slower to use only one servlet or inefficient to do this or just inconvenient?
Maintenance is going to become very difficult quickly. Take a look at Jersey or Resteasy. The learning curve is small and jax-rs takes care of a whole lot of the boilerplate code you would have to write in vanilla servlets.