I never saw this post show up on the list the first time, so I'm reposting. 
I'd like to do similar things with mapping.getInput().getPath().

Thanks,

Matt

--- Matt Raible <[EMAIL PROTECTED]> wrote:
> Date: Thu, 30 Aug 2001 04:48:12 -0700 (PDT)
> From: Matt Raible <[EMAIL PROTECTED]>
> Reply-to: [EMAIL PROTECTED]
> Subject: Changing the path of a mapping's foward (code review)
> To: [EMAIL PROTECTED]
> 
> I am changing the path of a mapping's forward name="success" to add
> parameters
> on to it.  The reason I am adding these parameters is because I have to have
> a
> "redirect=true" on my forward in the struts-config file.  If I don't, and I
> try
> to forward to another action, iPlanet chokes.  I add the redirect="true" and
> it
> works, but I lose my request variables.
> 
> So I'd love it if folks could look at my code and maybe offer better
> suggestions.  The way I'm doing it seems like a lot of work for something so
> simple.  Keep in mind that what I've written below works like a charm - just
> seems extensive - Thanks!
> 
> // Get the path of the "success" forward
> String path = new String(mapping.findForward("success").getPath());
> 
> // check to see if the "success" forward has already been modified
> // for some reason, changing the path actually gets persisted and 
> // the path is still modified if I hit this action again
> int ampIndex = path.indexOf('&');
> 
> if (ampIndex > -1) // already been modified, chop it off
> {
>       log(_className, " Path already modified, '&' at index '" + ampIndex + "'");
>       path = path.substring(0, ampIndex);
> }
>       
> // HolidayDO is a Value Object that we use to pass around
> // between our EJB's and ActionForms
> path += "&month=" + aHolidayDO.getMonth();
> path += "&year=" + aHolidayDO.getYear();
>       
> // Forward control to the specified success URI
> log(_className, " Forwarding to 'success' page at path '" + path + "'");
> mapping.findForward("success").setPath(path);
> 
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
> http://im.yahoo.com
> 


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

Reply via email to