Atta;
 
Thanks for the response.  You are correct in your assumption about the
scriplet approach - it is exactly what I was attempting to avoid by
using tags.
 
I tried using the <bean:write.. tag as you suggested, but was getting
the JSP error of not finding a bean value in any scope.
What did work for me was using the <c:out...  tag with EL syntax, as
your example showed.
 
You got me back on track - thanks for your help!
 
Regards,
 
--Chris 
 
 

>>> [EMAIL PROTECTED] 12/6/2005 11:19:42 PM >>>

Chris,

I'm sure you'd know scriplet way of doing it, which I'm not going to
recommend: <%=request.getAttribute("toDate") %>.

Struts' bean:write should do it: <bean:write scope="request"
name="toDate"/>

Better still if you're using Servlet 2.4 compliant app server/servlet
container you could use JSTL expressions: ${toDate} and it will search
the
attribute in app, session, request and page scope for you. Same thing
as
<c:out value="${toDate}"/>. You'd, of course, need to include TLDs for
JSTL
in the latter case.

Hope this helps.

ATTA



On 12/6/05, Christopher Becker <[EMAIL PROTECTED]> wrote:
>
> I am setting request attributes in an Action class such as in the
> following example:
>
>             request.setAttribute("toDate", toDate);
>             request.setAttribute("acctNum", acctNum);
>
> Both variables toDate and acctNum are Strings. I then process the
> action by returning a mapping.findForward to a JSP page.
>
> I wish to be able to access these attributes as scripting variables
on
> my JSP page, and display their values if they happen to have them
(e.g
> not empty String or null, which could be possible).
>
> My question - how do you access request attributes with Struts tags
and
> make them available as scripting variables?
>
> I have tried using <bean:define>, but have been unsuccessful.
>
> Any guidance or help would be appreciated... thanks!
>
> --Chris
>
>

Reply via email to