2 Replies Latest reply on Nov 17, 2010 6:40 AM by omid pourhadi

    navigation doesn't work

    omid pourhadi Apprentice

      Hi,
      i have a simple navigation rule that comes from a method in statefull bean as below



      investor.page.xml



      <?xml version="1.0" encoding="UTF-8"?>
      <page login-required="true" view-id="/investor.xhtml">
      
           <navigation from-action="#{investorAction.registerInvestor}">
            <rule>
               <end-conversation/>
               <redirect view-id="/movieList.xhtml"/>
            </rule>
         </navigation>
      </page>
      



      after i sumbmit the form, the same page redisplay and never redirect




      am i missing something ?

        • 1. Re: navigation doesn't work
          Alexandr Areshchanka Newbie

          Check your server log if any JSF conversion errors happen, if so then action is never invoked and navigation not executed.


          Try to add


          <h:messages>



          to the page and see wats happening.


          Does your statefull bean has @Name annotation?


          Paste more code please.

          • 2. Re: navigation doesn't work
            omid pourhadi Apprentice

            Hi Alexandr,
            i face something weird, when i use this code in pages.xml redirection works fine but in investor.page.xml  code that i mentioned above doesn't work


            pages.xml


            <page view-id="*">
                      <action execute="#{identity.logout()}"
                           if="#{identity.loggedIn and empty identity.credentials.username}" />
                      <navigation from-action="#{identity.logout}">
                           <rule if-outcome="home">
                                <end-conversation />
                                <redirect view-id="/home.xhtml" />
                           </rule>
                      </navigation>
                      <navigation from-action="#{investorAction.registerInvestor}">
                           <end-conversation/>
                           <redirect view-id="/movieList.xhtml"></redirect>
                      </navigation>
                 </page>


            investorActionBean.java



             @End
                public String registerInvestor()
                {    
                     entityManager.persist(investor);
                     entityManager.flush();
                     log.info("Investor Registered Successfully And end conversation");
                     facesMessages.add("\u0633\u0631\u0645\u0627\u064a\u0647 \u06af\u0630\u0627\u0631 \u062b\u0628\u062a \u0634\u062f");//sarmayegozar sabt shod
                     return "registered";
                }



            PS : investor registered succefully and i've got facesmessage but page does not redirect