Having the basic of a REST based Java app

Last Updated on: (senast uppdaterad på:)

A Java developer working with web app back-end development is required to have JavaEE development where the program design follows the RESTful architecture. To develop a RESTful application, follow useful tutorials and descriptions for JavaEE, choice of ServletContainers, framework description for developing RESTful web services such as Jersey, annotations that are used in a Java class for a JavaEE REST app, and the servlet naming and mapping in the project’s web.xml file. Some good tutorials that were beneficial to me were:

And some useful descriptions were:

At the time of preparing the Java RESTful app one should consider that the project’s Maven pom.xml file has the correct dependencies, as well as a right way to reference the application’s servlets in the web.xml file. One of the Maven dependencies that works as a ServletContainer and is the base for implementing a “Jax-RS with Jersey” is the jersey-container-servlet:


The content of the web.xml file, which reference the Servlet being developed would then be:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         id="WebApp_ID" version="3.0">
        <servlet-name>Jersey REST Service</servlet-name>
        <servlet-name>Jersey REST Service</servlet-name>

The good tutorial at https://www.javatpoint.com/jax-rs-example-jersey has a more complete description.

If an error is encountered when deploying the application to the application server, one can search on StackOverflow and with links such as:

Lämna ett svar