How do I include other pages using jsp:include?
Category: taglib / jstl, viewed: 647 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.
Can't find what you are looking for? Join our FORUMS and ask some questions!
Download Hundreds of Complimentary Industry Resources
Get hundreds of popular Industry magazines, white papers, webinars, podcasts, and more;
all available at no cost to you. With more than 600 complimentary offers, you'll find
plenty of titles to suit your professional interests and needs.
Click Here and Sign up today!
Related Examples
|
|
