2.13.4.1
Syntax
and
{  }*
The first syntax just does a request time inclusion.  In the second case, the values in the 
param subelements are used to augment the request for the purposes of the inclusion.
The valid attributes are:
page
The URL is a relative 
urlSpec
 is as in Section 2.5.2.
Accepts a request time attribute value (which must evaluate to a String 
that is a relative URL specification).
flush
Mandatory boolean attribute. If the value is  true , the buffer is 
flushed. A  false  value is not valid in JSP 1.1.
2.13.5
A 
 element allows the runtime dispatch of the 
current request to a static resource, a JSP pages or a Java Servlet class in the same context as 
the current page. A jsp:forward effectively terminates the execution of the current page. The 
relative 
urlSpec
 is as in Section 2.5.2.
The request object will be adjusted according to the value of the 
page
 attribute.
A 
jsp:forward
 action may have 
jsp:param
 subelements that can provide values for 
some parameters in the request to be used for the forwarding.
If the page output is buffered then the buffer is cleared prior to forwarding.
If the page output was unbuffered and anything has been written to it, an attempt to forward 
the request will result in an 
IllegalStateException
.
Examples
The following element might be used to forward to a static page based on some dynamic 
condition.
<% String whereTo =  /templates/ +someValue; %>
Chapter 2
Standard Syntax and Semantics
68




JSP Web Hosting JavaServer Pages Specifications JSP Hosting




 
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved.