struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsarris <chi...@gmail.com>
Subject Re: Set request parameters in servlet through action
Date Tue, 04 Jan 2005 13:53:14 GMT
On Tue, 4 Jan 2005 14:37:54 +0100, brenmcguire@tariffenet.it
<brenmcguire@tariffenet.it> wrote:
> >
> > Thus, if I set an attribute using the HttpServletRequest.setAttribute,
> > how can I retrieve it my JSP page?
> > I know that all these can be very easy using an ActionForm, but I do
> > not want to create an ActionForm for just a plain String attribute.
> >
> 
> Supposing in the Java code:
> 
> <snip>
> String myThing;
> ..
> request.setAttribute("myThing", myThing);
> </snip>
> 
> In the JSP code do this:
> 
> <bean:write name="myThing" scope="request" />
> 
> Obviously include the "struts-bean" tag library in your JSP page.
> Notice that 'scope="request"' is optional.

I am using the JSTL:core tag libs ar a replacement of the "struts-bean" tag.

Thus, is the following equivalent?

JSP:
<c:out value="${myThing}"/>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message