Re: Can I use pretty faces URL rewrite in existing JSF-2.0 and Richfaces-3.3.3 app?

Splash Forums PrettyFaces Users Can I use pretty faces URL rewrite in existing JSF-2.0 and Richfaces-3.3.3 app? Re: Can I use pretty faces URL rewrite in existing JSF-2.0 and Richfaces-3.3.3 app?

#23025

Carolina
Member

Hi Christian,

Yes its redirection to original URL instead of showing only “http://localhost:8080/b2c/Login” in browser.

I have not used any security framework, Only I have added navigation rule in faces-config.xml as below.

Please find an attached web.xml as well

<navigation-rule>

<navigation-case>

<from-outcome>hotelloginNormal</from-outcome>

<to-view-id>

/pages/hotel/hotelLoginNormal.xhtml

</to-view-id>

<redirect></redirect>

</navigation-case>

</navigation-rule>

This navigation calls on click of login button which has action attribute on h:commandButton.

Java Bean Class action method:

public String loginClick(){

return “hotelloginNormal”;

}

pretty-config.xml:

<url-mapping id=”hotelloginNormal”>

<pattern value=”/b2c/Login” />

<view-id value=”/pages/hotel/hotelLoginNormal.xhtml” />

</url-mapping>

Only above configuration I have.

XHTML:

<h:commandButton value=”Login” action=”#{loginBean.loginClick}”/>