Cannot call sendError() after the response has been committed(filter问题) 就是因为执行了filter的dofilter方法中 chain.doFilter(request,response)了 执行了两遍 if(){}else{chain.doFilter(request,response);}即可