Hi On Mon, Aug 23, 2010 at 3:46 PM, Marian Muller <[email protected]>wrote:
> > > Glen Mazza wrote: > > > > Hopefully someone else can answer for an interceptor, but I know how to > do > > this with a JAX-WS handler at least: > > http://www.jroller.com/gmazza/entry/jaxws_handler_tutorial , which links > > to this sample (client-side, but probably similar process for > > service-side): > > > http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/jaxws_handlers/src/demo/handlers/common/SmallNumberHandler.java?view=markup > > > > Thank you. I will take a look at it, but I am not sure that the use of > JAX-WS handlers is suited to my context. So I am still listening for an > interceptor-based solution. > The JAXRS modules uses few different approaches : - create a response object in the in interceptor and store it on the exchange and register a custom invoker which blocks the invocation if the response object is already available - also register a custom out interceptor which serializes the response to the output stream first and then aborts the chain... - write directly to the HttpServletResponse from the in interceptor (I think it is available on th in message as AbstractHttpDestination.HTTP_RESPONSE), add an AbstractHTTPDestination.RESPONSE_COMMITTED to the exchange and have a custom invoker blocking the invocation if this property exists and also abort the out chain if needed - similarly to the above : redirect using RequestDispatcher to some custom resource, but register an AbstractHTTPDestination.RESPONSE_REDIRECTED property instead cheers, Sergey > -- > View this message in context: > http://cxf.547215.n5.nabble.com/Interceptors-sending-a-custom-response-before-invoking-the-service-tp2644637p2644811.html > Sent from the cxf-user mailing list archive at Nabble.com. >
