Sunday, 25 March 2018

jsp program to demonstrate include and farward


Write a JAVA JSP Program which uses jsp: include and jsp: forward action to display a Web page.
jsp:forward action tag with parameter

// index.jsp

<html> 
<body> 
<h2>this is index page</h2> 
 
<jsp:forward page="printdate.jsp " > 
<jsp:param name="name" value="javatpoint.com" /> 
</jsp:forward> 
 
</body> 
</html> 

Printdatejsp
<html> 
<body> 
 
<% out.print("Today is:"+java.util.Calendar.getInstance().getTime()); %> 

<%= request.getParameter("name") %> 
 
</body> 
</html>

jsp:include action tag without parameter

// index.jsp
<h2>this is index page</h2> 
 
<jsp:include page="printdate.jsp" /> 
 
<h2>end section of index page</h2> 

printdate.jsp

<% out.print("Today is:"+java.util.Calendar.getInstance().getTime()); %>



1 comment:

  1. Really I enjoy your blog with an effective and useful information. Very nice post with loads of information. Thanks for sharing with us.
    Core Java Training
    best java training institute in chennai with placement

    ReplyDelete

PUBLISHER & SUBSCRIBER PATTERN

Using the UML Drawing Tool by implementing the code in Java demonstrate the Observer  Design Pattern. The Publisher-Subscriber desig...