JSP

JSP Projects

JSP Project

First JSP program.
Previous Home Next

 

In this section you will learn how to create your first JSP page and then run on the Tomcat Server. Tomcat server is one of the most popular Servlet Container for deploying and running the Java based application. In this topic you will learn how to make your web application and run on Tomcat Server.
Java Server Pages is simple text file with .jsp extension and it contains HTML code along with embedded Java Code. JSP file is compiled into Servlet and then run on the Tomcat. Tomcat server automatically compiles the JSP file into Servlet.

Simply inside the HTML code using H1 heading we write Hello World!

Directory Structure of Web Application
/myjsp/
     index.jsp
             WEB-INF
                          web.xml
                                       classes
                                                    lib
You should save the "index.jsp" file into the root of the web application as shown below.

 


 

<%--
Document : index
Created on : Mar 5, 2011, 12:36:04 AM
Author : R4R
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
<p>
This is my first web page
</p>
</body>
</html>

Hello World!

This is my first web page

Previous Home Next