In this paragraph, we will analyze the JAX-RS application interface.
This interface is mandatory when sharing the services. If you must only write simple services, and you don't want to write this class, there is a valid and nice alternative to it. Simply add this piece to your web.xml:
<servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/myjaxrs/*</url-pattern>
</servlet-mapping>
Automatically, the next services you will write will be callable using the myjaxrs context together with the name of the service declared with the @Path annotation. The URL-pattern in this case is used instead of the @PathApplication annotation.
However, the application is not only used to host the services. Many other components are provided by JAX-RS. In this paragraph, we will see the main...