How to redirect(Bidirectional way) using pages.xml by EL methods in JSF and Seam project?

183 Views Asked by At

I'm facing a problem while rewriting the pattern in pages.xml dynamically.

I have a mainmenu and submenus on the webpage, I have a scenario like when user give's www.website.com/mainmenu/submenu1 , EL method should execute and rewrite that particular page dynamically.Because all the menus and submenu's will come from backend. Also it should work from home page when user select submenu item. I mean, it should work in both the ways(bidirectional). Critical part is, how to execute and get the /mainmenu/submenu names from backend when user enter's url in address bar. This must use pages.xml only by using seam framework.

Thanks in advance!! Please let me know if my explanation is not clear.

1

There are 1 best solutions below

0
DaveB On

Try reading the seam docs....

<page view-id="/yourPage.xhtml">
        <rewrite pattern="/{mainmenu}/{submenu}"/> 
        <param name="mainMenu" required="true" value="#{yourBean.mainMenu}"/>
        <param name="subMenu" required="false" value="#{yourBean.submenu}"/>
        <action execute="#{yourBean.processPage}" on-postback="false"/>
</page>

SEAM Documentation