4 Replies Latest reply on Dec 25, 2006 8:19 PM by ccurban

    Problem with @End(beforeRedirect=true)

    ccurban

      I have got a facelet-page named

      cc_distribution.xhtml


      And a SFSB with one action method triggered by a commandLink from this page.

       @End(beforeRedirect=true)
       public String updateDistributionList() {
      .
      .
      .
       return "cc_distribution";
       }


      Using the following navigation rule in my faces-config.xml:
       <navigation-rule>
       <navigation-case>
       <from-outcome>cc_distribution</from-outcome>
       <to-view-id>/view/manage/cc_distribution.xhtml</to-view-id>
       <redirect/>
       </navigation-case>
       </navigation-rule>


      I thought the result would be something like that:
      1. I hit the Link.
      2. updateDistributionList() is executed
      3 the conversation is ended before the redirect
      4. redirect to the same page

      Unfortunately the redirect occurs without the conversation ending. Any suggestions?

      Happy Christmas.

        • 1. Re: Problem with @End(beforeRedirect=true)
          ccurban

          I forgot to mention I got a begin/create method in the same SFSB:

          @Create
           @Begin
           public void init() {
          ,
          ,
          ,
           }


          So what I really expected is:
          1. I hit the Link.
          2. updateDistributionList() is executed
          3 the conversation is ended before the redirect
          4. redirect to the same page
          5. init method is called due to @Create and a the temporary conversation is promoted to a long running one.

          But steps 3 and 5 don't occur for me.

          Any help is appreciated.

          • 2. Re: Problem with @End(beforeRedirect=true)


            This looks odd to me:

            <to-view-id>/view/manage/cc_distribution.xhtml</to-view-id>
            


            If you are following the normal seam structure then your view id would simply be "/manage/cc_distribution.xhtml". Do you really have a view directory inside of your WAR? Assuming you don't, I'd expect you to see a redirect failure. Instead you are being redirected back to the same page. That sounds more like a validation error to me. Are you sure updateDistributionList() is even being called?

            • 3. Re: Problem with @End(beforeRedirect=true)
              ccurban

              Actually I have a "view" directory.

              And I actually want to be redirected to the same page, but with ending the old and starting a new long running conversation.

              I thought @End(beforeRedirect=true) would exactly do thatm but as stated before I am just redirected to the same page with the old conversation still active.

              • 4. Re: Problem with @End(beforeRedirect=true)
                ccurban

                Thanks Norman, actually the method has not been called, as I annotated and posted the wrong method.
                Annotating the right method works like a charm.
                Maybe I should stop working over christmas. :)

                /closed.