In an earlier post, I described a class to handle redirects in Struts and passing parameters along. That technique is not necessary; as of Struts 1.2.7, you can use the ActionRedirect class instead.

Read the rest of this entry »

Struts Redirect w/Parameters

January 24, 2006

If you have a Struts Action servlet and you want to redirect to another page, the standard Struts technique is to return an ActionForward and setup an appropriate forward entry in struts-config.xml:

return mapping.findForward("success");

Unfortunately, this doesn’t provide a mechanism for passing request parameters to the target. So what can you do if you want to redirect to another page and pass some parameters along? You use an additional class:

Read the rest of this entry »