For code explanation and additional configurations read the tutorial at https://javatutorial.net/java-servlet-example # Build using command line - Install JDK, Maven - git clone https://github.com/JavaTutorialNetwork/Tutorials.git - cd Tutorials/SimpleServlet - mvn clean - mvn package | the war file will be built in target/SimpleServlet-1.war