2013-10-22 19 views
2

我正在使用Apache CXF创建一个RESTful Web服务。 我想对使用@Authenticate注释的资源进行身份验证。为此,我打算编写一个匹配ContainerRequestFilter的帖子并验证请求,如果验证失败,请执行ContainerRequestContext.abortWith(javax.ws.rs.core.Response)。不过,我只想对使用@Authenticate进行注释的资源进行身份验证。如何从Apache CXF中的ContainerRequestFilter获取目标资源

问题是我找不到如何访问匹配的资源。我知道我可以使用CXF拦截器来做到这一点,但我想坚持使用JAX-RS 2.0提供的功能。 我在另一篇文章,你可以用下面的休息,容易

ResourceMethodInvoker methodInvoker = (ResourceMethodInvoker) 
      requestContext.getProperty("org.jboss.resteasy.core.ResourceMethodInvoker"); 
Method method = methodInvoker.getMethod(); 

可以类似的方法在CXF进行看见?

感谢

回答

相关问题