2

This is a simple jsp program.can anyone tell me the steps to run it?

<%-- 
Document   : helloworld
Created on : Dec 20, 2010, 10:20:48 PM
Author     : eswar
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
</head>
<body>

    <p> Hi, <h3><%="Hello!" %></h3></p>
    <p>You successfully run a simple jsp program.</p>
    <p>Learn More concept about jsp.</p>

</body>
</html>
MaVRoSCy
  • 17,747
  • 15
  • 82
  • 125
user2893698
  • 41
  • 1
  • 1
  • 6

3 Answers3

6

You need a JSP/Serlvet container that can server JSP pages for you. There a number of JSP/Servlet containers available and used but the most commonly used is Apache Tomcat.

To setup Tomcat,

  1. simply download it and extract it into any folder
  2. Next, place your application inside the webapps folder
  3. Start the server.
  4. Open your browser and browse to URL http://localhost:8080, it should open the tomcat's default page
  5. Package your application as war, and place it in the webapps folder of tomcat
  6. Now Access the URL http://localhost:8080/YourApplicatioContext/path/to/jspFile and you will see your JSP file being compiled and served in the browser
Saif Asif
  • 5,516
  • 3
  • 31
  • 48
1

You need servlet container, connector component and the JSP engine to run JSP pages. In case of tomcat, Catalina is actually the servlet container. Coyote is the connector that handles the requests and forwards them onto Catalina. Web Pages are then delivered dynamically through Jasper, the JSP engine.

uttsav
  • 169
  • 1
  • 4
0

you need to have jsp container to execute you jsp files. you can use Tomcat(has jsp container in it) to run your jsp.

pappu_kutty
  • 2,378
  • 8
  • 49
  • 93