Fórum

How to forward the user to a new page in JSF?

thumbnail
Michael Poznecki, modificado 15 Anos atrás.

How to forward the user to a new page in JSF?

Expert Postagens: 301 Data de Entrada: 10/12/08 Postagens Recentes
Hello all,
I want to forward the user to a new user page after they click a button on my JSF portlet. I have seen many examples on forwarding the user to a new JSP or even a new XHTML, but I want to push them on to a new User Page which does not really have a page extension. In other words, I want to push them to '/web/guest/home'. Can someone help me with the syntax?

This is what I have tried in my faces-config.xml:


<navigation-rule>
    <from-view-id>publisherForm.xhtml</from-view-id>
     <navigation-case>
        <from-outcome>submit</from-outcome>
        <to-view-id>/web/guest/home</to-view-id>
        <redirect />
   </navigation-case>
 </navigation-rule>




But it does not seem to do anything.

Thanks,
Michael
zzzz8 zzzz8, modificado 14 Anos atrás.

RE: How to forward the user to a new page in JSF?

Junior Member Postagens: 62 Data de Entrada: 11/11/08 Postagens Recentes
Hi Michael,

Did you ever get a solution for this issue? I'm running into the same issue right now.
Oliver Bayer, modificado 14 Anos atrás.

RE: How to forward the user to a new page in JSF?

Liferay Master Postagens: 894 Data de Entrada: 18/02/09 Postagens Recentes
Hi Michael,

afaik you have to define navigation rules in JSF in the faces-config.xml only if you submit a form (=calls an action). Only a hint but wouldn't it be easier to use something like the "<h:outputLink>" tag which generates a simple html link?
Link to the outputLink-tag reference

HTH Oli