BeginnersBook

  • Home
  • Java
    • Java OOPs
    • Java Collections
    • Java Examples
  • C
    • C Examples
  • C++
    • C++ Examples
  • DBMS
  • Computer Network
  • Python
    • Python Examples
  • More…
    • jQuery
    • Kotlin
    • WordPress
    • SEO
    • JSON
    • JSP
    • JSTL
    • Servlet
    • MongoDB
    • XML
    • Perl

How to run JSP in Eclipse IDE using Apache Tomcat Server

Last Updated: July 26, 2022 by Chaitanya Singh | Filed Under: JSP tutorial

In this tutorial, you will learn how to create a simple JSP file and run it on Eclipse IDE using Apache Tomcat Server.

Step 1: In order to run JSP in Eclipse IDE, you need to have Apache tomcat Server configured in Eclipse IDE.

If you don’t have it installed, then refer this tutorial: How to download and configure Apache Tomcat Server in Eclipse IDE.

Step 2: Open Eclipse and then click File ❯ New ❯ Click Project
dynamic_web_project

Click on Dynamic Web Project located under Web.

If you do not see dynamic web project option in Eclipse then refer this tutorial: How to fix “Dynamic Web project” missing in Eclipse issue

How to run JSP in Eclipse IDE

Give a Project name and click Finish. For my project I’m giving the project name as “BeginnersBook”.
How to run JSP in Eclipse IDE

Step 3: Create a JSP file. Right click on the WebContent ❯ New ❯ Click on JSP File
How to run JSP in Eclipse IDE

Enter file name and click Finish. In this screenshot I am giving the JSP file name as “demo.jsp”.
How to run JSP in Eclipse IDE

Step 4: Write some JSP code.

If you get this warning “The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path” then refer this tutorial: How to fix javax.servlet.http.HttpServlet was not found error in Eclipse.

Step 5: Run the JSP project. Right click on your JSP project ❯ Run as ❯ Click on “Run on Server”.
How to run JSP in Eclipse IDE

Select the Server and click next.
How to run JSP in Eclipse IDE

Click on Add All ❯ Click Finish
How to run JSP in Eclipse IDE

You will see the output of your JSP page in the next window. If you want you can copy the url ://localhost:8080/BeginnersBook/demo.jsp and paste it in your browser, you will see the same output.
How to run JSP in Eclipse IDE

❮ JSP life cycleJSP Scriptlet tag ❯

Top Related Articles:

  1. Solution – The superclass “javax.servlet.http.HttpServlet” was not found on the Java Build Path
  2. JSP Scriptlet Tag (Scripting elements)
  3. Introduction to Java Server Pages – JSP Tutorial
  4. Application Implicit Object in JSP with examples
  5. JSP Directives – Page, Include and TagLib

About the Author

I have 15 years of experience in the IT industry, working with renowned multinational corporations. Additionally, I have dedicated over a decade to teaching, allowing me to refine my skills in delivering information in a simple and easily understandable manner.

– Chaitanya

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

JSP Tutorial

  • Basics of JSP
  • Life cycle of JSP
  • JSP in Eclipse IDE

Scripting Elements

  • Scriptlet Tag
  • Expression tag
  • Declaration tag

Implicit Objects

  • Implicit Objects
  • JSP Request
  • JSP Response
  • JSP Config
  • JSP Application
  • JSP Session
  • JSP Out
  • JSP pageContext
  • JSP Exception
  • Validate session

JSP directives

  • JSP Directives
  • Include Directive

JSP Exception

  • Exception handling

JSP Action

  • Action tags
  • Include action
  • Forward action
  • useBean, setProperty & getProperty

Expression language

  • Expression language

JSP Custom Tags

  • Custom Tags
  • Custom tag example
  • JSP Interview Q

Copyright © 2012 – 2025 BeginnersBook . Privacy Policy . Sitemap