Why use 'redirect=true' in struts 1.* forward?

Raibaz picture Raibaz · Mar 5, 2009 · Viewed 55.8k times · Source

I've been having some problems with ActionMessages created during execution of an action which didn't display, and I found out that my problems were due to my forwards having redirect=true in struts-config.xml.

Since the default behavior is redirect=false, I've been thinking about which benefits can one have using redirect=true and I couldn't find any answer. Does anyone know when and why redirect=true should be used in action forwards?

Answer

Boris Pavlović picture Boris Pavlović · Mar 5, 2009

it prevents the 'double submit problem'

Never show pages in response to POST

Always load pages using GET

Navigate from POST to GET using REDIRECT

more on this here and here