关于Cannot forward to error page for request [/strategy/list/] 。。。的问题

本文介绍了两种常见的网页响应提交问题及解决办法。一种是由于拦截器未正确配置导致的请求失败,通过调整拦截器的路径排除规则来解决;另一种是由于URL地址不正确导致的问题,需要确保视图返回的路径准确无误。

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

 今天遇到这个一个错误:Cannot forward to error page for request [/wechat/wechatCheck/forgetPsd] 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

1.找了很久,网上说是url地址不对的问题,仔细核对了多次,发现并没有错,于是我把这个请求放到了其他的controller中,跳转成功了,原来我接手的这个项目有一个拦截器,控制器没有在拦截器注册的话,就会被拦截掉。

/**
	 * 配置拦截器
	 * 
	 * @author lance
	 * @param registry
	 */
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(createTokenSecurityInterceptor())
		.addPathPatterns("/**").excludePathPatterns("/lsj/login*")
		.excludePathPatterns("/Login/login*")
		.excludePathPatterns("/loginController/login*")
		.excludePathPatterns("/loginController/staleToken/*")
		.excludePathPatterns("/Webcam/save")
		.excludePathPatterns("/Utils/uploadFile")
		.excludePathPatterns("/SignIn/addLoginRec*")
	    .excludePathPatterns("/MPublish/*")
	    .excludePathPatterns("/MhNrgl/*")
	    .excludePathPatterns("/MhLmgl/*")
	    .excludePathPatterns("/portal/index/*")
	    .excludePathPatterns("/param/*")
	    .excludePathPatterns("/serverStand/*")
	    .excludePathPatterns("/MhSylb/*")
	    .excludePathPatterns("/program/*")
	    .excludePathPatterns("/wechat/wechatCode/**")
	    .excludePathPatterns("/wechat/wechatServe/**")
	    .excludePathPatterns("/wechat/wechatCheck/**")
		.excludePathPatterns("/wechat/wechatQuery/**");
				
	}

添加进去就ok了。

2.第二种就是url地址不对的问题了,可能返回视图的时候路径写得不对,例如: return “login”;,应该写成' return "/login”; ' 才对,一定要注意了。。。
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值