问题分析:

在ServletRequest servletRequest中已经存在一个项目名称,此时,又用项目名称访问 http://localhost:8080/rent/pdf/preview rent这个名称已经在Application.yml中设置了,

这时会生成一个缓存在servletRequest中,访问就会有重复的/rent,就会报错

解决方案

清空servletRequest中存在的/rent缓存

  @Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException { HttpServletResponse response = (HttpServletResponse) servletResponse; response.setHeader("Access-Control-Allow-Origin", "*");
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with,Content-Type,XFILENAME,XFILECATEGORY,XFILESIZE"); logger.info("*********************************过滤器被使用**************************");
try {
filterChain.doFilter(servletRequest, servletResponse);
} catch (IllegalStateException e) {
servletRequest.getServletContext().removeAttribute("/rent");
} catch (ServletException e) {
e.printStackTrace();
} }

重点:

catch (IllegalStateException e) {
servletRequest.getServletContext().removeAttribute("/rent");
}

Request processing failed; nested exception is java.lang.IllegalStateException: getOutputStream() has already been called for this response的更多相关文章

  1. HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException

    HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException type ...

  2. HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: Control character in cookie value or attribute.

    HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: ...

  3. Request processing failed; nested exception is java.lang.IllegalArgumentException: No converter found for return value of type: class cn.e3mall.pojo.TbItem

    这个异常是缺少json相关的包 把以下依赖补上就好: <!-- Jackson Json处理工具包 --><dependency> <groupId>com.fas ...

  4. error:org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.NullPointerException

    问题:调用的方法在一个接口类中,但我并没有注入那个被调用的类 解决:在UserEntity前加上@Autowired @Controller public class MainController { ...

  5. 报错:严重: Servlet.service() for servlet [springmvc] in context with path [ ] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause

    解决:service类或dao类需要@Autowired

  6. SSM框架报HTTP Status 500 - Request processing failed; nested exception is java.lang.NullPointerException错

    如下图 一番排查之后发现原来是server层写漏注释了 粗心大意,一天内出现两次写漏注释,SSM框架有意思.

  7. 14- Servlet.service() for servlet [mvc-dispatcher] in context with path [/collegeservice] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root caus

    有的service没有依赖注入:

  8. Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config解决

    出现这个问题往往伴随  HTTP-500错误 报错信息: HTTP Status - Handler processing failed; nested exception is java.lang. ...

  9. org.springframework.web.util.NestedServletException : Handler processing failed; nested exception is java.lang.StackOverflowError

    1 ,错误原因,循环冗余检查      result.setNearUsers(userList);            Page page = new Page();            pag ...

随机推荐

  1. React+ES6+Webpack深入浅出

    React已成为前端当下最热门的前端框架之一 , 其虚拟DOM和组件化开发让前端开发更富灵活性,而Webpack凭借它异步加载和可分离打包等优秀的特性,更为React的开发提供了便利.其优秀的特性不再 ...

  2. ef join查询

    temp = temp.OrderByDescending(s => s.CreateTime).Skip((param.PageIndex - ) * param.PageSize).Take ...

  3. debian系统的另一个包管理器aptitude

    最近在玩OPI的时候遇到了一个包因为各种依赖问题死活装不上.苦搜很久找到这个aptitude包管理器. 基于debain衍生的各种操作系统比较常用包管理器是apt,不过apt在遇到依赖问题的时候处理得 ...

  4. 论文 | YOLO(You Only Look Once)目标检测

    论文:You Only Look Once: Unified, Real-Time Object Detection 原文链接:https://arxiv.org/abs/1506.02640 背景介 ...

  5. bootstrap-treeview初使用

    <div id="tree">div> $(function () { function getTree() { var data = [{ text: &quo ...

  6. spring cloud 学习目录

    1.spring cloud简单示例 2.spring cloud快速入门 3.spring cloud 常用 4.spring cloud 原理 5.spring cloud 源码分析 6.spri ...

  7. html: 仿制soundmanager2右上角面板

    仿制 http://schillmania.com/projects/soundmanager2/#volume 右上角面板 <style type="text/css"&g ...

  8. canal 结合 kafka 入门

    1.kafka的安装: 略 2.cannal  配置 使用卡夫卡: 修改  /home/admin/canal-server/conf/canal.properties 2.1 修改canal.ser ...

  9. __str__ 和 __repr

    #1 默认类里面默认提供的__str__方法,是返回类的内存地址class foo: def __init__(self): pass #2 修改类里面默认提供的__str__方法class fun: ...

  10. npm突然找不到D:\nodejs\node_modules\npm\bin\npm-cli.js的解决方法

    我在安装iView的时候就突然出现这个不正常工作,之后无论用npm进行任何操作,都会出现如下错误 真的是让人很着急啊,看了看环境配置,没问题,然后根据路径找错误,也不知道是哪里出了坑,上百度查,最多建 ...