4

Primefaces doesn't work when primefaces and pretty face use together. I add flowing jar:

prettyfaces-jsf2-3.3.3.jar
primefaces-4.0-20130605.174828-3.jar

My web.xml code:

<filter>
    <filter-name>Pretty Filter</filter-name>
    <filter-class>com.ocpsoft.pretty.PrettyFilter</filter-class>
</filter>

<filter-mapping> 
    <filter-name>Pretty Filter</filter-name> 
    <url-pattern>/*</url-pattern> 
    <dispatcher>FORWARD</dispatcher> 
    <dispatcher>REQUEST</dispatcher> 
    <dispatcher>ERROR</dispatcher>
</filter-mapping> 

My pretty-config.xml code:

<rewrite match="^[^(/primefaces_resource/)|^(javascript)]" trailingSlash="append"  toCase="lowercase" redirect="301"/>
<url-mapping id="home"> 
    <pattern value="/" /> 
    <view-id value="/" />
</url-mapping> 

This image is whithou prittyface( jar and configure): enter image description here

when I add pretty face jar .then flowing view: enter image description here

I want to change the url.

example:

  (http://localhost:8084/AntSchoolMS/faces/index.xhtml)

I want it to be changed as

(http://localhost:8084/AntSchoolMS/)

please help me .

Sms Kopex
  • 223
  • 2
  • 8
  • 2
    I'm sorry, but what exactly are we to deduce from the two pictures? What is the result you're expecting? – kolossus Jul 26 '13 at 12:54

3 Answers3

2

I use primefaces 3.5 with pretty faces 3.3.3 and works ok. The configuration in your web.xml seems to be ok. Make sure you place pretty-config.xml also in WEB-INF. About the pretty-config you posted: it doesn't make any sense to have a url-mapping where the pattern and the view-id are the same, so remove it. Also I don't have that rewrite rule, I have several mappings like the folowing:

<url-mapping id="login">
    <pattern value="/login/">
    <view-id value="/login.jsf" />
</url-mapping>

Did you try removing that rewrite rule to see what happens?

damian
  • 4,024
  • 5
  • 35
  • 53
1

I've been using these two for some time and they are working as expected. My project used the 3.5 version of primefaces and PrettyFaces 3.3.3.

In my web.xml I did not need to register any filter like you did.

I would also try to remove the rewrite rule as Damian suggests.

0

Additionally, I would recommend upgrading to the latest version of PrettyFaces - see http://ocpsoft.org/prettyfaces/

Lincoln
  • 3,151
  • 17
  • 22