2 Replies Latest reply on Dec 3, 2008 3:16 PM by oyesiji77

    Problem using Conversations

    oyesiji77

      I have created a seam test project and i am kind of confused by this concept of conversations, I thought conversation works like this


      if i have three pages(Page1,Page2 and Page3) in a conversation


      say Page1--->Page2--->Page3-->Page 4


      and i start the conversation in Page1 and end the Conversation in Page3


      And Java Bean class that I injected and used during Page 1 and Page2 is automatically discarded from session after the conversation ended


      Lets say I have a bean

      @scope(scopeType.CONVERSATION)
      class testBean(){

      public void setName(String name){

      }






      }


      in Page1 i injected it and set the value for name, I expect to be able to retrieve name in Page2 and Page3 but not in Page4 but surprisingly i am also able to retrieve it in Page4



      this is the content of my pages.xml

      <page view-id="/page1.xhtml">
          <begin-conversation/>
              <navigation>
                  <rule if-outcome="home">
                      <redirect view-id="/page2.xhtml"/>
                  </rule>
              </navigation>
          </page>
         
         
          <page view-id="/page3.xhtml">
              <end-conversation/>
                  <navigation>
                      <rule if-outcome="home">
                          <redirect view-id="/page4.xhtml"/>
                      </rule>
                  </navigation>
              </page>



        • 1. Re: Problem using Conversations
          stephen
          I am not fully understanding your code, so this is just an educated guess:
          Change
             <end-conversation/>
          to
             <end-conversation before-redirect="true"/>
          • 2. Re: Problem using Conversations
            oyesiji77

            I tried that but it did not work.

            <end-conversation before-redirect="true">


            <page view-id="/page1.xhtml">  
            <begin-conversation/>  
            <navigation>  
            <rule if-outcome="home">  
            <redirect view-id="/page2.xhtml"/>  
            </rule>  
            </navigation>  
            </page> 
            
            <page view-id="/page3.xhtml">  
            <end-conversation before-redirect="true">  
            <navigation>  
            <rule if-outcome="home">  
            <redirect view-id="/page4.xhtml"/>  
            </rule>  
            </navigation>  
            </page>





            I am still able to retrieve the bean outside the conversation even though it has Scope type defines as CONVERSATION