1

在 RestEasy 3.0.16.Final 版本中 PreProcessInterceptor 接口已被弃用。那么这个接口的正确替换是什么。在 jboss eap 7 RestEasy 版本 3.0.16.Final 中使用。

旧代码 -

@Provider
@ServerInterceptor
@SecurityPrecedence
public class AbcInterceptor implements PreProcessInterceptor
{
 public ServerResponse preProcess(final HttpRequest httpRequest, ResourceMethod resourceMethod) throws Failure,
        WebApplicationException {
    // auth logic

}
}

新代码 -

@Provider
@ServerInterceptor
@SecurityPrecedence
public class AuthenticationInterceptor
{
 public ServerResponse preProcess(HttpRequest httpRequest, ResourceMethodInvoker method)
        throws Failure, WebApplicationException {
   // auth logic

}
}
4

1 回答 1

2

org.jboss.resteasy.spi.interception.PreProcessInterceptor接口被RESTEasy 3.x 中的 javax.ws.rs.container.ContainerRequestFilter 接口取代

因此,您可以使用 ContainerRequestFilter 进行相同的操作。

于 2017-05-11T01:50:18.160 回答