Help needed regarding using pretty faces

Splash Forums PrettyFaces Users Help needed regarding using pretty faces

This topic contains 8 replies, has 2 voices, and was last updated by  Christian Kaltepoth 8 years, 7 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #23921



    This is Neeraj, very new to Pretty Faces. Actually I have a web application build on Spring Web and JSF 1.2.x. I am trying to use ‘pretty faces’ for simplifying the URLs.

    I was trying to configure with the help of Documentation and some googling but no luck, getting some issues.

    When I tried debugging, I noticed that when I hit url with pattern, redirect takes place but nothing is displayed. When I looked at page the view source then I can see the xhtml content with JSF tags etc. Which means JSF tag transformation is not happening and eventually nothing is displayed.

    Requesting you all to provide some insight so that I can proceed.



    It is difficult to say what is happening in your case without seeing you configuration. Could you post your pretty-config.xml or the annotations you are using?



    I was not able to send the config files (web.xml and pretty-config.xml) in mail body. Sending then as file in txt formatt.

    As I mentioned earlier, I could see the content of list-instances.xhtml in view source but actual transformation is not happening.



    Could you try to modify the pretty-config.xml to point to the JSF view as mapped by the FacesServlet. Something like this:

    <view-id value="/faces/provisioning/list-instances.xhtml?isfirst=true" />


    <view-id value="/provisioning/list-instances.faces?isfirst=true" />

    Or, just for a test, remove the query parameter:

    <view-id value="/faces/provisioning/list-instances.xhtml" />

    I’m not sure which mapping your container uses for the FacesServlet, because you don’t explicitly configure it in your web.xml.


    BTW: If you are starting to use PrettyFaces, I recommend to have a look at Rewrite instead. Rewrite is the successor of PrettyFaces and allows you to specify your configuration in a typesafe way like this:

    .addRule( Join.path("/li").to("/provisioning/list-instances.faces") )

    Look here to learn more about Rewrite:



    Thanks for the help. using extension as “faces” worked.
    Also I will look at ‘Rewrite” implementation.

    Now with your help, most of links are working fine but I am noticing issues with ajax request(urls) which I make through Servlet. Basically I have servlet mappings for these URLs along with patterns defined in web.xml . All these request are turning into 404. I am sure that “Pretyfaces” would definitely be having some settings/config which can exclude my set of urls from precessing.

    Any thoughts?



    The typical way to avoid such issues is to restrict the PrettyFaces patterns to not match the URLs of your servlets. Could you post the relevant parts of your web.xml and your complete PrettyFaces configuration?



    I was not able to paste the web.xml content directly, hence sending it as attachment. Sorry about that.



    I don’t see any reason why your servlet doesn’t work any more. And you say it works if you remove the PrettyFaces dependency from the project?

    PrettyFaces is configured to only intercept the two URLs you specified in your pretty-config.xml. Every other request is ignored by PrettyFaces.

    Could you perhaps build a tiny sample application that reproduces this?

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.