JSP Include : Include « JSP « Java






JSP Include

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

<html>
  <head>
    <title>Welcome to JSP</title>
  </head>
  <body>
    <table width="100%">
      <tr>
        <td>
          <%@ include file="titlebar.jsp" %>
        </td>
      </tr>
      <tr>
        <td>
        <%
          out.println("<center><b>This is the client area.</b></center>");
        %>
        </td>
      </tr>
    </table>
  </body>
</html>


//////////////////////////////////////////////////////////////
//File: titleBar.jsp
<table>
  <tr>
    <td>
      <%
        // Get the User's Name from the session
        out.println("<b>Hello: " + request.getParameter("user") + "</b>");
      %>
    </td>
  </tr>
</table>  


           
       








IncludingAnotherJspPage.zip( 89 k)

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.Include another file
5.Using Includes
6.Passing parameters during including
7.Forward a request
8.JSP standard action: include