Struts & JSTL <c:out>

T

TPM

Greetings:

Relative newcomer to Struts and JSTL. My question is about using
<c:eek:ut>, 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:eek:ut> 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
 
V

VisionSet

My question is that with JSTL <c:eek:ut> 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top