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

 今天遇到这个一个错误: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”; ' 才对,一定要注意了。。。
 

你可能感兴趣的:(javaweb)