[STARTER] Spring Boot + Thymeleaf run on Tomcat 8

1. Application class [code language=”java”] package demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class Demo3Application { public static void main(String[] args) { SpringApplication.run(Demo3Application.class, args); } } [/code] 2. ServletInitializer [code language=”java”] package demo; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.context.web.SpringBootServletInitializer; public class ServletInitializer extends SpringBootServletInitializer { @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { return application.sources(Demo3Application.class); } } [/code] 3….

[STARTER] JAX-RS: Jersey + Servlet 3.0 + Maven + Tomcat

Steps to configure a JAX-RS project that runs on Tomcat (here 8), Maven, Servlet 3.0 and having Jersey as a Reference Implementation. 1. Maven POM.XML dependencies:

  2. web.xml (src/main/webapp/WEB-INF)  

3. Application class (under: src/main/java/com/vvirlan/java/ws

4. Resource class (which is the actual web service endpoint):  

5. Build the…