Yes,that's right,thanks. just a little difference here,
ActionA can has the formbean of page1.jsp and ActionB cannot(because it cannot be tied with many jsps, and actually it need to be tied with a new success.jsp).So my soltion is put the ActionA in ActionB's request parameter instead of getting it from formbean,like this statement in page1.jsp:
<META HTTP-EQUIV=refresh CONTENT="30;URL=/../ActionB.do?preurl=/../ActionA.do">
I have written a custom tag to replace it like this: <app:redirect page="/ActionB.do" preurl="ActionA.do"/>
so I just have one question, how to nicely replace the string after "preurl=" with the hidden var value. how about just like this:
<html:hidden property="theAction" value="ActionA" />
<app:redirect page="/ActionB.do" propery="theAction"/>
Can it work? and how can the tag class recognize the formbean's variable? maybe this is the key point here.
Regards, Alex
us whereFrom: "Geeta Ramani" <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: Struts Users Mailing List <[EMAIL PROTECTED]> Subject: Re: how to implement such an action? Date: Thu, 18 Mar 2004 08:20:50 -0500
Alex:
ok, let me state the problem as i understand it:
ActionA --> page1.jsp -->ActionB
if (success in ActionB) forward to success.jsp else forward to ActionA.
Your question is how to get the "if failure" part working.
If my understanding of your problem is wrong, please write back and tell
I'm wrong.using><html:hidden property="theAction" value="ActionA" />
However, if this *is* the problem, here's how you can implement a solution
hidden vars:
In page1.jsp, use a hidden var:
as
In ActionB.execute, if failure do the following:
String theAction = formBean.getTheAction(); ActionForward failureForward = new ActionForward(); failureForward.setName("failure); failureForward.setPath(theAction); log.debug("Redirecting to " + failureForward.getName() +": " + failureForward.getPath()); return failureForward;
Hth, Geeta
chiu alex wrote:
> Maybe there is a solution,which is much like using hidden jsp variable
> you said in previous mail.
> > Regards, > Alex
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]