cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin" <>
Subject Re: ParameterHandler Question
Date Thu, 15 Oct 2009 10:02:48 GMT
Hi Eric

It's a typo, sorry. Just fixed it. ParameterHandler implementations can be registered as providers;
there're examples showing how to 
register  providers, so I don't show it every time to save some space. For ex, here's how
you can do it from Spring :

<jaxrs:server address="/">
   <ref bean="paramHandler"/>

<bean id="paramHandler" "org.apache.cxf.systest.jaxrs.MapParamHandler"/>

thanks, Sergey

----- Original Message ----- 
From: "Eric Johnson" <>
To: <>
Sent: Wednesday, October 14, 2009 10:05 PM
Subject: ParameterHandler Question

I was looking through the documentation on JAX-RS and found this:
CXF JAXRS supports ParameterHandler extensions which can be used to deal
with method parameters annotated with one of the JAXRS parameter
annotations :
public class MapHandler implements ParameterHandler<Map> {
    public Map fromString(String s) {...}

public class Service {

    public Response update(@PathParam("g") Map m, byte[] bytes) {
Note that ParameterHandlers can not be used to deal with parameters
representing a message body, "byte[] byte" in this example.
MessageBodyReaders have to deal with this task. That said, a given
MessageBodyReader implementation can also implement ParameterHandler.
ParameterHandlers can be registered as providers either from Spring or
I'm feeling a little stupid because I cannot figure out from the example
code what is going on. I see that the PathParam is looking for the path
segment "g" which does not appear to exist in the URI template and wants
to map that value into a Map. I also see that there is a
ParameterHandler implemented that maps a PathParam to a Map. So, does
the ParameterHandler get used when the URI template variable does not
exist? Or is it just a typo? Or does it not matter?
Also could an example of how the ParameterHandler is registered be

View raw message