Hi,
I have been trying to get some interceptors registered without much
success. According to the documentation
(http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAXRSendpointsprogrammaticallywithoutSpring)
I should be able to register my interceptors by doing some variation
of the following:

        <init-param>
            <param-name>jaxrs.inInterceptors</param-name>
            
<param-value>org.apache.cxf.jaxrs.provider.jsonp.JsonpInInterceptor</param-value>
        </init-param>

I have tried doing this, but it does not seem to take effect when
adding the normal "...&_jsonp=myCallback" to my url. I set a
breakpoint in JsonpInInterceptor.handleMessage(), but it was never
called. Any clues?

There is also a outInterceptors parameter that need to be set, but I
need to specify two interceptors. Would this be correct?
        <init-param>
            <param-name>jaxrs.outInterceptors</param-name>
            
<!--<param-value>org.apache.cxf.jaxrs.provider.jsonp.JsonpPreStreamInterceptor,
org.apache.cxf.jaxrs.provider.jsonp.JsonpPostStreamInterceptor</param-value>-->
            
<param-value>org.apache.cxf.jaxrs.provider.jsonp.JsonpPreStreamInterceptor</param-value>
        </init-param>

I have only seen Spring examples for configuring these interceptors.
What (where) would be a good way of doing this? I have seen the use of
JAXRSServerFactoryBean to add interceptors, but I do not see where
JAXRSServerFactoryBean should go in the Application (it at all).


See this section:
http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ConfiguringJAXRSservicesincontainerwithoutSpring

At the moment, in/out interceptors will only be picked up if jaxrs.serviceClasses and jaxrs.providers parameters are used instead of
javax.ws.rs.Application.

It does make sense to get jaxrs.outInterceptors and jaxrs.inInterceptors supported with Application as well
Cheers, Sergey

Reply via email to