Rewrite rule to page with an anchor

Splash Forums PrettyFaces Users Rewrite rule to page with an anchor

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

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

    tjankowski
    Participant

    Hi,

    I’m trying to write rewrite rule to url with anchor, but I don’t know how to disable coding hash on substitute param.

    My example rewrite rule

    <rewrite match=”/galleries/(w+)/note/(w+)” substitute=”/galleries/$1#note_$2″ />

    rewrites url /galleries/123/note/123 to /galleries/123%23note_123, instead of /galleries/123#note_123

    Can anybody help ?

    _______________________________

    JSF 1.2

    PrettyFaces 3.0.1

    #21467

    Hi tjankowski,

    I’m not sure this is possible :( it seems that we are always encoding the full URL, so this would have to happen after encoding. We don’t currently support that in a convenient way, sadly.

    However, you could do the redirection yourself using the rewrite com.ocpsoft.pretty.faces.rewrite.Processor class, using the HttpServletResponse.sendRedirect(…) method:

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

    (the docs are slightly outdated, there are now two methods to implement.

    ~Lincoln

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

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

Comments are closed.