Search code examples
struts

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


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?


Solution

  • 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