JSP and Servlet Project Configuration Tutorial

In this article, I will show the steps required to configure and set up the Spring boot web application project on a Windows machine and run the project on localhost.

Following are the primary steps that you need to follow

  • Download and Install Eclipse as IDE(latest versions 22 or 23).
  • Import the project as an “Existing Maven Project” into Eclipse.
  • Add required plugins into Eclipse.
  • Make required changes to the application.properties file.
  • Download and install a database as an MYSQL server with a workbench.
  • Import Database into MYSQL.

Download and Install Eclipse as an IDE

  • Download the latest version of the Eclipse installer from Download Eclipse.
  • Double-click on the installer and install Eclipse with the recommended JDK as a Java Enterprise application.
  • Wait Until it’s installed properly and click on “Launch” to open the Eclipse.

Add Lombok plugin in Eclipse If required(Optional)

You might be getting errors in the getters and setters method, In this case, you need to add the Lombok plugin to your IDE. Below are the simple steps to add the Lombok plugin to Eclipse.

  • In Eclipse GoTo Help ==> Install new software ==>
  • Add the Lombok URL https://projectlombok.org/p2 into “work with” and hit enter from your keyboard.
  • Just follow the instructions and make sure the Lombok plugin is installed properly.
  • Restart eclipse.

Database Configuraion

Download and install a database as an MYSQL server with a workbench, When you install MySQL, always keep the default password  “root”.

Import the Project Source Code, Database, and Run it.

  • Run Eclipse
  • Go to file ==> Import ==>Existing Maven Project
  • Browse the project from your machine and click to finish. It will start the import and wait until the import process is done.

If you are still getting the error, It means Maven needs an update. Follow the below steps to update the maven.

  • Right-click on the root folder of the project.
  • Goto Maven ==> Update Project ==> Force update of Snapshots/Releases(Check this) ==> Click to OK.

Server configuration

To deploy our Java project we are using Tomcat 8.5.

Step 1) Download Tomcat 8.5

>>Download Tomcat 8.5 Link 

Step 2) Extract the File and copy it at any location in your machine for example “C drive”.

Step 3) Again Switch to sts tool/Eclipse and search for server window. Follow the path to find the server window

=>Windows=>Show view=>Others=> Server.

Step 4) Right-click in the server window and select

New=>server=>Apache=>Tomcat 8.5 Server=>Next.

Step 5) Browse the tomcat folder which we had copied in “C drive”.

Step 6) Click to Next and Finish.

Finally, Run Your Project

Step 1) Switch to the STS tool/Eclipse.

Step 2) Right-click on the project and select “Run As” then “Run on server”.

Step 3) Select “Tomcat 8.5” from the localhost.

Step 4) Click next and finish.