Announcement Announcement Module
No announcement yet.
Getting Form Object after Redirect? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting Form Object after Redirect?

    Is it possible to somehow get my form object after a redirect? I know all previous information stored in the previous request get lost, but I thought that information stored in flow scope are still accessbile.

    Perhaps, when I llook back at this post in the morning I will kick myself.


  • #2
    Anything in flow scope continues to live beyond a single request so long as the flow is still active and restored properly from storage. I'm trying to figure out why you'd want to do a redirect at any place other than a end state, though.

    To access the form object simply refer to it by name in flow scope, or use the form object accessor: new FormObjectAccessor(requestContext).getFormObject() .


    • #3
      What I am trying to do is to display an inline form to my users that is prepoulated with values.
      The trick is, the form is only displayed when my jsp page recieves an "update" parameter otherwise just the values (no form, read only) is shown. I got this working without using the form object, I directly access the parameters within my action. Also I do a redirect tthat includes an update parameter (action="update"). (The redirect also helps with browser refreshing problems, since the previous command stored in the last request are gone.)

      Now, I want to usie a backing form object and this is where I am running into problems.

      After a redirect, Jsp page gives an error saying no "categoryForm" is stored in the request" etc. No big suprise since I did a redirect after I setup the form.
      Although the form object is stored in flow scope, that does not mean it is available for your view page. Right?


      • #4
        Stuff in flow scope gets exported to views just like stuff in request scope. Are you sure you're going through the flow again on your redirect? Meaning, are you sure the view state is entering? If that is happening, stuff in flow scope will be correctly exported.

        I suggested some debugging: debug printout out flow scope. What is in there? Turn on debug logging for the webflow package and make sure your view state is being entered.