You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
| Online: | 13 Members of 9199 |
| Forum: Seam Users |
19. Mar 2010, 14:14 America/New_York | Link |
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!
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.
The human knowledge belongs to the world
Thanks Adrian,
When you said , 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 is there a way to change this default message?
Thanks,