I was going through a demo project setup for Restful webservice using Apache CXF, where I happened to come by a piece of code inside web.xml:
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
I did not really understand the use of a servlet class in this web.xml. I googled for org.apache.cxf.transport.servlet.CXFServlet
and found:
The CXFServlet class, which is defined by Apache CXF, is generated and registered to handle incoming requests.
Now, I really do not understand what that line means
- Does this servlet pose as a front-controller, like in Spring MVC flow?
- What is the actual purpose of using this servlet class?
- How does CXF use Spring to provide XML configuration of services defined in the project?
- Does
org.glassfish.jersey.servlet.ServletContainer
serve the same purpose in Jersey Implementation asorg.apache.cxf.transport.servlet.CXFServlet
with Apache CXF?
Help me clarify these questions.