Announcement Announcement Module
Collapse
No announcement yet.
multiple webflow context issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • multiple webflow context issue

    I am using webflow with JSF and configured two DispatcherServlet in web,xml. servlet1 listens /spring/* and servlet2 listens to /spring2/*. Each servlet has its own spring context including flow-registry etc. In faces-config, I used a customized variable resolver that extends SpringBeanFacesELResolver to return appropriate Spring Context based on url pattern. Both flow registry registers a "account" flow. I then invoke the account flow using url http://localhost:8080/spring/account. the url on browser became to http://localhost:8080/spring/account?execution=e2s1. I then type the url http://localhost:8080/spring2/account?execution=e2s1 on another browser tab to invoke account flow from servlet2. I am expecting the flow should start fresh because servlet2 has its own spring context (and flow context?). However, the flow execution state seems to be kept between the two servlets. Indeed, if the input is bound to a spring bean with the same id, it shows different value depending url contains "spring" or "spring2". But if the input is bound to a flow var with same id. it always display the same value.

    My questions is why both servlet share the same flow context even though I configured them to use different Spring Context including flow-registry and flow-executor etc.?


    Best,


    Beta

  • #2
    A tab isn't a fresh browser window (neither is ctrl+n in most cases!). Spring webflow stores it state in the http session, the session is shared between the servlets and a flow with id e2s1 is already registered in the session and the second servlet simply restores the state while invoking its own flow. If you would start in a completly fresh browser (no ctrl+t or ctrl+n) you get the behavior you want (at least that is what I would expect).

    Comment


    • #3
      Your explanation totally make sense. However, SpringContext is stored in the session as well but they have different name so I can use different SpringContext via customized variable resolve based on request url. Of course this only works for EL variables in the JSF page. As you mentioned, "the second servlet simply restores the state..". Obviously, both spring/account and spring2/account save/restore from the same session attribute. Wondering if we can have two servlets save/restore flow information from different session attributes just like how DispatcherServlet stored SpringConext.


      Best,

      beta

      Comment

      Working...
      X