Contact Us
   
   
 
   
   
 
     
 
 
JSP Tutorial
 
Book Must Read
 
 

Simple JSP Example with Syntax

 
 
Print   Email
 
     
 

 

In tomcat, all JSP code should be copied (Deployed) into webapps folder and create own folder in webapps e.g jsp, in jsp folder copy all your jsp files. Remember, Java is case sensitive language.

1. JSP Example Simple Print on browser

jspExample1.jspOutput
 

<html>
<body>
<%
 out.print("Hello World!");
%>
</body>
</html>

2. JSP Example Expression base print on browser

jspExample2.jspOutput

 
<html>
<body>
<%="Hello World!"%>
</body>
</html>

3. JSP Example Current date print on browser

jspExample3.jspOutput

 
<%@ page  language="java" import="java.util.*" errorPage="" %>
<html>
<body>
Current Date time: <%=new java.util.Date()%>
</body>
</html>

In above example, we need to add package of date import=”java.util.*”

Run this jsp file on browser with URL path

http://localhost:8080/jsp/jspExample1.jsp

 

 

 

 
If You Like this Article, share this

 
 
     
   
  View Forum Post  
 
Optimization of SQL queries for better performance
Example of Between in mysql
Example of sorting in mysql table
Example of join in mysql
Example of subquery in mysql
union join in mysql with example
error too many connection in mysql
calculate second highest salary
How to use select queries with array in mysql
Radio button pre selected in struts
Exception in thread "main" java.lang.NoClassDefFoundError
tree view in jsp
SSL implement in tomcat and java certificate
WARNING: Internal error flushing the buffer in release()
DynaForm validation problem in struts not working
Accessing JavaBean in servlet or servlet in javaBean.
 
     
     
   
     
     
     
 
  Privacy Policy