Passing parameters during including : Include « JSP « Java

Passing parameters during including

<title>This page passes parameters</title>
<!-- header from include-->
<jsp:include page="includeFileNeedingAParameter.jsp">
  <jsp:param name="department" value="Electrical"/>
Above text is from includeFileNeedingAParameter.jsp.

//File : includeFileNeedingAParameter.jsp
<!-- the included file -->
<h1><%=request.getParameter("department") %> Department</h1>


Related examples in the same category

1.Jsp page includes another Jsp page
2.Jsp Include Static HTML
3.Using Include And Pass Value
4.JSP Include
5.Include another file
6.Using Includes
7.Forward a request
8.JSP standard action: include