Pretty faces don`t work for me

Splash Forums PrettyFaces Users Pretty faces don`t work for me

This topic contains 31 replies, has 4 voices, and was last updated by  Lincoln Baxter III 4 years, 4 months ago.

Viewing 15 posts - 1 through 15 (of 32 total)
  • Author
    Posts
  • #19136

    yfovumub
    Participant

    Hello all,

    chkal told me about the existence of this forum and suggested to write in it. He told me that you folks could help me.

    I uploaded a trivial web app for me to see how pretty faces work, to apply it to my other projects.

    I followed exactly the simple tutorial at http://ocpsoft.org/prettyfaces/

    #23265

    What is the problem you are experiencing?

    #23266

    Works fine for me /home:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Default title</title>
    </head>
    <body>
    <div id="content">
    ########################
    </div>
    </body>
    </html>

    #23267
    #23268

    yfovumub
    Participant

    Extarordinary…for me the web app is working, just not with the pretty URL like /home, for me it is /home.xhtml …

    #23269

    Could you explain what you mean with “not working”. Do you get a 404? Or is an exception thrown?

    Which container do you deploy the app to?

    #23270

    Any news on this one?

    #23271

    yfovumub
    Participant

    Thank you for your response. I am sorry for the expression “not working”…it is a bad use of words.

    The app is working properly, like it should without pretty faces. But I done everything that the tutorial said and it is still /home.xhml.

    I use GlassFish 3. I could post every important file for you

    #23272

    What happens if you enter /home into the browser address bar? Does your home page show up? Does it render correctly?

    #23273

    yfovumub
    Participant

    hmmm I never tried this before.

    It works if I write simply /home in the address bar, but it doesn’t work if I use the “HOME” link on the page.

    It must be the link, it doesn’t render good in the page.

    How should it look like???

    in <a href=””… or in <h:commandLink …??

    #23274

    You should either use:

    <pretty:link mappingId="home">
    Home
    </pretty:link>

    or:

    <h:link outcome="/home.xhtml">
    Home
    </h:link>

    or:

    <h:link outcome="pretty:home">
    Home
    </h:link>

    Using plain <a> links won’t work. You should have a look at:

    http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/components.html

    http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/outbound_rewriting.html#jsf

    #23275

    Yes, what Christian said is what you will need to do in order to get URLs in your pages to be created correctly. In Rewrite 2.0 you will be able to use output buffering to modify even HTML URLs, but this is slow and not recommended unless you truly cannot correctly use a framework to create links in the source HTML of the page.

    #23276

    yfovumub
    Participant

    aha that is why it did not work. I didn’t thought that just a simple h:commandLink or a a href would work, because those commands didn’t said anything about what corresponds to them (the mapping).

    I will try this and get back to you all. I am grateful.

    Thank you very much for your help and your time!

    #23277

    Anonymous

    pretty faces also dont work for me..

    first tell me if i use JSF2 with annotation then its necessary to use pretty face with annotations ? if no then i am using pretty face with pretty-config.xml file but its not working in server logs

    Jan 20, 2013 4:37:57 AM com.ocpsoft.pretty.PrettyFilter init

    INFO: PrettyFilter starting up…

    Jan 20, 2013 4:37:57 AM com.ocpsoft.pretty.PrettyFilter init

    INFO: PrettyFilter initialized.

    but when ever i click on commad button for do some thing it refresh same page

    i am using eclipse , servlet 3.0 , tom cat , jsf2 with annotations

    please HELP!!

    #23278

    Anonymous

    can any one send me a example of prettyface with jsf 2 please

Viewing 15 posts - 1 through 15 (of 32 total)

You must be logged in to reply to this topic.

Comments are closed.