URL after validation error

Splash Forums Rewrite Users URL after validation error

This topic contains 2 replies, has 2 voices, and was last updated by  rodrigorgs 2 years, 11 months ago.

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

    rodrigorgs
    Participant

    I have a rule like this:

    .addRule(Join.path("/items/{id}").to("/item_edit.jsf"))

    So, when I have a link to item_edit.jsf?id=1, it is rewritten as /items/1.

    The page contains a form with required fields. When I submit the form with blank fields, I’m forwarded to the same page, however, the URL becomes /item_edit.jsf (instead of /items/1). It looks like I’m loosing the parameter “id”. What should I do to keep the URL as /items/1 after a failed form submission?

    #24696

    Just wondering. Are you using the rewrite-integration-faces extension? This or ‘rewrite-config-prettyfaces’ is required in order to get JSF to render the correct URLs in forms 🙂

    <dependency>
        <groupId>org.ocpsoft.rewrite</groupId>
        <artifactId>rewrite-servlet</artifactId>
        <version>2.0.5.Final</version>
    </dependency>
    <dependency>
        <groupId>org.ocpsoft.rewrite</groupId>
        <artifactId>rewrite-config-prettyfaces</artifactId>
        <version>2.0.5.Final</version>
    </dependency>
    #24729

    rodrigorgs
    Participant

    Hmm, I wasn’t. I added the extension and now it works. Thanks!

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

You must be logged in to reply to this topic.

Comments are closed.