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?

#23021

Carolina
Member

Thanks for spontaneous reply :)

According to Pretty Faces document for JSF-2.0, I have configured the following things.

1. pom.xml

<dependency>

<groupId>com.ocpsoft</groupId>

<artifactId>prettyfaces-jsf2</artifactId>

<version>3.3.2</version>

</dependency>

2. Added pretty faces filter at top in the web.xml.

3. Created pretty-config.xml in web-inf folder. and i have added URL-Mapping as below

<url-mapping id=”hotelloginNormal”>

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

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

</url-mapping>

‘b2c’ is my context root defined in jboss-web.xml.

login page resides in this package ‘/pages/hotel/hotelLoginNormal.xhtml’

And the navigation rule defied in faces-config.xml on click of login button as follows

<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>

Now I am expecting the URL in browser something like this.

http://localhost:8080/b2c/Login

Instead of ‘ http://localhost:8080/b2c/pages/hotel/hotelLoginNormal.xhtml ‘ (Which is original URL).

But still I am getting original URL in my browser.

May I know what is wrong in my configuration? Or I need to do any code changes for this?

-Vishwa.