Rewrite URL deifiend in web.xml

Splash Forums PrettyFaces Users Rewrite URL deifiend in web.xml

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

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

    Carolina
    Member

    Hi,

    I have defined welcome page and error page in web.xml as below.

    How to rewrite these URL from pretty-config.xml?

    Web.xml:

    <welcome-file-list>

    <welcome-file>/pages/hotel/hotelHome.xhtml</welcome-file>

    </welcome-file-list>

    <error-page>

    <exception-type>java.lang.Exception</exception-type>

    <location>/pages/common/errorHome.xhtml</location>

    </error-page>

    #23018

    Carolina
    Member

    Any solutions?

    #23019

    Sorry, I am at JavaOne and haven’t had much time to catch up:

    You need to modify the mappings to look like this:

    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/error</location>
    </error-page>

    Then in pretty-config.xml, you need to add mappings for these Pretty URLs.

    <url-mapping>
    <pattern value="/" />
    <view-id value="/pages/hotel/hotelHome.xhtml"/>
    </url-mapping>

    <url-mapping>

    <pattern value=”/error” />

    <view-id value=”/pages/common/errorHome.xhtml”/>

    </url-mapping>`

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

You must be logged in to reply to this topic.

Comments are closed.