JSP Hello World Program Tutorial with Eclipse and Tomcat Server


Posted on : Sun, 1st Nov 15 09:34 am UTC
2314 votes

Tutorial Requirement :

1. Create a New Dynamic Web Project
Dynamic Web Project




In Eclipse under Project Explorer Right Click -> New -> Dynamic Web Project.

Enter Project name : HelloWorld

Target Runtime : Apache Tomcat vX.X

Click : Next -> Next

On Web Module Page Check "Generate web.xml deployment descriptor" -> Finish.

2. Creating JSP page :

File : index.jsp Language : JSP
<%@page import="java.sql.Date"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    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 Hello World Program</title>
</head>
<body>
  <%= "<h1>JSP : Hello World!!</h1> <br/> Today's DateTime : " %>
  <%= new java.util.Date() %>
</body>
</html>

3. Creating Tomcat Server:

4. Running JSP HelloWolrd Project :

Output :

Output JSP Hello World Program using Eclipse Tomcat Server


Output : JSP Hello World Program using Eclipse Tomcat Server

Code2care's mission is to share varied knowledge in technical and non-technical areas gathered during day-to-day learnings and development activities so that our visitors can leverage this portal to find solutions to their queries without re-inventing the wheel. Technical posts include Learnings, Tutorials, Video Tutorials, Code Snippets, Tips-n-tricks.

Follow us : Facebook - Twitter - Google +