Springbootで出会ったこと

1481 ワード

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が見つかりません!!!経路が間違っているだけだ...