I am making a web service which is REST based.
First i wants to see url like as follows
/{resource}
/{resource}/<id>
/{resource1}/<id>/{resource2}
/{resource1}/<id>/{resource2}/<id>
How to make servlet urls as above..?
I prefer not to use any framework.
Servlet API doesn’t provide any special support for this kind of mapping.
If you want to do it without third-party libraries, you need to map your servlet to
/{resource}, get rest of the path asrequest.getPathInfo()and implement further routing based on that value:.
However, it would be better not to reinvent the wheel and use one of JAX-RS implementations.