本文整理汇总了Java中org.springframework.boot.web.servlet.ServletListenerRegistrationBean.setListener方法的典型用法代码示例。如果您正苦于以下问题:Java ServletListenerRegistrationBean.setListener方法的具体用法?Java ServletListenerRegistrationBean.setListener怎么用?Java ServletListenerRegistrationBean.setListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.boot.web.servlet.ServletListenerRegistrationBean
的用法示例。
在下文中一共展示了ServletListenerRegistrationBean.setListener方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: singleSignOutHttpSessionListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入方法依赖的package包/类
/**
* 注册单点登出listener
* @return
*/
@Bean
public ServletListenerRegistrationBean singleSignOutHttpSessionListener(){
ServletListenerRegistrationBean bean = new ServletListenerRegistrationBean();
bean.setListener(new SingleSignOutHttpSessionListener());
// bean.setName(""); //默认为bean name
bean.setEnabled(true);
//bean.setOrder(Ordered.HIGHEST_PRECEDENCE); //设置优先级
return bean;
}
示例2: singleSignOutHttpSessionListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入方法依赖的package包/类
/**
* 注册单点登出的listener
*
* @return
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
@Bean
public ServletListenerRegistrationBean<?> singleSignOutHttpSessionListener() {
ServletListenerRegistrationBean bean = new ServletListenerRegistrationBean();
bean.setListener(new SingleSignOutHttpSessionListener());
bean.setEnabled(true);
return bean;
}
示例3: log4jServletContextListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletListenerRegistrationBean log4jServletContextListener() {
final ServletListenerRegistrationBean bean = new ServletListenerRegistrationBean();
bean.setEnabled(true);
bean.setName("log4jServletContextListener");
bean.setListener(new Log4jServletContextListener());
return bean;
}
示例4: myListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletListenerRegistrationBean myListener(){
ServletListenerRegistrationBean servletListenerRegistrationBean = new ServletListenerRegistrationBean();
servletListenerRegistrationBean.setListener(new MyListener());
servletListenerRegistrationBean.setName("myListener");
return servletListenerRegistrationBean;
}
示例5: log4jServletContextListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletListenerRegistrationBean log4jServletContextListener() {
ServletListenerRegistrationBean bean = new ServletListenerRegistrationBean();
bean.setEnabled(true);
bean.setName("log4jServletContextListener");
bean.setListener(new Log4jServletContextListener());
return bean;
}
示例6: singleSignOutHttpSessionListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入方法依赖的package包/类
/**
* For single point logout
*/
@Bean
public ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> singleSignOutHttpSessionListener() {
ServletListenerRegistrationBean<SingleSignOutHttpSessionListener> listener = new ServletListenerRegistrationBean<>();
listener.setEnabled(true);
listener.setListener(new SingleSignOutHttpSessionListener());
listener.setOrder(1);
return listener;
}
示例7: bootstrapperContextListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入方法依赖的package包/类
@Bean
public ServletListenerRegistrationBean<BootstrapperContextListener> bootstrapperContextListener() {
String listenerName = "bootstrapperContextListener";
ServletListenerRegistrationBean<BootstrapperContextListener> registrationBean = new ServletListenerRegistrationBean<BootstrapperContextListener>();
BootstrapperContextListener listener = new BootstrapperContextListener();
registrationBean.setListener(listener);
registrationBean.setName(listenerName);
return registrationBean;
}