Using Include And Pass Value : Include « JSP « Java






Using Include And Pass Value


//File: index.jsp
<%@ page errorPage="errorpage.jsp" %>

<html>
  <head>
    <title>Employee Information</title>
  </head>
  <body>
    <table width="100%" cellspacing="0">
      <tr>
        <td>
          <jsp:include page="header.jsp" flush="true">
            <jsp:param name="employee" value="Bob"/>
            <jsp:param name="title" value="Engineer"/>
          </jsp:include>
        </td>
      </tr>
  </body>
</html>
///////////////////////////////////////////////////////////////
//File: header.jsp
<%
  out.println("<b>Employee: </b>" + 
    request.getParameter("employee"));

  out.println("<br><b>Title: </b>" + 
    request.getParameter("title"));
%>

           
       








UsingIncludeAndPassValue.zip( 88 k)

Related examples in the same category

1.Jsp page includes another Jsp page
2.Jsp Include Static HTML
3.JSP Include
4.Include another file
5.Using Includes
6.Passing parameters during including
7.Forward a request
8.JSP standard action: include