11 Replies Latest reply on Nov 2, 2007 7:44 AM by pmuir

    Conversation scope questions

    johnfish

      Hi guys. I have just found out about the SEAM framework and I was amazed to learn that it implements a 'conversation' scope. I take that the conversation scope essentially defines the lifetime of objects to be equal to the lifetime of the browser tab (or window for non-tabbed browsing). Is this correct?

      If yes, whats the results of the following scenarios:

      Assuming we have a browser window open with tab A pointing to url U
      1) Open a new tab B and go to url R. Are session objects defined in U shared with R?
      2) Open a link R from A as a new tab. Are session objects defined in U shared with R?

      Thanks

        • 1. Re: Conversation scope questions
          pmuir

          No. The conversation lifespan is limited to the session length, and can timeout before that if there is no user activity for a user-defined period of time (default 10 mins).

          The session is unaffected and behaves as though you were using servlets.

          • 2. Re: Conversation scope questions
            johnfish

            Yeah but then whats the difference between session scope and conversation scope?

            • 3. Re: Conversation scope questions
              pmuir

              You can have multiple conversations per session (maximum of one active/foreground conversation per tab, unlimited inactive conversations).

              • 4. Re: Conversation scope questions
                johnfish

                Ok. Thats what I meant before. My question is how does the framework know about browser tabs? Since it lies on the server it only sees incoming http requests. Thx

                • 5. Re: Conversation scope questions
                  pmuir

                  Ok. It uses a request parameter (get or post dependent on whether its a link or a form).

                  • 6. Re: Conversation scope questions
                    johnfish

                    But how is this request parameter used to distinguish between tabs?

                    • 7. Re: Conversation scope questions
                      pmuir

                      The conversation is tied to the request parameter, not the tab.

                      • 8. Re: Conversation scope questions
                        johnfish

                        I dont understand. The framework must have a way to distinguish between browser tabs. You mentioned that a request param is set. Where is this set? What does it contain? And how is this useful to distinguish between browser tabs? What happens in the session level if a different conversation is opened?

                        • 9. Re: Conversation scope questions
                          pmuir

                           

                          "JohnFish" wrote:
                          I dont understand. The framework must have a way to distinguish between browser tabs.


                          Why? The only way that conversations can move between tabs is by right clicking on a link which propagates the conversation via GET and choosing open in a new tab.

                          You mentioned that a request param is set. Where is this set?


                          It's added to forms (well, to the page context) and to s:link/s:button automatically. You can manually add it as well.

                          What does it contain?


                          It contains the conversation identifier.

                          And how is this useful to distinguish between browser tabs?


                          See above



                          • 10. Re: Conversation scope questions
                            johnfish

                             

                            "pete.muir@jboss.org" wrote:
                            "JohnFish" wrote:
                            I dont understand. The framework must have a way to distinguish between browser tabs.


                            Why? The only way that conversations can move between tabs is by right clicking on a link which propagates the conversation via GET and choosing open in a new tab.


                            Ok. That what messed up my thinking. I assumed conversations cannot move between tabs. I can see now how this is done. Cheers

                            "pete.muir@jboss.org" wrote:


                            What happens in the session level if a different conversation is opened?


                            Another ConversationEntry is added to the ConversationEntry map.

                            You're really starting to get deep into how the framework is implemented here - I suggest getting a copy of the source code and checking this out for yourself.


                            I didnt know the source code is available. I ll definitely have a look

                            • 11. Re: Conversation scope questions
                              pmuir

                              Its all in every download (its all LGPL)