Showing posts with label include directive. Show all posts
Showing posts with label include directive. Show all posts

JSP include directive


// JSPMP.jsp

<!-- JSP -->

<jsp:directive.include file="JSPHdr.jsp"/>
<jsp:directive.include file="JSPCon.jsp"/>
<jsp:directive.include file="JSPFtr.jsp"/>

// JSPHdr.jsp
<!-- JSP -->

<html>  
     <body>
     <center><h2>
          Header file - Welcome to JSP
     </h2></center>
     </body>
</html>

// JSPCon.jsp
<!-- JSP -->

<html>  
     <body>
     <center><h2>
          Content - This page is about JSP
     </h2></center>
     </body>
</html>

// JSPFtr.jsp
<!-- JSP -->

<html>  
     <body>
     <center><h2>
          Footer - Created by Anurekha
     </h2></center>
     </body>
</html>

JSP Page directive and include directive


<!-- JSP Page and include directive and Attributes -->

<html>
<body>

<h2><center>
<%@ page import="java.util.*" %>
<% out.println((new Date()).toLocaleString()); %>
<br/>

<%@ page session="true" %>
<% out.println(session.getCreationTime()); %>
<br/>

<% out.println(request.getRequestURL()); %>
<br/>

<% out.println(session.getLastAccessedTime()); %>
<br/>

<% out.println(session.getMaxInactiveInterval()); %>
</center></h2>

<jsp:directive.include file="JSP1.jsp"/>
<jsp:directive.include file="wel.txt"/>

</body>
</html>