Spring Boot 配置web.xml的listener

Spring Boot 配置listener

要将


  
   org.jasig.cas.client.session.SingleSignOutHttpSessionListener
 

更改为Spring-Boot的配置方式具体代码如下:

import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.annotation.Configuration;

import javax.servlet.FilterRegistration;
import javax.servlet.ServletContext;

@Configuration
public class MyWebApplicationInitializer implements ServletContextInitializer {

    @Override
    public void onStartup(ServletContext sc) {
       sc.addListener(new SingleSignOutHttpSessionListener());
    }
}

转载于:https://www.cnblogs.com/alcc/p/9201904.html

你可能感兴趣的:(Spring Boot 配置web.xml的listener)