Getting Response in ContainerResponseFilter's (JAX-RS 2)
问题 I am trying to port this CORS filter to JAX-RS 2. However, I do not see how to get the Response object (as in the old code) from the ContainerResponseContext I get passed in the overridden method of ContainerResponseFilter. If there is a more elegant way to do CORS with JAX-RS 2, that would be preferrable of course. Thanks in advance. 回答1: Thre response is directly accessible as the ContainerResponseContext : @Provider public class ResponseCorsFilter implements ContainerResponseFilter{