I've created a RestEASY Interceptor to allow me to set header values on the HTTP response after my webservice call has completed. My code looks like this...
@Provider
@ServerInterceptor
@Precedence("HEADER_DECORATORS")
public class MyHeaderInterceptor implements
MessageBodyWriterInterceptor {
@Override
public void write(MessageBodyWriterContext context) throws IOException,
WebApplicationException {
....do stuff here....
}
}
When I make a call to my service, however, the interceptor is never called. I see the webservice call complete successfully, but none of the code in my interceptor is ever executed. Is there anything beyond this that I need to do to register my interceptor? Does it have to be declared anywhere else? Are there any special web.xml parameters that need to be included?