Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In some cases users can use the existing filter technologies such as Servler filters or Spring AOP proxies. In other cases, it can be handy
to write a CXF filter which will introspect the resource class, input or output message, the operation which was invoked and modify the request or response accordingly.

Note that the corresponding interfaces will most likely change in the short term. Here they are anyway, the implementations can be registered like any other types of providers.the interface definitions :

Code Block
java
java
public interface RequestHandler {
    
    Response handleRequest(Message inputMessage, 
                           ClassResourceInfo resourceClass);

}

...

The response handler implementation can optionally overwrite or modify the application Response.
Multiple request and response handlers are supported.

The implementations can be registered like any other types of providers :

Code Block
xml
xml


<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.AuthorizationRequestHandler">
        <!-- authorization bean properties -->
    </bean>
</jaxrs:server>
</beans>

Advanced HTTP

CXF provides a partial support for an advanced content type negotiation by handling If-Match headers and ETags in its JAX-RS Request implementation. Neither If-Modified-Since nor Vary headers are currently supported.

...