To make use of the RedirectTracker you have to:

  • Add the myfaces sandbox to your project.
  • Configure the init parameter "org.apache.myfaces.redirectTracker.POLICY" in your web.xml file, setting the value to one of the following:
    • org.apache.myfaces.custom.redirectTracker.policy.FullRedirectTrackPolicy
      • captures the locale, request scoped beans, messages
    • org.apache.myfaces.custom.redirectTracker.policy.MessagesRedirectTrackPolicy
      • captures messages only
    • org.apache.myfaces.custom.redirectTracker.policy.NoopRedirectTrackPolicy
      • captures nothing - default setting
  • Configure the init parameter "org.apache.myfaces.redirectTracker.MAX_REDIRECTS" if necessary (default is 20).

If everything is correctly configured, you should see an additional parameter "_rtid=" added to the url (after the redirect). This url parameter will be used to find the captured data within the session. Simply adding the data to the session will not work with browser back, reload, multiple windows etc.

Other discussions of RedirectTracker.

  • No labels