struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prashanth.S" <suman291...@yahoo.com>
Subject Re: error handling
Date Fri, 27 Jun 2003 10:23:09 GMT
ya
I agree with nicolas.But is there any way of  doing it typically THE STRUTS WAY???
cheers
Prashanth

Nicolas De Loof <nicolas.deloof@cgey.com> wrote:
>
> But by doing in this way, for the forward name="failure" I will always end up in StatuicUpload.jsp
> (for the below example) I don't want to goto that jsp. I need to goto the parent page.
> Let me explain the scenario once again. From two different jsps (say a.jsp and b.jsp)
I am coming to
> an action (bt clicking the link in each jsp). From this action, upon an error I want
to go back to
> "a.jsp" (if the request came from a.jsp) or to b.jsp (if the request came from b.jsp).
So here I
> won't be able to hard code the path either as "a.jsp" or as "b.jsp" in the struts-config.xml.
In
> you example upon error, it will always forward to StaticUpload.jsp
>
> Thanks,
> Pramod

If you really cannot set multiples action-mappings in struts-config.xml (that is the cleaner
way to do), you can add a
parameter to your request for the "incoming" JSP :



and build a new forward in your action when errors occurs :

if (!errors.isEmpty()) {
saveErrors(request, errors);
String commingFrom = request.getParameter("from");
return new ActionForward(from);
}


Nico.


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



---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message