使用springboot方式配置监听器

//2.配置监听器
    @Bean
    public ServletListenerRegistrationBean<DataInitializeListener> getDataInitializeListenerBean(){
        ServletListenerRegistrationBean<DataInitializeListener> listenerRegistrationBean=new ServletListenerRegistrationBean<>();
        listenerRegistrationBean.setListener(new DataInitializeListener());
        return listenerRegistrationBean;
    }

 

posted @ 2019-07-08 21:05  vietaKo  阅读(782)  评论(0编辑  收藏  举报