I don't think including all this filter boilerplate code is very useful. If you're writing a new filter, it's arguably better to create a Jersey/JAX-RS one.

A more likely scenario is re-using an existing filter, Jetty's CORS filter for example:
http://www.eclipse.org/jetty/documentation/current/cross-origin-filter.html