Passing parameters during including : Include « JSP « Java






Passing parameters during including

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

//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