users@jersey.java.net

Re: [Jersey] Double // in URL

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 05 Jan 2009 12:17:05 +0100

See the features on ResourceConfig [1], specifically
FEATURE_CANONICALIZE_URI_PATH.

You can set features/properties declared by ResourceConfig in the
web.xml as init-param declarations using the String constant field name.

Sometimes it is best to tell the client to redirect (see
FEATURE_REDIRECT ), that way it is more efficient for caches.

By default such features are not enabled as we found they caused more
confusion when they were enabled by default.

Paul.

[1] https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.0.1/api/jersey/com/sun/jersey/api/core/ResourceConfig.html


On Dec 29, 2008, at 3:13 PM, Daniel Manzke wrote:

> Is there a way, to tell Jersey what it should threat them as equal?
>
>
> My problem is that I'm using sub locators and it seems that jersey
> stop finding a sub resource when hitting the empty path segment. If
> I understand you right, jersey should give me an empty resource and
> it would be my turn to do the right thing.
>
> But empty path isn't supported by jersey right?
>
>
> Thanks,
> Daniel
>
> 2008/12/29 Julian Reschke <julian.reschke_at_gmx.de>
> Daniel Manzke wrote:
> Hi,
>
> a short question.
>
> Are they equal? :) Does jersey threat them as equal?
>
> - http://localhost/filesystem//ECM%20Search/hitlist_suchseite_1.jpg
> - http://localhost/filesystem/ECM%20Search/hitlist_suchseite_1.jpg
>
> Depends on the equality relation :-) With URIs there can be many.
>
> In this case, one of the URIs contains an empty path segment. It
> depends on the use case how to compare them.
>
> In *practice* I don't see anybody using empty path segments on
> purpose, thus I'd treat them as a client error (pasting together a
> URI), and compare them as equal.
>
> BR, Julian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
>
>
> --
> Mit freundlichen Grüßen
>
> Daniel Manzke