Can't you solve your problem by using an action alias for the MyAction.class when it is submitted from B.jsp? So A.jsp would submit to MyAction.class and in your views.properties you would map the MyAction result to A.jsp B.jsp would submit to MyAliasAction.class and in your views.properties you would map the MyAliasAction result to B.jsp ?
So your views.properties could be something like: # Create an alias for the MyAction MyAliasAction.action=MyAction.action MyAction.success=A.jsp MyAliasAction.success=B.jsp Would this not solve your problem, or is it impossible for the A.jsp and B.jsp to submit to something other than MyAction, for some reason? Cheers, Dick [EMAIL PROTECTED] ----- Original Message ----- From: "Ryan Schutt" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, May 27, 2003 9:42 PM Subject: [OS-webwork] Re: error using referrer.action > I'm using Webwork 1.3 RC2, and indeed, that is the cause of the problem. But > I've realized that using referrer won't solve my problem since it performs a > redirect. (I need to do a forward.) Here's my scenario: > > A.jsp submits to Action.class > B.jsp submits to Action.class > > Action.class needs to forward back to either A.jsp or B.jsp on invalid data. I > need to *forward*, not redirect, since request params and error messages are > lost when you redirect. > > Since you can't do this in views.properties, I tried using the JSP action class > to forward back to A.jsp or B.jsp (determined by the referer header). I could > see things happening on the server side, but on the client, I got no response. > Looking at the code for JSP.java, I see that it uses a response wrapper that > consumes all write operations!? > > I then tried to manually use RequestDispatcher and forward to the referer that > way. This worked, except that no error messages were being printed in the > forwarded jsp. (Why? I thought this approach would work.) > > So the question is: how can I dynamically forward to a jsp such that request > params and error messages will be seen in the jsp? > > > Thanks, > Ryan > > > > From: "Dick Zetterberg" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Subject: Re: [OS-webwork] error using referrer.action > > Date: Tue, 27 May 2003 09:37:03 +0200 > > Reply-To: [EMAIL PROTECTED] > > > > Hi Ryan, > > What version of WW are you using? If you are using 1.2.x or any of the = > > 1.3RC then you have a problem because you are adding errors so the = > > validate method in the Redirect action fails (the Referrer extends = > > Redirect). > > This has been fixed in the 1.3 final version so I recommend you try that = > > version instead. The fix was that the Redirect action now overrides the = > > validate method so that previous errors do not stop it from executing. > > > > Best regards, > > > > Dick Zetterberg > > [EMAIL PROTECTED] > > ------------------------------------------------------- This SF.net email is sponsored by: ObjectStore. If flattening out C++ or Java code to make your application fit in a relational database is painful, don't do it! Check out ObjectStore. Now part of Progress Software. http://www.objectstore.net/sourceforge _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork