beginnersbook.com

  • Home
  • All Tutorials
    • Learn Servlet
    • Learn JSP
    • Learn JSTL
    • Learn C
    • Learn C++
    • Learn MongoDB
    • Learn XML
    • Learn Python
    • Learn Perl
  • Core Java
  • OOPs
  • Collections
  • Java I/O
  • JSON
  • DBMS

How to run JSP in Eclipse IDE using Apache Tomcat Server

By Chaitanya Singh | Filed Under: JSP tutorial

In this tutorial, we will 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 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

Give a Project name and click Finish.

Step 3: Create a JSP file. Right click on the WebContent ❯ New ❯ Click on JSP File

Enter file name and click Finish.

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”.

Select the Server and click next.

Click on Add All ❯ Click Finish

You will see the output of your JSP page in the next window. If you want you can copy the url and paste it in your browser, you will see the same output.

Enjoyed this post? Try these related posts

  1. Config Implicit Object in JSP with examples
  2. OUT Implicit Object in JSP with examples
  3. JSP Expression Tag – JSP Tutorial
  4. How to fix Dynamic Web Project missing in Eclipse issue
  5. jsp:useBean, jsp:setProperty and jsp:getProperty Action Tags
  6. pageContext Implicit Object in JSP with examples

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
  • Declaration tag
  • Expression tag
  • Scriptlets
  • Directives
  • Include Directive
  • Param Directive
  • Exception handling
  • Action tags
  • Include action
  • Forward action
  • useBean, setProperty & getProperty
  • Implicit Objects
  • Session implicit object
  • Validate session
  • Request implicit object
  • Response implicit object
  • Out implicit object
  • Application implicit object
  • Config implicit object
  • pageContext implicit object
  • Exception implicit object
  • Expression language
  • Custom Tags
  • Custom tag example
  • JSP Interview Q

Recently Added..

  • JSON Tutorial
  • Java Regular Expressions Tutorial
  • Java Enum Tutorial
  • Java Annotations Tutorial

Copyright © 2012 – 2019 BeginnersBook . Privacy Policy . Sitemap