Page 1 of 5 123 ... LastLast
Results 1 to 10 of 47

Thread: Feedback requested: Redirect support in SWF

  1. #1
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default Feedback requested: Redirect support in SWF

    We have extended/refined the support for redirects in Spring Web Flow; feedback on these refinements are much appreciated.

    1.0 introduced 3 redirect types: "conversation redirect", "flow redirect", and "external redirect".

    A conversation redirect allows redirect to the *current* (most recent) view-state of a conversation, at a single conversation URL, while the conversation remains active.

    A flow redirect requests that a entirely new execution of another flow be launched--used to support flow chaining and restart use cases.

    A external redirect redirects to an arbitrary external URL, with support for sending a flow execution key through the redirect.

    1.0 RC1 introduces a 4th type, called a "flow execution redirect". This supports redirecting to *any* previously traversed view-state of a flow execution at a unique "flow execution URL", to support post->redirect->get semantics with full support for back, forward, and refresh buttons while the conversation remains active.

    In addition, the semantics of "conversation redirect" and "flow execution redirect" are a bit different now--previously application view selections made by view states were cached through the redirect; now they're reconstituted via a new FlowExecution "refresh" operation on each redirect request. Note this causes any data in request scope of the request preceding the redirect to be lost (while data in flow scope is preserved of course).

    "itemlist" and "numberguess" samples demonstrate the "conversation redirect" (notice how back doesn't make any sense as the URL is stable throughout the flow, and it is best suited for a "SimpleFlowExecutionRepository").

    "sellitem" demonstrates the "flowExecutionRedirect". Notice how the URL changes on each submit and back/forward/refresh are fully supported. Also note how this is is suited for a "ContinuationFlowExecutionRepository" and does not make sense with client-side storage.

    Notice how post->redirect->get semantics can be configured globally for all flows (see FlowExecutor.redirectOnPause property) or on a per flow basis (see view-state redirect prefixes in "view" attribute DTD). Of course, redirection is optional, and samples like Phonebook don't do any redirects, relying on continuations + page caching to get stable navigation button behavior.

    Thoughts? We should release 1.0 RC1 once we are confident these remaining redirect challenges are right.

    Keith
    Last edited by Keith Donald; Apr 29th, 2006 at 07:23 PM.
    Keith Donald
    Core Spring Development Team

  2. #2
    Join Date
    Oct 2004
    Location
    Austin, TX, USA
    Posts
    60

    Default

    Hey, Keith,

    Just a question. In the description of sellitem, you mention that the "URL changes on each submit". Perhaps I'm using the wrong version of SWF (I'm on 1.0 EA) but I'm not seeing this. The URL remains consistently http://localhost:8080/swf-sellitem/p...lowId=sellitem.

    Thanks,

    Rob

  3. #3
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Yes, this is new in 1.0 RC1. Try out a 4/30 or > nightly build:
    http://static.springframework.org/do...pring-webflow/
    Keith Donald
    Core Spring Development Team

  4. #4

    Default

    Sounds excellent Keith and I look forward to trying it out asap.

  5. #5
    Join Date
    Oct 2004
    Location
    Austin, TX, USA
    Posts
    60

    Default

    Hi, Keith,

    I was trying to run through the sellitem example but am encountering this exception when I try to start the flow (using Jetty6.0.0beta14):
    Code:
    2006-05-02 10:01:07,521 DEBUG [org.springframework.webflow.executor.support.FlowRequestHandler] - <Request initiated by [ServletExternalContext@290e1513 requestParameterMap = map['_flowId' -> 'sellitem']]>
    :WARN:  EXCEPTION
    org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 0
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
            at org.springframework.webflow.ParameterMap.get(ParameterMap.java:144)
            at org.springframework.webflow.ParameterMap.get(ParameterMap.java:128)
            at org.springframework.webflow.executor.support.FlowExecutorArgumentExtractor.extractFlowExecutionKey(FlowExecutorArgumentExtractor.java:267)
            at org.springframework.webflow.executor.support.FlowRequestHandler.handleFlowRequest(FlowRequestHandler.java:100)
            at org.springframework.webflow.executor.mvc.FlowController.handleRequestInternal(FlowController.java:198)
            at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
            at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
            at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:796)
            at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:727)
            at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
            at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
            at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:423)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:350)
            at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:221)
            at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:539)
            at org.mortbay.jetty.Server.handle(Server.java:341)
            at org.mortbay.jetty.Server.handle(Server.java:311)
            at org.mortbay.jetty.HttpConnection.doHandler(HttpConnection.java:355)
            at org.mortbay.jetty.HttpConnection.access$1500(HttpConnection.java:38)
            at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:598)
            at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:487)
            at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:196)
            at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:293)
            at org.mortbay.jetty.nio.SelectChannelConnector$HttpEndPoint.run(SelectChannelConnector.java:710)
            at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:412)
    :WARN:  Nested in org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.ArrayIndexOutOfBoundsException: 0:
    java.lang.ArrayIndexOutOfBoundsException: 0
            at org.springframework.webflow.ParameterMap.get(ParameterMap.java:144)
            at org.springframework.webflow.ParameterMap.get(ParameterMap.java:128)
            at org.springframework.webflow.executor.support.FlowExecutorArgumentExtractor.extractFlowExecutionKey(FlowExecutorArgumentExtractor.java:267)
            at org.springframework.webflow.executor.support.FlowRequestHandler.handleFlowRequest(FlowRequestHandler.java:100)
            at org.springframework.webflow.executor.mvc.FlowController.handleRequestInternal(FlowController.java:198)
            at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
            at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
            at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:796)
            at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:727)
            at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
            at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
            at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:423)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:350)
            at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:221)
            at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:539)
            at org.mortbay.jetty.Server.handle(Server.java:341)
            at org.mortbay.jetty.Server.handle(Server.java:311)
            at org.mortbay.jetty.HttpConnection.doHandler(HttpConnection.java:355)
            at org.mortbay.jetty.HttpConnection.access$1500(HttpConnection.java:38)
            at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:598)
            at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:487)
            at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:196)
            at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:293)
            at org.mortbay.jetty.nio.SelectChannelConnector$HttpEndPoint.run(SelectChannelConnector.java:710)
            at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:412)
    :WARN:  /swf-sellitem/pos.htm:
    java.lang.ArrayIndexOutOfBoundsException: 0
            at org.springframework.webflow.ParameterMap.get(ParameterMap.java:144)
            at org.springframework.webflow.ParameterMap.get(ParameterMap.java:128)
            at org.springframework.webflow.executor.support.FlowExecutorArgumentExtractor.extractFlowExecutionKey(FlowExecutorArgumentExtractor.java:267)
            at org.springframework.webflow.executor.support.FlowRequestHandler.handleFlowRequest(FlowRequestHandler.java:100)
            at org.springframework.webflow.executor.mvc.FlowController.handleRequestInternal(FlowController.java:198)
            at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
            at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:45)
            at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:796)
            at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:727)
            at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396)
            at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
            at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:423)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:350)
            at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:221)
            at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:539)
            at org.mortbay.jetty.Server.handle(Server.java:341)
            at org.mortbay.jetty.Server.handle(Server.java:311)
            at org.mortbay.jetty.HttpConnection.doHandler(HttpConnection.java:355)
            at org.mortbay.jetty.HttpConnection.access$1500(HttpConnection.java:38)
            at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:598)
            at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:487)
            at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:196)
            at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:293)
            at org.mortbay.jetty.nio.SelectChannelConnector$HttpEndPoint.run(SelectChannelConnector.java:710)
            at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:412)
    ...
    I'll try running under Tomcat next, but just thought you'd like to know.

    Rob

  6. #6
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    What version?
    Keith Donald
    Core Spring Development Team

  7. #7
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    What version of SWF?
    Keith Donald
    Core Spring Development Team

  8. #8
    Join Date
    Oct 2004
    Location
    Austin, TX, USA
    Posts
    60

    Default

    Last night's build.

  9. #9
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    That is a bug. Will fix promptly and add a test case.

    Keith
    Keith Donald
    Core Spring Development Team

  10. #10
    Join Date
    Aug 2004
    Location
    Melbourne, FL
    Posts
    2,794

    Default

    Fixed. Good catch; I'm not sure why this showed up in Jetty just now, as the bug has been there. It's resolved now.
    Keith Donald
    Core Spring Development Team

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •