Rewriting issue

Splash Forums PrettyFaces Users Rewriting issue

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

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

    ravindra
    Participant

    Hi sir,

    Am facing one issue

    i declared in pretty-config.xml

    <rewrite match=”/#{accountid}/#{title}/#{titleValue}” substitute=”/#{title}”/>

    <url-mapping id=”viewDetails”>
    <pattern value=”/o/viewDetails/#{accountid}/#{title}/#{titleValue}” />
    <view-id value=”/pages/viewDetails.xhtml” />
    </url-mapping>

    Am getting error i.e.

    com.ocpsoft.pretty.PrettyException: Failed to parse PrettyFaces configuration from /WEB-INF/pretty-config.xml

    Please help me
    how cal i write dynamic rewrite rules?

    Regards
    Ravindra

    • This topic was modified 2 years, 8 months ago by  ravindra.
    #25550

    You cannot use EL expressions like #{...} with <rewrite>. You have to use regular expressions instead:

    <rewrite match="/foo/(\w+)/" substitute="/bar/$1/" />

    See:

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

    #25553

    You should probably take a look at Rewrite. It will allow you to create more dynamic rules:

    http://ocpsoft.org/rewrite/

    Specifically, you probably want to use the Join and/or Substitute configuration elements:

    http://ocpsoft.org/rewrite/docs/configuration/mapping

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

You must be logged in to reply to this topic.

Comments are closed.