An attribute value of the form
 <%= 
scriptlet_expr
 %>  or `<%= 
scriptlet_expr
 %>' denotes 
a 
request time attribute value
. The value denoted is that of the scriptlet expression involved. 
Request time attribute values can only be used in actions. If there are more than one such 
attribute in a tag, the expressions are evaluated left to right.
Only attribute values can be denoted this way (e.g. the name of the attribute is always an 
explicit name), and the expression must appear by itself (e.g. multiple expressions, and 
mixing of expressions and string constants are not permitted; instead perform these 
operations within the expression).
The resulting value of the expression depends upon the expected type of the attribute's value. 
The type of an action element indicates the valid Java programming languag type for each 
attribute value; the default is 
java.lang.String
.
By default, all attributes have page translation time semantics. Attempting to specify a 
scriptlet expression as a value for an attribute that has page translation time semantics is 
illegal, and will result in a fatal translation error. The type of an action element indicates 
whether a given attribute will accept request time attribute values.
Most attributes in the actions defined in the JSP 1.1 specification have page translation time 
semantics.
The following attributes accept request time attribute expressions:
The 
value
 and 
beanName
 attributes of 
jsp:setProperty
 (2.13.2).
The 
page
 attribute of 
jsp:include
 (2.13.4).
The 
page
 attribute of 
jsp:forward
 (2.13.5).
The 
value
 attribute of 
jsp:param 
(
2.13.6)
.
2.12.2
The 
id
 Attribute
The 
id= name 
 attribute/value tuple in an element has special meaning to a JSP container, 
both at page translation time, and at client request processing time; in particular:
the 
name
 must be unique within the translation unit, and identifies the particular element 
in which it appears to the JSP container and page.
Duplicate 
id
's found in the same translation unit shall result in a fatal translation error.
In addition, if the action type creates one or more object instance at client request 
processing time, one of these objects will usually be associated by the JSP container with 
the named value and can be accessed via that name in various contexts through the 
pagecontext 
object described later in this specification. 
Furthermore, the 
name
 is also used to expose a variable (name) in the page's scripting 
language environment. The scope of this scripting language dependent variable is 
dependent upon the scoping rules and capabilities of the actual scripting language used in 
the page. Note that this implies that the 
name
 value syntax shall comply with the variable 
naming syntax rules of the scripting language used in the page.
Chapter 2
Standard Syntax and Semantics
58




JSP Web Hosting JavaServer Pages Specifications JSP Hosting




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