cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Tremblay (JIRA)" <>
Subject [jira] [Commented] (CXF-5038) More flexible QueryParams
Date Fri, 24 May 2013 14:16:27 GMT


Vincent Tremblay commented on CXF-5038:

I didn't know about the ParamConverterProvider,that's quite interesting. But it's not possible
to create multiple parameters from a unique bean with it. (Ex.: ComplexObject -> ?param=property1&param=property2&otherParam=property3)

Something like this could be done with QueryParam(""), but then, the parameters' name will
match the name of the bean's fields, which does not always fit the needs. 

In my case, I'm extracting distributed cores from an already existing application, so I cannot
control all the naming of the old objetcs. 

> More flexible QueryParams
> -------------------------
>                 Key: CXF-5038
>                 URL:
>             Project: CXF
>          Issue Type: New Feature
>          Components: JAX-RS
>            Reporter: Vincent Tremblay
>            Assignee: Sergey Beryozkin
> It would be useful to be able to handle how a beans are traduced into QueryParams.
> I can see something like a ParametersWriter<T> and a ParametersReader<T>
to achieve this goal.
> Ex.
> Let's say that you have the following method:
> @GET
> @Path("/resource")
> public void doSomething(@QueryParam ComplexObject);
> You could declare a ParametersWriter that can handle the creation of the parameters:
> public class ParametersWriter<ComplexObject> {
>     writeParameters(ComplexObject object, Map<String, List<Object>> params)
>          params.put("filter", Arrays.asList(...,...));
>          params.put("query", Arrays.asList(...));
>     }
> }
> Then, on the server side, you could have a ParametersReader<ComplexObject> that
can rebuild the object from the request's parameters.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message