You've tried hex-encoding the URL forward-slashes (as "%2F"), or?

I'm using an old version of Jersey (0.6-ea) on another project, and I'm happily accepting hex-encoded URIs as part of a resource parameter.

Cheers,
Eoghan


Tarjei Huse wrote:
Hi, I got a service where I want to expose a resource that is defined by
an url to a rssfeed, something like:

    @GET
    @Path("/{URL}/")
    public Subscriber getSubscriber(@PathParam("URL") String url) {
       ... do something with the url.
    }

Now, this does not work with normal urls, nor with urlencoded urls. Why
urlencoded values do not work I do not know, but for normal values, it
seems obvious (they contain '/'s). I've also tried base64 encoding the
urls, but that didn't work either because sometimes the base64 encoded
string contains slashes as well.

So, is there a "correct" way to do this or should I just map directly to
database ids or use request parameters whenever I need to deal with urls?

Kind regards,
Tarjei

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to