2 Replies Latest reply on Mar 23, 2010 12:59 PM by shin0135

    way to find out where a page is redireced from in pages.xml

    shin0135

      Hi,


      Is there a easy way to find out where a page is redirected from in pages.xml.
      I have 2 pages such as test1.xhtml and test2.xhtml. Ideally, the test2.xhtml should only be accessible through test1.xhtml. So, if users try to access the test2.xhtml, I would like to redirect them to test1.xhtml.


      Thanks for your help in advance!

        • 1. Re: way to find out where a page is redireced from in pages.xml
          amitev

          Hello! Create a navigation rule in pages.xml from test1 to test2. In this navigation outject something (in the conversation scope to servive the redirect). You can use the <out> tag to outject.


          For the next page create an action that will be executed on each request checking if there is the thing outjected by the navigation rule. If it isn't there the user typed the page url manually or came from somewhere else.


          • 2. Re: way to find out where a page is redireced from in pages.xml
            shin0135

            Thanks Adrian,


            When you said out tag, you meant the @Out annotation, right?


            Like you said, I ended up writing a navigation rule in the pages.xml




            <page view-id="/test2.xhtml">
             <navigation>
              <rule if="#{oujectedVariable == null}">
               <redirect view-id="/test1.xhtml" />
              </rule>
             </navigation>
            </page>
            



            Another thing I tried was to use the conversation-required and no-conversation-view-id attribute of page, but I could not change the default message ...conversation timed out.. is there a way to change this default message?


            Thanks,