JBoss.orgCommunity Documentation
JBoss Tools includes many example projects which are available by selecting → . The following sections describe setting up the example RESTEasy project. This project serves as a good example for testing the numerous Web Service Test View functions.
Once the required plugins have been installed, the example project can be set up as described in JBoss Tools New Example Project
Procedure 7.1. JBoss Tools New Example Project
Access the New Example Project Dialog
Select →
The New Example Project dialog displays.
Define the Example Project Type
Click the RESTEasy Simple Example label by expanding the node.
Click the button to complete the project set up.
The simple project is configured and ready to build.
In the event that a message is displayed indicating some requirements could not be configured, click the button followed by the button to rectify the problem. The message will be displayed as a result of missing plugins or a requirement to select or configure a suitable runtime.
Build the project
Right click on the project name and select →
The simple.war file is written to the project's 'target directory.
Deploy the project
Copy the simple.war file to the deploy directory of the required server profile such as the all profile.
The simple.war file is written to the target directory.
Determine the URL for the web service
Double click the web.xml file and note the jax.ws.rs.Application parameter mapped to the Application class. Note also that:
the main servlet for the application is org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher which is given the custom name Resteasy; and
the main servlet is mapped to the url /rest-services/* [1].
The url for sending GET requests can be resolved as follows:
Identify the Application class as defined in the deployment descriptor.
Note the object type (CustomerResource) instantiated in the Application class (ShoppingApplication) and added to the singleton set (singletons.add(new CustomerResource())).
Note the JAX-RS annotated path declared in the corresponding CustomerResource class: @Path("/customers") [2].
The url for sending GET requests can be formed from http://localhost:8080/ProjectName/[1]/[2] or, http://localhost:8080/simple/rest-services/customers..