navigation question
giunad Jun 11, 2009 10:16 AMHi everybody.
I'm testing few basic navagation functions.
what I did is:
-created a new seam project
-created a new dir test in web module
-created in test dir 2 silly page: home1 and home2
-created in test dir 2 page flow to check if user is logged as admin.
as regard this last point I tried:
1) in home1.page.xml
<?xml version="1.0" encoding="UTF-8"?> <page [cut]> <navigation evaluate="#{identity.hasRole('admin')}"> <rule if-outcome="false"> <redirect view-id="/error.xhtml" /> </rule> </navigation> </page>
and in home2.page.xml
<?xml version="1.0" encoding="UTF-8"?> <page [cut]> <navigation> <rule if="#{identity.hasRole('admin')}"> <redirect view-id="/error.xhtml" /> </rule> </navigation> </page>
but nothing appends.
so I tried:
2) in pages.xml
<?xml version="1.0" encoding="UTF-8"?> <pages [cut2]> <page view-id="*"> <navigation> <rule if-outcome="home"> <redirect view-id="/home.xhtml"/> </rule> </navigation> </page> <page view-id="/home5.xhtml"> <navigation evaluate="#{identity.hasRole('admin')}"> <rule if-outcome="false"> <redirect view-id="/error.xhtml" /> </rule> </navigation> </page> <page view-id="/home6.xhtml"> <navigation> <rule if="#{identity.hasRole('admin')}"> <redirect view-id="/error.xhtml" /> </rule> </navigation> </page>
but nothing again.
I'm sure is something missing in my code as I added few things to a project created by seam.
but what is missing I cannot figure out witout a log/debug.
any help?
thank you very much!
ps
cut: xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd" no-conversation-view-id="/noconv.xhtml"
cut1: xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd" no-conversation-view-id="/home.xhtml" login-view-id="/login.xhtml"
all as wizard wrote.
my conf: jboss seam 2.1.1, jboss as 4.2.3.GA