Trailing slashes & the rewrite @Join annotation

Splash Forums Rewrite Users Trailing slashes & the rewrite @Join annotation

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Christian Kaltepoth 1 month, 3 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #27407

    Geoffrey Hayward
    Participant

    Hello,

    I am using annotated @RequestScopped CDI beans with JSF, and everything is working fine. However, I cannot find any documentation on how to control trailing slashes when using the @Join annotation.

    Can someone point me in the correct direction?

    Many thanks

    #27408

    There is a special rule for that:

    https://github.com/ocpsoft/rewrite/blob/2697f91fa3ec60ffc9e8269fca794665b19f510f/config-servlet/src/main/java/org/ocpsoft/rewrite/servlet/config/rule/TrailingSlash.java

    You should give it a try. I didn’t find any test case that shows how it is used, but it should be easy to get from the source.

    #27409

    Geoffrey Hayward
    Participant

    Hi Christian,

    Thank you for getting back to me. The link you sent is very helpful.

    Am I correct in thinking that with Rewrite it’s not passable to turn on/off trailing slashes for an individual rule without effecting the other rules? Unlike with PrettyFaces you could.

    Kind regards

    #27410

    IIRC you can combine the TrailingSlash rule with other conditions to restrict for which URLs the rule should apply. Something like this:

    .addRule( TrailingSlash.append() )
    .when( Path.matches("/foobar/{*}") )
    

    But I don’t remember all the details.

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

You must be logged in to reply to this topic.

Comments are closed.