< Prev
Next >

Running your first JSP webpage

In this article, we are going to teach you how to run your first JSP program. Before we execute a JSP program, we need to make sure that our Tomcat web server is up and running. Let's see how to do that.

we are going to start Tomcat. For this, you need to open the Command Prompt and go to the bin directory of the Tomcat folder present in the C: Drive, such as C:\apache-tomcat-9.0.2\bin and now you type startup(a command which starts the Tomcat Server) and press Enter.

Pressing the Enter after startup command starts the Tomcat web server as shown below.

That's it! Tomcat web server is up and running and we don't have to close the server window till the time we are working on Tomcat.

Making sure that Tomcat is running

Just to make sure that Tomcat web server is running is to open your web browser and enter the URL - http://localhost:8080/, which opens the window with a congratulatory message for successful installation and execution of Tomcat.

Now as our Tomcat web server is running, let's create a JSP webpage.


<title>First JSP</title>

This is my first JSP page.


A JSP webpage ends with a .jsp extension, hence we have named this file A.jsp.

Where to save the JSP(.jsp) file?

In order to allow Tomcat web server to easily find this JSP file and execute it, we can store this file in any of the two locations -

Executing the JSP file

Next, we need to enter the URL of this JSP document in the address bar of our web browser. This URL may look a little different depending on where you store this file.

Please Subscribe

Please subscribe to our social media channels for daily updates.

Decodejava Facebook Page  DecodeJava Twitter Page Decodejava Google+ Page