2 Replies Latest reply on Jul 15, 2009 3:23 AM by sej67

    pages.xml redirect

    sej67
      In the pages.xml file I have:

      <page view-id="/memberAdd.xhtml" login-required="true" >
        <action execute="#{memberAddAction.initialize()}"/>
        <navigation>
          <rule if-outcome="success">
            <redirect view-id="/search.xhtml" >
              <action execute="#{searchAction.searchIt()}"/>
            </redirect>
          </rule>
        </navigation>
      </page>

      I verified with a breakpoint that the java is returning "success", and it displays the search.xhtml page.  However, the search results only show the original members in the search results section; it does not show the member that the user just added.  I verified with a breakpoint that it is not going through the searchIt() method.

      So any ideas why it does not go through the method?  Is this some kind of caching issue?
        • 1. Re: pages.xml redirect
          asookazian

          The <action> element is disallowed as per the xsd/dtd for pages.xml to be nested in a <redirect> element.


          from Eclipse:


          cvc-complex-type.2.4.a: Invalid content was found starting with element 'action'. One of '{"http://
           jboss.com/products/seam/pages":message, "http://jboss.com/products/seam/pages":param}' is 
           expected.



          I tried to verify here: http://jboss.com/products/seam/pages-2.0.xsd but was unsuccessful...


          You will need to re-write your pages.xml.


          something like this (using a boolean context variable set in your JavaBean/SFSB):


          <page view-id="/memberAdd.xhtml" login-required="true" >
                 <action execute="#{memberAddAction.initialize()}"/>
                 <navigation>
                   <rule if-outcome="success">
                     <redirect view-id="/search.xhtml"/>           
                   </rule>
                    <action execute="#{searchAction.searchIt()}" if="#{doSearch}"/>      
                 </navigation>
               </page>

          • 2. Re: pages.xml redirect
            sej67

            Thank you.  I will try that.