Problem with images and trailingSlash=append

Splash Forums PrettyFaces Users Problem with images and trailingSlash=append

This topic contains 6 replies, has 2 voices, and was last updated by  Christian Kaltepoth 10 years, 11 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #17855


    When writing a rule to add slashes at the end of the urls works fine, but do not display the images on the site, in my pretty-config file I added the following rule to try to fix it:

    <pretty-config xmlns=""

    <rewrite match="(?!.*resources.*).*" trailingSlash="append" toCase="lowercase" />


    I tried the above regex in “” and it works fine, but not on my site, my development environment is as follows:

    – JSF 2

    – EJB 3

    – Facelets

    – Glassfish v3

    – PrimeFaces 2.2

    – JQuery

    For example I have the following line in index.xhtml:

    <h:graphicImage url=”/resources/imagenes/logo.png” width=”110px” height=”110px”/>

    The rendered output is:

    <img src=”/sistelweb/resources/imagenes/logo.png/” height=”110px” width=”110px” />

    If the rule is fine, I do not know because it keeps adding slash at the end…

    I need your help, I would integrate Prettyface to my project, that is all that I can not solve. Thanks in advanced.

    PD: Sorry for my bad English, greetings from Ecuador.


    Could you perhaps provide a minimal demo application reproducing this issue? You could use one of the PrettyFaces archetypes if you want.

    It is very strange that this is happening as your regular expression looks fine.



    I created a basic example of what I’m doing (, it is strange what is happening, according to the rule when the URL contains the word “imagenes” should not apply.

    The code in my index.html is the following:

    <?xml version=’1.0′ encoding=’UTF-8′ ?>

    <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “”>

    <html xmlns=””



    <f:view contentType=”text/html” >


    <title>Facelet Title</title>



    <img src=”/WebApplication1/resources/imagenes/logo.png” width=”110px” height=”110px” alt=”” />

    <h:link value=”Contacto” outcome=”contacto” />

    <h:link value=”Productos” outcome=”productos” />

    <h:outputLink value=”/WebApplication1/dos.xhtml” >Productos</h:outputLink>




    My pretty-config.xml has the same rule.

    In the project I uploaded are all the files, I used to run:

    Netbeans 6.9.1

    JDK 6 update 23

    Glassfish 3.0.1


    Thank you! I’ll take a look at it an come back to you as soon as possible..


    Don’t ask my why but this seems to do the job:

    <rewrite match="^((?!imagenes).)*$" trailingSlash="append" toCase="lowercase" />

    Here is the page I got the hint from:



    Excellent, I don’t understand that regex but it works… thanks very much… :D


    Yeah, this regex looks very odd. But it seems to do the job. I guess we should mention this in the documentation because “everything but” is a very common pattern especially when using trailingSlash and toCase.

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

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

Comments are closed.