3 Replies Latest reply on May 5, 2008 6:43 PM by lcurros

    Rule redirect to captured view

      Hello again!
      I'm working with jboss seam 2.0.1 and Jboss 4.2.2.


      How can I redirect to capturedView inside a rule definition in pages.xml? Something like this:




           <page view-id="/prelogin.xhtml" action="#{bean.action()}">
                <navigation>
                <rule if="#{bean.condition}">          
                             <redirectToCapturedView/>
                   </rule>             
             </navigation>
            </page> 




      Thanks in advance!

        • 1. Re: Rule redirect to captured view
          shane.bryzak

          You could try this:


            <page view-id="/prelogin.xhtml" action="#{bean.action()}">
              <navigation>
                <rule if="#{bean.condition}">          
                  <redirect view-id="#{redirect.viewId}"/>
                </rule>             
              </navigation>
            </page> 



          • 2. Re: Rule redirect to captured view

            Thanks Shane!


            In most of cases this solution works perfectly. My problem is that I want to maintain the initial parameters (of captured view), and using this


            <redirect view-id="#{redirect.viewId}"/>



            I loose my parameters.

            • 3. Re: Rule redirect to captured view

              I solve the problem adding (inside action() method) the next line:


              Redirect.instance().returnToCapturedView();



              Is this the only way to solve it?or can I write something in pages.xml to redirect to captured view?