springboot 遇到的一个问题和解决

本文记录了在Spring Boot项目中遇到的一个问题:当尝试转发到错误页面时,由于响应已提交导致状态码可能错误。问题根源在于Maven资源配置的过滤设置,通过调整资源文件的过滤选项成功解决了该问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天调试的时候遇到这样一个问题:

 

2019-01-12 17:21:36.735 [http-bio-8061-exec-10] ERROR o.springframework.boot.web.support.ErrorPageFilter - Cannot forward to error page for request [/indexOne] as the response has already been committed. As a result, the response may have the wrong status code. If your application is running on WebSphere Application Server you may be able to resolve this problem by setting com.ibm.ws.webcontainer.invokeFlushAfterService to false

昨天代码还好好的,今天就出问题了,真奇怪,查了好久,最后发现是 pom设置昨晚改了,今天没有留意,

<resource>
   <directory>src/main/resources</directory>
   <!--<includes>
      <include>**/*.properties</include>
      <include>**/*.xml</include>
   </includes>-->
   <!--<filtering>false</filtering>-->
</resource>

把这里的注释打开,就出现上面的错误,把这段代码去掉,就解决了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值