cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <>
Subject Re: @MatrixParam and interface
Date Fri, 20 May 2011 13:18:54 GMT

On Fri, May 20, 2011 at 12:24 PM, Red Black <> wrote:
> I have a resource like this (CXF JAX-RS):
> *@GET
> @Path("/test/{user}/{id}")
> public boolean getTest(@MatrixParam("user") User user, @PathParam int id)
> {...}*
>  where User is an interface, like this:
> *public interface User {
>      public String getUserName();
>      public void setUserName(String userName);
>      public String getJob();
>      public void setJob(String job);
> }*
> *
> *so, if I call http://localhost:8080/CXF/service/test/user;name=spider;
> job=manager/id=13 it is possible in some way (for example dynamic proxy
> class) that user is initialized and contains name and job passed from URL. I
> believe to use ParameterHandler but it doesn't work with @MatrixParam (but
> work with @PathParam for instance). I can do that in some way?
> Thank you very much.

ParameterHandler works for individual parameters(Matrix, Path, Form)
but if you need multiple parameters
injected in a bean then the following should work:

@MatrixParam("") User user

Now, I'm not sure if it will work with User being an interface as
opposed to a concrete class. XmlJavaTypeAdapters are actually checked
as well when parameters are processed, but I'm not sure if it is the
case with the "" extension.

Cheers, Sergey

View raw message