Pr.Pg Next Pg

JSP Include Program

 

JSP page for fetching data at runtime

Sam Sir

<%-- header.jsp --%>

<%-- JSP page for fetching data at runtime --%>

<%

out.println("<b>Employee:</b>"+request.getParameter("employee"));

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

%>

 

 

 

 

JSP program which includes another JSP page using <jsp:include> tag this program will include header.jsp

Sam Sir

<%-- index003.jsp --%>

<%-- JSP program which includes another JSP page using <jsp:include> tag --%>

 

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>JSP Include</title>

</head>

<body>

<table cellspacing="0" border="1">

<tr>

<td>

<jsp:include page="header.jsp" flush="true">

<jsp:param name="employee" value="Jack"/>

<jsp:param name="title" value="Engineer"/>

</jsp:include>

</td>

</tr>

<tr>

<td>

Years of Employment:

</td>

<td>

7

</td>

</tr>

<tr>

<td>

Supervisor:

</td>

<td>

Joel

</td>

</tr>

<tr>

<td>

Salary

</td>

<td>

$98,000

</td>

</tr>

<tr>

<td>

Email:

</td>

<td>

jack123@yahoo.com

</td>

</tr>

</table>

</body>

</html>

Output

Jsp: iclupde

Pr.Pg border                                              Next Pg