How do I include other pages using jsp:include?
Category: taglib / jstl, viewed: 4K time(s).
The <jsp:include/> tag is use to include another page fragment of a JSP page into another page. This is useful when you have a common page such as header, footer or a menu that applied to many of all of your pages.
Here are the page fragment of the header.jsp, footer.jsp and menu.jsp. All of them are placed in the common folder in the same location with the index.jsp file.
header.jsp
<strong><jsp:include/> Demo</strong> <hr/> <jsp:include page="menu.jsp"/>
footer.jsp
<hr/> © 2009 Kode Java Org.
menu.jsp
<a href="/ex01/index.jsp">HOME</a>
When you access your page from the servlet container such as Apache Tomcat you'll have a complete display of a page that contains header, menu, content and footer.
More examples on taglib / jstl
|
|