Search This Blog

Thursday, 6 September 2012

Practical-20) Write a JSP page, which uses the include directive to show its header and footer.


Filename-Header.jsp

<html>
<body>
<%= new java.util.Date() %>
</body>
</html>

Filename-Footer.jsp

<html>
<body>
<%! int accesstime; %>
<h2> You are visited <%= ++accesstime %> this time. </h2>
</body>
</html>

Filename-directive.jsp


<html>
<body>
<h1>Header</h1>
<jsp:include page="header.jsp" />
<hr>
<h1>This is example of head and footer and defination-20.</h1>
<hr>
<h1>Footer</h1>
<jsp:include page="footer.jsp" />
</body>
</html>


Output

Header

Tue Apr 10 21:55:37 IST 2012


This is example of head and footer and defination-20.



Footer

You are visited 1 this time.

No comments:

Post a Comment