Discussion:
CXF interceptor chain, servlet filter chain, JAX-RS filters
Charlie Read
2014-02-26 10:18:51 UTC
Permalink
I have noticed three separate mechanisms for intervening
in the request / response processing:

- CXF interceptors
- JAX-RS filters
- servlet filters

Can someone explain the processing priority of each of these chains
with respect to one another?

For example, is the priority servlet filters => CXF interceptor => JAX-RS
filter,
or something else?

Thanks!
Charlie
Sergey Beryozkin
2014-02-26 13:46:37 UTC
Permalink
Hi
Post by Charlie Read
I have noticed three separate mechanisms for intervening
- CXF interceptors
- JAX-RS filters
- servlet filters
Can someone explain the processing priority of each of these chains
with respect to one another?
For example, is the priority servlet filters => CXF interceptor => JAX-RS
filter,
or something else?
Servlet filters go first.
Next, if you prefer doing JAX-RS 2.0 only, we have
PreMatch Container Request Filter, then per-method specific Container
Request Filters,

If you'd like to use native CXF interceptors instead of filters, then we
have

Servlet filters -> CXF interceptors.

If you mix JAX-RS 2.0 filters & CXF interceptors, then

Servlet filters -> CXF interceptors before UNMARSHAL phase ->
PreMatch Container Request Filter -> CXF interceptors after UNMARSHAL
phase -> per-method specific Container Request Filters

Sergey
Post by Charlie Read
Thanks!
Charlie
--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com
Loading...