Eoghan Glynn wrote:
> Tarjei Huse wrote:
>> Eoghan Glynn wrote:
>>> 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.
>> Lucky you :)
>
> Just giving a data point that suggests hex-encoding the embedded URL
> probably /should/ work in CXF, as it does so in the reference
> implementation of JAX-RS.
>
>> I tried:
>> GET
>> http://localhost:8080/service/newsletter/http%3A%2F%2Ftest.com%3Frss%3Doijoij
>>
>>
>> For the service:
>> @GET
>>     @Path("/{URL}")
>>     public Newsletters getPagesForUrl(@PathParam("URL") String URL) {}
>
> Presumably you've annotated the resource class with
> @Path("/newsletter"), or?
Yes. The service responds if I use a non-hex-encoded value.

I guess I'll have to file a bug on this.

Kind regards,
Tarjei
>
> /Eoghan
>
>> and got:
>> <ns1:XMLFault>
>> <ns1:faultstring>
>> .No operation matching request path
>> /newsletter/http://test.com?rss=oijoij/ is found, ContentType : */*,
>> Accept :
>> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8.
>> </ns1:faultstring>
>> </ns1:XMLFault>
>>
>> I also tried to add @Encoded to the method like this:
>>     @GET
>>     @Path("/{URL}")
>>     @Encoded
>>     public Newsletters getPagesForUrl(@PathParam("URL") String URL) {}
>>
>> But it didn't help. The fault comes from:
>>     at
>> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:195)
>>
>>     at
>> org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:65)
>>
>>     at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
>>
>>
>>
>> Any tips?
>>
>> kind regards,
>> Tarjei
>>
>>> 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
>
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

Reply via email to