Aug 25, 2018

[HDGEM] Server side Response filter

A server side Response filter is invoked by the runtime after a response (or an exception) is generated by the JAX-RS resource method (before dispatching the same to the caller/client). 

Response filters are similar to their counterparts (Request filters) in terms of their utility (read/mutate aspects of the response e.g. HTTP headers) and programming model (executed as a chain in a user
defined or default order)

Setting up a server side response filter is as simple as providing an implementation for the javax.ws.rs.container.ContainerResponseFilter interface. The injection of
ContainerResponseContext into the filter method of the ContainerResponseFilter interface is taken
care of by the JAX-RS runtime.

Response filters also need to be annotated with the javax.ws.rs.ext.Provider annotation in order for the JAX-RS runtime to recognize it automatically.

--
Posted By Blogger to HDGEM at 11/24/2016 11:51:00 AM