users@jersey.java.net

Re: [Jersey] Redirect /foo/ to /foo (remove trailing slash)

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 07 Sep 2009 14:50:12 +0200

On Sep 7, 2009, at 2:29 PM, Charles Brooking wrote:

> Paul Sandoz wrote:
>> Can you log an issue?
>
> Issue 367: Redirect /foo/ to /foo (remove trailing slash)
> https://jersey.dev.java.net/issues/show_bug.cgi?id=367
>
>> This is something should be fairly easy to implement in terms of
>> redirection, the only tricky aspect is what the user should utilize
>> to declare that redirection in the reverse direction should occur for
>> a resource (rather than being something that applies to all
>> resources)
>
> My understanding is that the current redirection happens whenever a
> request's path + "/" equals @Path for some resource. So perhaps the
> opposite could happen whenever request.getPath() equals some @Path +
> "/". Then no user declaration is necessary.
>

The current behavior when ResourceConfig.FEATURE_REDIRECT is enabled
is to return a 404.

What i am wondering is: should we should break that behavior to
redirect, or require that a another, new, feature to be set for such
redirection to occur ?

Paul.