Previous | Home | Next |
jsp:include action tag
In jsp:include action tag can be include the content of another resource it may be jsp, html or servlet.
It can be includes the resource at request time make a dynamic pages and also make include static pages.
Advantage
Code reusability : In this tag is use a page many times such as including header and footer pages in all pages with saves a lot of time.
Syntax of jsp:include action tag with parameter
<jsp:include page="relativeURL | <%= expression %>">
<jsp:param name="parametername" value="parametervalue | <%=expression%>" />
</jsp:include>
<jsp:include page="relativeURL | <%= expression %>">
<jsp:param name="parametername" value="parametervalue | <%=expression%>" />
</jsp:include>
<h2>this is index page</h2>
<jsp:include page="printdate.jsp" />
<h2>end section of index page</h2>
<h2>this is index page</h2>
<jsp:include page="printdate.jsp" />
<h2>end section of index page</h2>
<% out.print("Today is:"+java.util.Calendar.getInstance().getTime()); %>
<% out.print("Today is:"+java.util.Calendar.getInstance().getTime()); %>