• Home
  • Docker
  • Kubernetes
  • LLMs
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Samples | JAX-RS: Sample Application (Jersey, Spring, Tomcat)
  1. The application structure
  2. The POM file (pom.xml)
  3. web.xml
  4. applicationContext.xml
  5. MyResourceConfig.java
  6. REST service: MyEntityRestAPI.java
  7. Java entity: MyEntity.java
  8. Build and test the rest application

  1. The application structure

    mtitek-rest-sample-eclipse
  2. The POM file (pom.xml)
  3. web.xml
  4. applicationContext.xml
  5. MyResourceConfig.java

    Please note that for this case "MyResourceConfig" is useless as there's no specific code added to this class.
    You can run your code without it, just replace its full path in the file "web.xml" by "org.glassfish.jersey.server.ResourceConfig".
  6. REST service: MyEntityRestAPI.java
  7. Java entity: MyEntity.java
  8. Build and test the rest application
    Apache Maven: mvn clean package

    Apache Tomcat: deploy the war file "mtitek-rest-sample-1.0.0-SNAPSHOT.war" in the folder "${TOMCAT_ROOT}/webapps/"

    REST client tool: http://localhost:8080/mtitek-rest-sample-1.0.0-SNAPSHOT/rest/myEntity

    Response:
© 2025  mtitek