cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Downey (JIRA)" <>
Subject [jira] Commented: (CXF-3226) Going to a JAX-RS resource that contains a space in the path returns a 404 response code
Date Tue, 04 Jan 2011 05:03:47 GMT


Jason Downey commented on CXF-3226:

If you want to match @Path("the%20%space"), per RFC3986, the client should already have encoded
this parameter as "the%2520%25space" and then the JAX-RS runtime should appropriately find
the resource.

Looking @ the JAX-RS 1.1 specification, @Path can contain spaces! If you look at page 14 (in
section 3.4), there is this sample:

1 @Path("widget list/{id}")
2 @Path("widget%20list/{id}")

The specification states that these two lines are equivalent.

In my humble opinion (and I'll defer to you since you know the code way better than me), the
key problem that needs to be addressed is that the base URL value needs to be calculated correctly.
The fix doesn't necessarily have to be in AbstractServerController. You could subclass AbstractServerController
and then provide your own implementation of getBaseURL to do the appropriate work. This ServerController
would then only be used within CXFNonSpringJaxrsServlet.

On the JIRA question, yes, I think it's a valid JIRA issue but I'm welcome to discussing that

> Going to a JAX-RS resource that contains a space in the path returns a 404 response code
> ----------------------------------------------------------------------------------------
>                 Key: CXF-3226
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.3.1
>         Environment: Java 1.6_22
> Apache CXF 2.3.1
>            Reporter: Jason Downey
>             Fix For: 2.3.2
>         Attachments:, patch.diff
> If you go to a JAX-RS resource that contains a space in the path, the Apache CXF JAX-RS
runtime returns a 404 response code. In the STDERR log, you'll see the following message:
> Jan 1, 2011 3:05:01 PM org.apache.cxf.jaxrs.utils.JAXRSUtils findTargetMethod
> WARNING: .No operation matching request path /has%20space is found, HTTP Method : GET,
ContentType : */*, Accept : application/xml,application/xhtml+xml,image/png,text/html;q=0.9,text/plain;q=0.8,*/*;q=0.5,.
> The cause for this problem may be found in AbstractServerController.getBaseURL. It assumes
pathInfo is always decoded but in the JAX-RS situation, it may actually still be encoded.
> Relevant sample code + patch attached.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message