Java 请求上下文包含较旧的授权令牌
我在异常映射程序中添加了ContainerRequestContextJava 请求上下文包含较旧的授权令牌,java,spring,servlets,jax-rs,exceptionmapper,Java,Spring,Servlets,Jax Rs,Exceptionmapper,我在异常映射程序中添加了ContainerRequestContext @Provider public class MyExeptionhandler implements ExceptionMapper<Throwable>{ @Context ContainerRequestContext reqContext; @Override public Response toResponse(Throwable ex){ if(reqContext!=null){ String
@Provider
public class MyExeptionhandler implements ExceptionMapper<Throwable>{
@Context
ContainerRequestContext reqContext;
@Override
public Response toResponse(Throwable ex){
if(reqContext!=null){
String auth=reqContext.getHeaderString(HttpHeaders.AUTHORIZATION);
...//code
}
.... //code
}
}
@Provider
公共类MyExeptionhandler实现ExceptionMapper{
@上下文
ContainerRequestContext-reqContext;
@凌驾
公众对响应的响应(可丢弃的ex){
if(reqContext!=null){
字符串auth=reqContext.getHeaderString(HttpHeaders.AUTHORIZATION);
…//代码
}
..//代码
}
}
现在关于这个问题,