When to use RequestContextFilter with Jersey?

时间:2016-02-12 20:24:37

标签: java servlets spring-boot jersey jersey-2.0

In a bunch of the tutorials and code samples of Spring Boot and Jersey that I've seen, the following line appears:

15:17:13,415 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 33) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "datasources"),
    ("jdbc-driver" => "oraclethin")
]) - failure description: "WFLYJCA0041: Failed to load module for driver [com.oracle.ojdbc6]"

What is this really used for? I don't see anything unusual in those samples, and if I remove it from my (simple) application, nothing seems to break.

register(RequestContextFilter.class) 's javadoc says

This filter is mainly for use with third-party servlets, e.g. the JSF FacesServlet. Within Spring's own web support, DispatcherServlet's processing is perfectly sufficient.

I haven't seen third party servlets in those examples.

In one of them I read

org.glassfish.jersey.server.spring.scope.RequestContextFilter, which is a Spring filter that provides a bridge between JAX-RS and Spring request attributes

What would be an example of a Spring request attribute? What is some typical use case, besides needing a third party servlet?

0 个答案:

没有答案