Confusion between HttpServlet class and using it with Jersey

后端 未结 2 1148
小蘑菇
小蘑菇 2021-01-03 02:41

I am building servlets which implement a RESTful API. I understand the Jersey is a framework for deciphering and using given URL\'s. How do I use it in conjunction with the

2条回答
  •  孤街浪徒
    2021-01-03 03:08

    Jersey uses a servlet to route URLs to the appropriate service. Your service itself does not need to extend a servlet.

    At a high level, Jersey's ServletContainer class accepts the requests, and then based on your Jersey configuration, your web service will be invoked. You configure what url patterns are processed by Jersey. Check out section 5.3 http://www.vogella.com/articles/REST/.

提交回复
热议问题