Java Reference
In-Depth Information
16
T ABLE 16.5
Attributes for the <jsp:param> Action
Attribute
Definition
This attribute represents the name of the parameter being referenced.
name
This attribute represents the value of the named parameter.
value
The <jsp:include> Standard Action
The <jsp:include> action provides a mechanism for including additional static and dynamic
resources in the current JSP page. The syntax for this action is as follows:
<jsp:include page=”urlSpec” flush=”true” />
and
<jsp:include page=”urlSpec” flush=”true”>
<jsp:param ... />
</jsp:include>
The first syntax description does a request-time inclusion, whereas the second contains a list of
param sub-elements that are used to argument the request for the purpose of inclusion. Table
16.6 contains the attributes and their descriptions for the <jsp:include> action.
T ABLE 16.6
The Attributes for the <jsp:include> Action
Attribute
Definition
This attribute represents the relative URL of the resource to be included.
page
This attribute represents a mandatory Boolean value stating whether or not the
buffer should be flushed. Currently, true is the only valid value for this attribute.
flush
To further explain how the <jsp:include> works, we will create two JSPs. The first, which will
be the included JSP, will act as the header of the second JSP document. This JSP will search the
request for an employee's name and title. Listing 16.3 contains the source for your first JSP.
L ISTING 16.3
header.jsp
<%
// Get the Employee's Name from the request
out.println(“<b>Employee: </b>” +
request.getParameter(“employee”));
// Get the Employee's Title from the request
out.println(“<br><b>Title: </b>” +
request.getParameter(“title”));
%>
 
Search WWH ::




Custom Search