8 Replies Latest reply on Oct 18, 2006 6:52 PM by jazir1979

    @Factory on a Conversational SFSB

    jazir1979


      Hi all,

      I'm having some problems using @Factory/@DataModel/@DataModelSelection on an SFSB with conversation scope.

      I've done a bit of forum-searching and came across the following comment from Gavin:

      "2) factory methods are called every time a variable is referenced - you can't really 'clear' it "

      I have some questions about this:
      1) If the component that is instantiated by the factory already exists, why should Seam call the factory method again?
      2) In my case, Seam is instantiating a NEW instance of my SFSB to call the factory method, even though one already exists in conversation scope. Is this correct?

      I'm currently looking at a workaround by using a page action instead of @Factory, but I just want to clarify this behaviour.

      thanks,
      Daniel.

        • 1. Re: @Factory on a Conversational SFSB
          jazir1979


          My problem for Question 2) seems to be related to my conversation not propagating when using h:commandLink. I thought it should.. but I will investigate further.

          • 2. Re: @Factory on a Conversational SFSB
            jazir1979

            Removing the in my navigation rule fixes my problem.

            I have double-checked that I *do* have the SeamRedirectFilter installed in my web.xml, so is there any other reason my conversation may not be propagating?

            Is there a way via the JBoss JMX console to ensure that my filter mapping for the SeamRedirectFilter is being picked up?

            • 3. Re: @Factory on a Conversational SFSB
              jazir1979

              above should say removing the redirect.. my bad for not previewing.

              • 4. Re: @Factory on a Conversational SFSB
                gavin.king

                1) it does not, you misunderstood what I was trying to say there
                2) No, not if you are in the same conversation

                • 5. Re: @Factory on a Conversational SFSB
                  gavin.king

                   

                  "jazir1979" wrote:
                  Removing the <redirect/> in my navigation rule fixes my problem.

                  I have double-checked that I *do* have the SeamRedirectFilter installed in my web.xml, so is there any other reason my conversation may not be propagating?

                  Is there a way via the JBoss JMX console to ensure that my filter mapping for the SeamRedirectFilter is being picked up?


                  Do you have a ?conversationId=XX in your URL?

                  • 6. Re: @Factory on a Conversational SFSB
                    gavin.king

                     


                    My problem for Question 2) seems to be related to my conversation not propagating when using h:commandLink. I thought it should.. but I will investigate further.


                    h:commandLink always propagates the conversation context (assuming the conversation is longrunning

                    • 7. Re: @Factory on a Conversational SFSB
                      jazir1979

                       

                      "gavin.king@jboss.com" wrote:
                      "jazir1979" wrote:
                      Removing the <redirect/> in my navigation rule fixes my problem.

                      I have double-checked that I *do* have the SeamRedirectFilter installed in my web.xml, so is there any other reason my conversation may not be propagating?

                      Is there a way via the JBoss JMX console to ensure that my filter mapping for the SeamRedirectFilter is being picked up?


                      Do you have a ?conversationId=XX in your URL?


                      No, it doesn't seem to be. I can see in the SeamRedirectFilter code where this gets done, but there's no trace logging so I can't be sure it's getting called. I might run against the source and either debug or add some logging.

                      Any ideas or hints?

                      cheers,
                      Dan.


                      • 8. Re: @Factory on a Conversational SFSB
                        jazir1979

                        I got it!

                        My mapping for the Ajax4Jsf filter was in the way.

                        Sorry to waste your time on that.

                        Daniel.