Announcement Announcement Module
Collapse
No announcement yet.
Redirects and Spring Web Flow Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Redirects and Spring Web Flow

    I have a flow where the end state may not be a traditional view but a dynamically determined (i.e. provided by user) url to redirect to. What would be the best way to handle that using the web flow?

    Thanks
    -Scott

  • #2
    I have this same need :-)

    Right now you can "redirect:toAView" easily but it's not easily dynamicall calculatable. We'll likely do something about this very soon -- if not PR3 definitely PR4 (or early access PR4.)

    Comment


    • #3
      Thanks for the response...in the meantime do you recommend just doing response.sendRedirect ?

      Also is there a roadmap somewhere for PR3 and PR4?

      Thanks!
      -Scott

      Comment


      • #4
        Not sure if I'd recommend that - as you're basically short circuiting the flow in that case. A option in the mean time is to use a custom View or End state--but that's notrivial from the xml flow builder, only from a java-based flow builder.

        Comment


        • #5
          Can you help us out here and create a JIRA issue for this so it doesn't get lost?

          Comment


          • #6
            I created a JIRA issue:

            http://opensource.atlassian.com/proj...browse/SPR-931

            Comment


            • #7
              I temporarily cheated to get this working:

              I set the URL in the Request attributes and use a static forward to go to a controller who's purpose is to just generate a RedirectView from the provided URL. Probably not an optimal solution but for now it continues to let me work :-D

              Comment


              • #8
                I've introduced a "ViewDescriptorCreator" strategy which gives you full control over the view name to be returned when a view state or end state is entered.

                Now we're going to add new support into the XML dtd for common descriptor creator strategies. Obviously, a static view name strategy already exists ("SimpleViewDescriptorCreator").

                So, something like:

                Code:
                   <view-state id="myViewState" view="myStaticView"/>
                   <view-state id="myViewState" view-creator="samples.MyViewDescriptorCreator"/>
                   <view-state id="myViewState" redirect="myRedirectView?foo=$&#123;flowScope.foo&#125;"/>
                The latter would need to be recognized as an expression to be resolved by the creator implementation.

                Comment


                • #9
                  is this in CVS? I'll try it out later if it is.

                  Thanks
                  -Scott

                  Comment


                  • #10
                    As you probably already noticed basic support for this is now available in PR3.

                    Erwin

                    Comment


                    • #11
                      yep thanks...I've been using it since this morning...even asked a few questions already

                      Comment


                      • #12
                        Originally posted by Keith Donald
                        I've introduced a "ViewDescriptorCreator" strategy which gives you full control over the view name to be returned when a view state or end state is entered.

                        Now we're going to add new support into the XML dtd for common descriptor creator strategies. Obviously, a static view name strategy already exists ("SimpleViewDescriptorCreator").

                        So, something like:

                        Code:
                           <view-state id="myViewState" view="myStaticView"/>
                           <view-state id="myViewState" view-creator="samples.MyViewDescriptorCreator"/>
                           <view-state id="myViewState" redirect="myRedirectView?foo=${flowScope.foo}"/>
                        The latter would need to be recognized as an expression to be resolved by the creator implementation.

                        Keith, I am looking at the webflow xm DTD for PR5 and don't see view-creator or redirect attributes defined in the <view-state> xml node. Is it something that will only be available with RC1 or am I missing something?

                        Comment

                        Working...
                        X