How to create path-parameter from url?

Splash Forums PrettyFaces Users How to create path-parameter from url?

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Lincoln Baxter III 6 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #17849

    ismaximum
    Participant

    Hi,

    I have an application in which content of another application will be displayed. if the new content has a link, the link automatically will be rewritten with external URI but with my application host and context path.

    My question is how can I extract the external uri path from the URL and put it as a path-parameter:

    for example:

    /myapp_contxt/pages/oldStore?p1=value1&p2=value2

    I want this changes to:

    /myapp_contxt/pages/index.xhtml?path=oldStore&p1=value1&p2=value2

    and of course an action is required to be invoked to manage this and show the resul

    Thanks

    #20585

    Hi –

    You probably want to take a look at custom URL rewrite rules:

    http://ocpsoft.com/docs/prettyfaces/snapshot/en-US/html_single/#inbound_rewriting

    Something like this (disclaimer: not verified to be exactly what you need):

    <rewrite match="^/pages/(oldStore.*)" substitute="/pages/index.xhtml?path=$1" redirect="chain"/>

    Notice that I used “chain” as the redirect type, this will do an internal redirect (servlet forward), and will not change the browser address… if you DO wish to issue a browser redirect, use “301” instead.

    Hope this helps,

    Lincoln

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

You must be logged in to reply to this topic.

Comments are closed.