Struts & JSTL <c:out>  
Author Message
tmorrissey





PostPosted: 2003-10-24 0:11:00 Top

java-programmer, Struts & JSTL <c:out> Greetings:

Relative newcomer to Struts and JSTL. My question is about using
<c:out>, pageContext, and request.

My experience has been doing to following in an appropriate action
class. Setting an object as an attribute of the request in the execute
method of the Action Class:

request.setAttribute("object1", Obj1);

Then in the corresponding JSP, pulling the object off the request and
casting it for use:
<% Obj1 local_Obj1 = (Obj1)request.getAttribute("object1");

Then being able to use dot notation to access methods of Obj1.

My question is that with JSTL <c:out> the object needs to be on the
pageContext. Do I need to explicitly set this? If so where? How does
this tag work in this situation?

Any help on the matter is greatly appreciated.
Thank you,
Tim Morrissey
 
VisionSet





PostPosted: 2003-10-24 0:23:00 Top

java-programmer >> Struts & JSTL <c:out>
"TPM" <email***@***.com> wrote in message
news:email***@***.com...

> My question is that with JSTL <c:out> the object needs to be on the
> pageContext. Do I need to explicitly set this? If so where? How does
> this tag work in this situation?
>

No it can be any context, page, request, session or application
They can be refered to explicitly or if not they are all searched.

See the jstl spec

--
Mike W