springboot 遇到的一些事

springboot 搭建 web 框架很是方便,但是搭建的过程中会遇到很多问题.过程中我遇到了这样一个问题 如下:

错误如下

2017-01-06 18:28:23.933 ERROR 80102 --- [nio-8088-exec-6] 
o.s.boot.web.support.ErrorPageFilter     : Cannot forward to error page for 
request [/strategy/list/] 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

遇到这个错误纠结了很久.. 显示设置了com.ibm.ws.webcontainer.invokeFlushAfterServicefalse, 如下

public MainApplication(){    
      super();   
    setRegisterErrorPageFilter(false);
}

或者

@Bean    
 public ErrorPageFilter errorPageFilter() {   
      return new ErrorPageFilter();   
 }    
@Bean
public FilterRegistrationBean disableSpringBootErrorFilter(ErrorPageFilter filter) {        
      FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();           
      filterRegistrationBean.setFilter(filter);      
      filterRegistrationBean.setEnabled(false);      
      return filterRegistrationBean;  
}

虽然没有错误了但是又遇到了404 错误.

这样的错误,好比当年用 servlet 的时候,说什么 response 已经使用,而再次使用,或者路径已经转发,你却在转发之后用 response 等等这样的问题,,在 springboot 中,我也以为是这样的问题,,,其实答案很简单 就是找不到这个 url!!!! 路径写错了而已 ...

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,168评论 19 139
  • 1. Java基础部分 基础部分的顺序:基本语法,类相关的语法,内部类的语法,继承相关的语法,异常的语法,线程的语...
    子非鱼_t_阅读 31,806评论 18 399
  • 一. Java基础部分.................................................
    wy_sure阅读 3,854评论 0 11
  • 1、 我盯上王小聪已经29天了。 这个一年级的小学生,是和平路小学低年级里唯一放学没有家长接的孩子。 我爹交待的任...
    夜二郎阅读 8,080评论 196 261
  • 我们又吵架了 因为一点小事 我生气你对我的态度还有沉默不语的无奈 那一刻我很绝望 以至于开始怀疑我们之间的...
    疯狂的矿泉水瓶子阅读 514评论 0 0