You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christian Hartmann <ch...@christian-hartmann.de> on 2011/09/07 15:19:51 UTC

RESTful Service: Problem with @PathParam starting with slashes

Dear all,

I've go the following Path-Annotation for my Delete-Method using REST and CXF 2.4.2

@DELETE
@Path("/{userid:.+}/univids/{univid:.+}")
public Response deleteUnivId(@PathParam("userid") final String userId,
                                @PathParam("univid") final String univid,
                                @QueryParam("affiliateId") final String affiliateId)
[...]

It works properly for many cases.

Now I like to send this delete-call

/v1/univids/Franki/univids///TOP49

Unfortunately, I got only 'TOP49' within my method for the PathParam univId.

The tomcat-access-log looks fine:

[...]

[07/Sep/2011:15:01:16 +0200] "DELETE /v1/univids/Franki/univids///TOP49 HTTP/1.1" 404 - "null" "GraphicalHttpClient 1.0.5 (Macintosh; Mac OS X 10.6.8; de_DE)"

Anybody out there who might help? 

Any help will be appreciated.

Regards,

Christian







Re: RESTful Service: Problem with @PathParam starting with slashes

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On 07/09/11 14:19, Christian Hartmann wrote:
> Dear all,
>
> I've go the following Path-Annotation for my Delete-Method using REST and CXF 2.4.2
>
> @DELETE
> @Path("/{userid:.+}/univids/{univid:.+}")
> public Response deleteUnivId(@PathParam("userid") final String userId,
>                                  @PathParam("univid") final String univid,
>                                  @QueryParam("affiliateId") final String affiliateId)
> [...]
>
> It works properly for many cases.
>
> Now I like to send this delete-call
>
> /v1/univids/Franki/univids///cting
>
> Unfortunately, I got only 'TOP49' within my method for the PathParam univId.
>

I think it's to do with a user id reg expression affecting the matching.
I've done few local tests,

@Path("/{userid:1}/univids/{univid:.+}")

with a very 'specific' reg ex for the first userid var causes no 
side-effects.

Try to restrict somehow a userid regex or have several DELETE methods 
dealing with different path segments

Let me know please if you can make it work
Sergey



> The tomcat-access-log looks fine:
>
> [...]
>
> [07/Sep/2011:15:01:16 +0200] "DELETE /v1/univids/Franki/univids///TOP49 HTTP/1.1" 404 - "null" "GraphicalHttpClient 1.0.5 (Macintosh; Mac OS X 10.6.8; de_DE)"
>
> Anybody out there who might help?
>
> Any help will be appreciated.
>
> Regards,
>
> Christian
>
>
>
>
>
>
>