Reply To: How to append Trailing Slash

Splash Forums Rewrite Users How to append Trailing Slash to the requested URL Reply To: How to append Trailing Slash

#24586

Good question! To start, you can always use your existing prettyfaces configuration – just include the rewrite-config-prettyfaces JAR:

<dependency>
    <groupId>org.ocpsoft.rewrite</groupId>
    <artifactId>rewrite-config-prettyfaces</artifactId>
    <version>2.0.4.Final</version>
</dependency>

But if you want to do things the Rewrite way, you can do this:

.addRule(TrailingSlash.append)
.when(Path.matches("/{x}"))
.where("x").matches("^(?!.*\.xhtml.*).*$")

I hope this helps πŸ™‚