struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Bessette" <besse...@650dialup.com>
Subject RE: Can't store object in request from an action
Date Mon, 17 Nov 2003 16:06:42 GMT
Thanks for the info.  It is redirecting to the jsp url, however the redirect
attribute is false.

Thanks,
Eric

-----Original Message-----
From: Max Cooper [mailto:max@maxcooper.com]
Sent: Saturday, November 15, 2003 6:44 AM
To: Struts Users Mailing List
Subject: Re: Can't store object in request from an action


If the request arrives at the JSP from the input attribute on the action
mapping due to a validation error (from calling validate() on the
ActionForm), the action is not part of the processing loop. Struts calls
validate() and then forwards the request directly to the input JSP if a
validation error is encountered.

If there is no validation error occurring, it may be that you have the
redirect attribute of the forward set to true, which results in the action
processing the request and sending a redirect to the JSP, and then the
browser requests the JSP directly, which will be a new request (and thus
anything you put in the request in the action won't be visible to the JSP).
If the URL in the browser window shows the JSP's URL (instead of the Action
URL) at this point, that is what is happening.

-Max

----- Original Message -----
From: "Bessette" <bessette@650dialup.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Friday, November 14, 2003 10:31 PM
Subject: RE: Can't store object in request from an action


> I know that's not the issue, because I also print out all of the request
> keys and their objects.
>
> The main purpose behind this is getting the ActionErrors and
ActionMessages
> to work properly.  I use saveErrors and saveMessages, but the
> <html:messages> tag doesn't display anything.
>
> If anyone has any insights, they'd be very appreciated.
>
> Thanks,
> Eric
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Friday, November 14, 2003 9:21 PM
> To: Struts Users Mailing List
> Subject: Re: Can't store object in request from an action
>
>
> Try this instead:
>
> ...
> <%= request.getAttribute( "testing" ) %>
> ...
>
> -Richard
>
>
> At 07:38 PM 11/14/2003, you wrote:
> >I'm trying to set an attribute in the request scope from an action.
> >However, when I do the following:
> >
> >...
> >public ActionForward execute(
> >         ActionMapping mapping,
> >         ActionForm form,
> >         HttpServletRequest request,
> >         HttpServletResponse response)
> >         throws Exception {
> >
> >         request.setAttribute( "testing", "This is a test" );
> >         return mapping.getInputForward();
> >}
> >...
> >
> >and in my jsp page, I do:
> >
> >...
> ><%= pageContext.findAttribute( "testing" ) %>
> >...
> >
> >
> >I always get null.  Is the request sent to the execute statement the same
> >one used for the forward?  Could this be because I want to forward to the
> >input jsp?  Please, please help me out.  I've been spinning my wheels for
a
> >few days now trying to figure this out.
> >
> >Thanks,
> >Eric
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>




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


Mime
View raw message