9 Replies Latest reply on May 2, 2007 10:51 AM by pmuir

    Conversation not being propogated between redirect

    youngm

      My conversations aren't being continued between redirects.

      If my faces-context is handling the navigation and redirect which I thought was ok.

      The crux of the problem appears to be RedirectFilter needs an active EVENT context. However, the context is being closed in the SeamPhaseListener after Response Complete so there is no EVENT context for RedirectFilter to get the current conversationId from.

      I wonder if this may be a difference between Myfaces and JSF-RI? Maybe Myfaces didn't set FacesContext.responseComplete() on redirect where the RI does?

      Any other ideas?

      JSF-RI 1.2
      Facelets 1.1.12
      Tomcat

      Mike

        • 1. Re: Conversation not being propogated between redirect
          pmuir

          Mike, what version of Seam are you running? CVS head is running on the RI now, and I've not *seen* any problems propagating conversations across redirects with it.

          • 2. Re: Conversation not being propogated between redirect
            youngm

            I'm getting the problem using a head build from about 2 weeks ago. I tried a new build as of right now but there is a problem with a JSP 2.1 dependency. JBSEAM-1265.

            If you're not having any trouble I'll try again when the when JBSEAM-1265 is fixed.

            Mike

            • 3. Re: Conversation not being propogated between redirect
              youngm

              Ok, so I got a build working today and I'm still experiencing the problem. Maybe I'm just using seam wrong but here are some more details on what I'm doing.

              I have a list detail page. I'm storing the current page the user is on in a conversation bean.

              I begin a conversation in the list page. (pet-search)

              I change the current page.

              I select a pet to modify and begin a nested conversation. (pet-details)

              I modify the pet and select "save" This invokes an action that ends my nested conversation and redirects back to pet-details using the faces-config navigation snippet here:

              <navigation-case>
              <from-outcome>pet-search</from-outcome>
              <to-view-id>/pet-search.xhtml</to-view-id>

              </navigation-case>

              When I get back to the list page my conversation variable storing the current page has been forgotten.

              Does it appear I'm doing anything wrong?

              The redirectFilter is installed by default right?

              Mike

              • 4. Re: Conversation not being propogated between redirect
                youngm

                For some reason this tool blanked out my redirect tag in the navigation-case. Believe me it is there. :)

                • 5. Re: Conversation not being propogated between redirect
                  youngm

                  Figured it out. The Ajax4jsf filter was executing after the seam filter. I had my filters configured like so:

                   <filter-mapping>
                   <filter-name>ajax4jsf</filter-name>
                   <servlet-name>Faces Servlet</servlet-name>
                   <dispatcher>REQUEST</dispatcher>
                   <dispatcher>FORWARD</dispatcher>
                   <dispatcher>INCLUDE</dispatcher>
                   </filter-mapping>
                  
                   <filter-mapping>
                   <filter-name>Seam Filter</filter-name>
                   <url-pattern>/*</url-pattern>
                   </filter-mapping>
                  


                  Even though ajax4jsf was on top it was being executed after Seam because I was using servlet-name instead of user-pattern.

                  So to fix it you can either change them both to use servlet-name or url-pattern and then they will execute in the correct order.

                  Mike

                  • 6. Re: Conversation not being propogated between redirect
                    christian.bauer

                    I ran into this as well and found quite a few other postings about a broken filter configuration. We should move away from web.xml, it's just pain. Maybe we can make the a4jsf filter a Seam AbstractFilter and run it first if the component is on the classpath? Then we wouldn't need a4jsf configuration in web.xml at all.

                    • 7. Re: Conversation not being propogated between redirect
                      pmuir

                      Can you file a JIRA issue Christian and assign it to me?

                      • 8. Re: Conversation not being propogated between redirect
                        youngm

                        Oops. I didn't notice you specifically asked Christian to file the issue until after I created it. :) Anyway here you go:

                        http://jira.jboss.org/jira/browse/JBSEAM-1281

                        • 9. Re: Conversation not being propogated between redirect
                          pmuir

                          Hehe :) I've closed one of them as duplicate