How to map the welcome file to a servlet?

In a Java web application, assume you have a project structure like this:

Setting up JPA on a Java Web App with MySQL deployed on Tomcat using IntelliJ as IDE with maven build.

In this post I will try to explain how JPA can be set up.

Class.getResource vs ClassLoader.getResource

The difference?

Hello world web application with Maven + Java + Servlets + Tomcat + IntelliJ

This is a simple walk-through.

My goal is to talk about:
  • creating a  web application with maven using an arche-type.
  • adding a Servlet to the application.
  • compiling it using maven.
  • deploying it to Tomcat and running it.