https状态代码200但响应为空

时间:2016-03-16 12:36:30

标签: spring spring-mvc https

我正在使用带有https的SpringMVC。我有以下AuthenticationIntercepter

public class AuthenticationInterceptor extends HandlerInterceptorAdapter {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        if (!request.getRequestURI().contains("/common")
            && !request.getRequestURI().equals("/login")
            && !request.getRequestURI().equals("/logout")) {
        String token = request.getHeader("Authorization");
            if (hasKey(token)) {
                return true;
            }
            return false;
        }
        return false;
    }
}

XML配置

<mvc:interceptors>
    <mvc:interceptor>
        <mvc:mapping path="/**"/>
        <bean class="XX.AuthenticationInterceptor"/>
    </mvc:interceptor>
</mvc:interceptors>

如果我使用authenticationIntercaptor,https状态代码= 200但响应为null则其他没问题。为什么呢?

0 个答案:

没有答案