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

Reply via email to