How to run a Dynamic Web Project in Eclipse with Tomcat?

This tutorial we are going to create a sample dynamic web application in Eclipse, write a simple JSP file and finally run on the Tomcat from Eclipse IDE.

How to run a Dynamic Web Project in Eclipse with Tomcat?

Dynamic Web Application - How to run Dynamic Web Project in Eclipse with Tomcat?

The Dynamic web application is the most common web application these days as it presents different views to different users based on their preference. As a Java application developer should know how to work with the dynamic web application in Java. In this tutorial I am going to show you how to make a web application and then run it on the Apache Tomcat server from Eclipse IDE.

What is a Dynamic Web Application?

Let?s understand the Dynamic Web Application and its importance in modern web application development. A dynamic web application is usually database driven and servers the users based on their preference. For example in a shopping cart website, product recommendations will be different for different users. Dynamic web applications serve customized content to the users based on the inputs given by the user. Dynamic website provides personalized content along with the intuitive way of interaction with the website to the users.

There are many technologies out there for dynamic web application development, moreover these technologies are improvising to meet the growing demand of the users and market. The server-side dynamic web application technologies are PHP, Python, Ruby, Java/JSP/Servlet, .Net, Node.js and others. While client side technologies are HTML, CSS, and JavaScript.

We have recorded the video tutorial for running a Dynamic Web Project in Eclipse with Tomcat. Check here:

Running Dynamic Web Project in Eclipse with Tomcat

Now we will show you how you can run a dynamic web project in Eclipse on the Tomcat 10 server. I am using Java 17, Latest Eclipse IDE and Tomcat 10.1 for this tutorial. So, lets get started.

Step 1: Create or Open Dynamic Web Application in Eclipse

First of all you have to create a dynamic web application in Eclipse and add a simple jsp file for testing. You can also use the existing dynamic web application in the Eclipse. For this tutorial I have already created a dynamic web application in Eclipse.

Step 2: Download Tomcat 10.1 or latest version

Visit Apache Tomcat official website at https://tomcat.apache.org/download-10.cgi to download the latest version of Tomcat 10.x. If you are your planning to use latest version of Tomcat then check https://tomcat.apache.org/ and download the version you are looking for. Here is the screenshot of download page of Apache Tomcat 10.x:

Download Apache Tomcat 10.1

Click on the zip link to download Tomcat 10.x. After downloading it move the zip file to your favorite directory where you will extract Tomcat 10.x zip file.

Step 3: Extract Tomcat 10.1 zip file

Now move the zip file into your favorite directory and unzip it using windows default zip utility or WinZip (if is installed).

Extract Tomcat 10 zip file in windows

Step 4: Run Web Application in Tomcat from Eclipse

Now we can run Web Application in Tomcat. Right click the project and then select Run As --> Run on Server as shown below:

Run Web App on Server Tomcat

In the Eclipse new screen will appear that will allow you to run web application on Server (Tomcat and others). Here is the next screen shot:

Select Tomcat Server in Eclipse

Select Tomcat v10.1 Server and click on "Next >". Now following screen will be shown to you:

Select Server in Eclipse

Click on the "Browse..." button to select the Tomcat 10.1 directory. You can specify the Tomcat 10.1 directory as shown below:

Specify Tomcat directory in Eclipse

Next click on the Next button and following screen is shown to select the application to be deployed on Tomcat:

select web app to deploy

Select your web app to deploy (By default it should get selected) and then click "Finish" button. Now Eclipse will run your application in Tomcat and open the browser to show your applications home page as shown below:

Web running in browser

In the Eclipse console you can see Tomcat logs as shown below:

Tomcat Log in Eclipse

In this tutorial we have provided you the step by step instruction to run a Dynamic Web Application on Tomcat from Eclipse IDE.

Check more tutorials at: