3 Replies Latest reply on Jul 14, 2006 12:19 PM by gavin.king

    How to redirect to the start page in a conversation when the

    gfzhang

      Hi,

      Suppose a wizard compose a few pages and these pages are organized in a conversaction.

      In an intermediate page of the wizard and at this place the Http session is timed out. At this time if a user click a button on the page, I want to display the first page of the wizard or display a warning page, then redirect to the first page.

      Does Seam have built-in mechanism to support it?

      I made a sample. I restart JBoss server to simulate the time out (I even removed the tmp and work directory). When the http session is timed out, I found that the page is alway redisplayed when I click any button on an intermediate page. It should diplay the next page as in the normal case, but it does not.

      Thanks.

        • 1. Re: How to redirect to the start page in a conversation when
          gavin.king

          Use @Conversational in the current release, or no-conversation-view-id in CVS.

          • 2. Re: How to redirect to the start page in a conversation when
            gfzhang

            Thanks for your quick reply. But it does not work.

            I add some pages in the numberGuess sample. The followng is the page flow xml file:

            <pageflow-definition name="numberGuess">
            
             <start-page name="displayGuess" view-id="/numberGuess.jsp">
             ....
             <transition name="interval" to="toInterval">
             <action expression="#{numberGuess.show}" />
             </transition>
             </start-page>
            
             <page name="toInterval" view-id="/interval.jsp">
             <redirect/>
             <transition name="back" to="displayGuess"/>
             <transition name="done" to="toDone">
             <action expression="#{numberGuess.show}" />
             </transition>
             </page>
            
             <page name="toDone" view-id="/done.jsp">
             <redirect/>
             <transition name="back" to="displayGuess">
             <action expression="#{numberGuess.show}" />
             </transition>
             <end-conversation />
             </page>
            
            </pageflow-definition>


            In "toInterval" page, I restart JBoss server, then click Done button. I hope this would cause the numberGuess page to be displayed, but not. The toInterval page is redisplayed.

            The following is the show method:
             @Conversational(ifNotBegunOutcome="back")
             public void show()
             {
             System.out.println( "i am called" ) ;
             }
            
            

            even if i use
            @Conversational(ifNotBegunOutcome="/numberGuess.jsp")
            it still won't work.

            What is wrong in my code?

            Thanks.


            • 3. Re: How to redirect to the start page in a conversation when
              gavin.king

              The ifNotBegunOutcome needs to trigger a navigation rule in your faces-config.xml, of course!

              Its not going to trigger a transition in the pageflow, since there is no pageflow, since you just restarted the server!