Skip to main content

Creating First JSP Program using Eclipse

Steps to Create JSP project in eclipse

1. Create Dynamic web Project in eclipse


1-dynamic-web-project

2. Eclipse Automatically Create Project Structure


2-jsp-project
3. Right click on Web content and select new and Create JSP file


3-create-new-jsp

index.jsp


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
 
<h1>This is JSP page</h1>
 
<p> Javaforlearn is a platform where newbie programmer find a way to learn different Technology 
    like java, J2EE, SQL, ODI , OBIEE and data warehouse concept.</p>
 
 
<%
 
//here you can write java code.
 
//Printing simple message in console
System.out.println("Hi Application is running ");
 
 
//Printing simple message in Browser
out.println("Hi This is Bhavesh Lakhani");
 
 
%>
 
</body>
</html>

4. You can see index.jsp file under web content folder


4-jsp-file
5. Right click on index.jsp file and select Run as and select Run on server


5-running-jsp
6. You can see output in Browser


6-simple-jsp
7. console output.


7-console-output