Running the RESTful web service

In this section, we will run the root resource class. Invoke the URL http://localhost:8080/jboss-jaxrs/jaxrs/helloworld. The jboss-jaxrs is included in the URL as it is the context of the web application. The jaxrs is included to invoke the servlet com.sun.jersey.spi.container.servlet.ServletContainer. The /helloworld is the resource URI for the RESTful web service. We did not annotate any resource method or class method with @PATH; therefore, we won't invoke a specific method. The first resource method in the root resource class gets invoked. Make different resource methods as the first in the root resource class to test different MIME type outputs. If HTML output is required, make the getHTMLMessage method the ...

Get Advanced Java® EE Development with WildFly® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.