for 
NESTED
, after 
doInitBody
 and 
doAfterBody
 for a tag handler implementing 
BodyTag
, and after 
doStartTag
 otherwise.
for 
AT_BEGIN
, after 
doInitBody,
doAfterBody,
and
doEndTag
 for a tag 
handler implementing 
BodyTag
, and 
doStartTag
 and 
doEndTag
 otherwise.
for 
AT_END
, after 
doEndTag
 method.
5.6
Cooperating Actions
Often two actions in a JSP page want to cooperate, perhaps by one action creating some 
server side object that is used by the other. There are two basic mechanisms in the JSP 
specification to achieve this.
5.6.1
Ids and PageContext.
One mechanism for supporting cooperation among actions is by giving the object a name 
within the JSP page; the first action creates and names the object while the second action 
uses the name to retrieve the object.
For example, in the following JSP page fragment the 
foo
 action creates a server side object 
and give it the name  myObject . Then the 
bar
 action accesses that server side object and 
takes some action.
In a JSP container implementation, the mapping between the name and the value is kept by 
the implicit object pageContext. This object is passed around through the tag handler 
instances so it can be used to communicate information: all it is needed is to know the name 
under which the information is stored into the pageContext.
5.6.2
Run Time Stack
An alternative to explicit communication of information through a named object is implicit 
coordination based on syntactic scoping.
For example, in the following JSP page fragment the foo action might create a server side 
object; later the nested bar action might access that server side object. The object is not 
named within the pageContext: it is found because the specific foo element is the closest 
enclosing instance of a known element type.
109
JavaServer Pages 1.1 Specification  
November 30, 1999




JSP Web Hosting JavaServer Pages Specifications JSP Hosting




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