GTU WTAD Practical 20 : Write a JSP page, which uses the include directive to show its header and footer

GTU WTAD Practical 20 :  Write a JSP page, which uses the include directive to show its header and footer

GTU WTAD Practical 20 : Write a JSP page, which uses the include directive to show its header and footerThis example explains how you can include some pages in JSP. For example you can create separate file for header and footer and you can include it in each page sothat if any changes is required you just need to update only one file.

Jump to GTU WTAD Practical 21

File Name : index.jsp

File Location : Tomcat_Apache\webapps\gtu20\

<html>
	<head>
		<title>GTU WTAD Practical 20</title>
	</head>
	<body>
	
		<jsp:include page="header.jsp" />
	
		<br><br><br><br>
		
		Above Line is from header page, and following line is from footer page
		
		<br><br><br><br><br><br><br><br><br><br><br><br>
	
		<jsp:include page="footer.jsp" />
	
		
	</body>
</html>

 

File Name : header.jsp

File Location : Tomcat_Apache\webapps\gtu20\

<font color="red"><h2 align="center"> GTU WTAD Practical 20 :  Write a JSP page, which uses the include directive to show its header and footer </h2></font>
<hr>

 

File Name : footer.jsp

File Location : Tomcat_Apache\webapps\gtu20\

<hr>
<h2 align="center"> Developed by: Adarsh Patel </h2>

 

Output

GTU WTAD Practical 20 : Write a JSP page, which uses the include directive to show its header and footer

Leave a Reply