Author: buildbot
Date: Tue Mar 12 15:56:50 2019
New Revision: 1041725
Log:
Production update by buildbot for cxf
Modified:
websites/production/cxf/content/cache/docs.pageCache
websites/production/cxf/content/docs/jax-rs-filters.html
Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/cxf/content/docs/jax-rs-filters.html
==============================================================================
--- websites/production/cxf/content/docs/jax-rs-filters.html (original)
+++ websites/production/cxf/content/docs/jax-rs-filters.html Tue Mar 12
15:56:50 2019
@@ -121,11 +121,11 @@ Apache CXF -- JAX-RS Filters
 </p><p> </p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1547218568744 {padding: 0px;}
-div.rbtoc1547218568744 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1547218568744 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1552406172613 {padding: 0px;}
+div.rbtoc1552406172613 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1552406172613 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1547218568744">
+/*]]>*/</style></p><div class="toc-macro rbtoc1552406172613">
<ul class="toc-indentation"><li><a shape="rect"
href="#JAX-RSFilters-Filters">Filters</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#JAX-RSFilters-DifferencebetweenJAXRSfiltersandCXFinterceptors">Difference
between JAXRS filters and CXF interceptors</a></li></ul>
</li><li><a shape="rect"
href="#JAX-RSFilters-Overridingrequestandresponseproperties">Overriding request
and response properties</a>
@@ -133,42 +133,42 @@ div.rbtoc1547218568744 li {margin-left:
</li><li><a shape="rect"
href="#JAX-RSFilters-IgnoringJAXRSMessageBodyWriters">Ignoring JAXRS
MessageBodyWriters</a></li><li><a shape="rect"
href="#JAX-RSFilters-Custominvokers">Custom invokers</a></li></ul>
</div><h1 id="JAX-RSFilters-Filters">Filters</h1><p>Often it's necessary to
pre- or post-process some requests according to a number of requirements.<br
clear="none"> For example, a request like</p><p>GET /resource?_type=xml is
supported by a CXF specific RequestPreprocessor code which modifies an input
message <br clear="none"> by updating one of its headers.</p><p>A standard
mechanism for updating the request or response properties is to use JAX-RS 2.0
ContainerRequestFilter or
ContainerResponseFilter.</p><p>ContainerRequestFilters with a @PreMatching
annotation are run before the JAX-RS resource selection process starts.
PreMatching filters should be used to modify request URI or headers or input
stream. Post-matching filters are run just before a selected resource method is
executed.</p><p>Multiple ContainerRequestFilter and ContainerResponseFilter
filters can be ordered using a @Priority annotation.</p><p> </p><p>The
implementations can be registered like any other type of
providers :</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"><beans>
-<jaxrs:server id="customerService" address="/">
- <jaxrs:serviceBeans>
- <bean class="org.CustomerService" />
- </jaxrs:serviceBeans>
-
- <jaxrs:providers>
- <ref bean="authorizationFilter" />
- </jaxrs:providers>
- <bean id="authorizationFilter"
class="com.bar.providers.AuthorizationContainerRequestFilter">
- <!-- authorization bean properties -->
- </bean>
-</jaxrs:server>
+ <jaxrs:server id="customerService" address="/">
+ <jaxrs:serviceBeans>
+ <bean class="org.CustomerService" />
+ </jaxrs:serviceBeans>
+
+ <jaxrs:providers>
+ <ref bean="authorizationFilter" />
+ </jaxrs:providers>
+ <bean id="authorizationFilter"
class="com.bar.providers.AuthorizationContainerRequestFilter">
+ <!-- authorization bean properties -->
+ </bean>
+ </jaxrs:server>
</beans>
</pre>
</div></div><h2
id="JAX-RSFilters-DifferencebetweenJAXRSfiltersandCXFinterceptors">Difference
between JAXRS filters and CXF interceptors</h2><p>JAXRS runtime flow is mainly
implemented by a pair of 'classical' CXF interceptors. JAXRSInInterceptor is
currently at Phase.UNMARSHAL (was at Phase.PRE_STREAM before CXF 2.2.2) phase
while JAXRSOutInterceptor is currently at Phase.MARSHAL phase.</p><p>JAXRS
filters can be thought of as additional handlers. JAXRSInInterceptor deals with
a chain of Pre and Post Match ContainerRequestFilters, just before the
invocation. JAXRSOutInterceptor deals with a chain of ContainerResponseFilters,
just after the invocation but before message body writers get their
chance.</p><p>Sometimes you may want to use CXF interceptors rather than
writing JAXRS filters. For example, suppose you combine JAXWS and JAXRS and you
need to log only inbound or outbound messages. You can reuse the existing CXF
interceptors :</p><div class="code panel pdl" style="border-widt
h: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"><beans>
-<bean id="logInbound"
class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
-<bean id="logOutbound"
class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+ <bean id="logInbound"
class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+ <bean id="logOutbound"
class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
-<jaxrs:server>
- <jaxrs:inInterceptors>
- <ref bean="logInbound"/>
- </jaxrs:inInterceptors>
- <jaxrs:outInterceptors>
- <ref bean="logOutbound"/>
- </jaxrs:outInterceptors>
-</jaxrs:server>
-
-<jaxws:endpoint>
- <jaxws:inInterceptors>
- <ref bean="logInbound"/>
- </jaxws:inInterceptors>
- <jaxws:outInterceptors>
- <ref bean="logOutbound"/>
- </jaxws:outInterceptors>
-</jaxws:endpoint>
+ <jaxrs:server>
+ <jaxrs:inInterceptors>
+ <ref bean="logInbound"/>
+ </jaxrs:inInterceptors>
+ <jaxrs:outInterceptors>
+ <ref bean="logOutbound"/>
+ </jaxrs:outInterceptors>
+ </jaxrs:server>
+
+ <jaxws:endpoint>
+ <jaxws:inInterceptors>
+ <ref bean="logInbound"/>
+ </jaxws:inInterceptors>
+ <jaxws:outInterceptors>
+ <ref bean="logOutbound"/>
+ </jaxws:outInterceptors>
+ </jaxws:endpoint>
</beans>
</pre>
@@ -207,11 +207,11 @@ public class CustomOutInterceptor extend
</div></div><h1 id="JAX-RSFilters-Custominvokers">Custom
invokers</h1><p><strong>Note</strong> This feature is available starting from
CXF 2.2.2</p><p>Using custom JAXR-RS invokers is yet another way to pre or post
process a given invocation. For example, this <a shape="rect"
class="external-link"
href="http://svn.apache.org/repos/asf/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/CustomJAXRSInvoker.java">invoker</a>
does a security check before delegating to the default JAXRS invoker. A custom
invoker, like a request filter, has the access to all the information
accumulated during the processing of a given call, but additionally, it can
also check the actual method parameter values.</p><p>Custom invokers can be
registered like this :</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"><beans>
-<jaxrs:server address="/">
- <jaxrs:invoker>
- <bean class="org.apache.cxf.systest.jaxrs.CustomJAXRSInvoker"/>
- </jaxrs:invoker>
-</jaxrs:server>
+ <jaxrs:server address="/">
+ <jaxrs:invoker>
+ <bean
class="org.apache.cxf.systest.jaxrs.CustomJAXRSInvoker"/>
+ </jaxrs:invoker>
+ </jaxrs:server>
</beans>
</pre>