package mingzuozhibi.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.orm.hibernate5.support.OpenSessionInViewFilter;
import org.springframework.orm.jpa.vendor.HibernateJpaSessionFactoryBean;

import java.util.Collections;

@Configuration
public class ServletConfig {

    @Bean
    FilterRegistrationBean filterRegistrationBean() {
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setUrlPatterns(Collections.singletonList("/*"));
        registrationBean.setFilter(new OpenSessionInViewFilter());
        return registrationBean;
    }

    @Bean
    public HibernateJpaSessionFactoryBean sessionFactory() {
        return new HibernateJpaSessionFactoryBean();
    }

}

@@ -440,24 +440,31 @@
   @Bean%0A    
+public 
 FilterRegist

add public to method