Browse Source

Merge branch 'dev' of chenweida/patient-co-management into dev

chenweida 7 years ago
parent
commit
2f6cf62d2f

+ 25 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/Application.java

@ -2,7 +2,10 @@ package com.yihu.wlyy;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.boot.context.web.ErrorPageFilter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
/**
@ -15,4 +18,26 @@ public class Application {
    public static void main(String[] args) {
        ctx = SpringApplication.run(Application.class, args);
    }
    /**
     * start 解决如下问题
     * 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
     */
    @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;
    }
    //end
}