rewrite param like siteName.com/param

Splash Forums PrettyFaces Users rewrite param like siteName.com/param

This topic contains 2 replies, has 2 voices, and was last updated by  cough 5 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18091

    cough
    Participant

    hi,

    i use jsf 2 and prettyfaces. My servlet mapping in web.xml is above:

    <servlet-mapping>

    <servlet-name>Faces Servlet</servlet-name>

    <url-pattern>*.xhtml</url-pattern>

    </servlet-mapping>

    And my pretty-config.xml url mapping is above:

    <url-mapping id=”article”>

    <pattern> /article/#{title} </pattern>

    <view-id>/article.xhtml</view-id>

    </url-mapping>

    By this pattern i can rewrite url like that “mysite.com/article/title1”.

    But i want to write like that “mysite.com/title1”.

    I tried “<pattern> /#{title} </pattern>”, but i got exception.

    If i write “<pattern> /#{title}/ </pattern>”, i don’t get exception but url is like that “mysite.com/title1/”. I want to rewrite exactly “mysite.com/title1”.

    How can i do that?

    Thanks for interests

    #21688

    What is the exception?

    try:

    <pattern value="/#{ /(?!.*\.xhtml.*)[^/]+/ title}"/>

    #21689

    cough
    Participant

    it works! thank you very much.

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

You must be logged in to reply to this topic.

Comments are closed.