本文整理汇总了Java中org.springframework.boot.web.servlet.ServletListenerRegistrationBean类的典型用法代码示例。如果您正苦于以下问题:Java ServletListenerRegistrationBean类的具体用法?Java ServletListenerRegistrationBean怎么用?Java ServletListenerRegistrationBean使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServletListenerRegistrationBean类属于org.springframework.boot.web.servlet包,在下文中一共展示了ServletListenerRegistrationBean类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: registeredServletContextListenerBeanIsCalled
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入依赖的package包/类
private void registeredServletContextListenerBeanIsCalled(Class<?> configuration) {
AnnotationConfigEmbeddedWebApplicationContext context = new AnnotationConfigEmbeddedWebApplicationContext(
ServletListenerRegistrationBeanConfiguration.class, configuration);
ServletContextListener servletContextListener = (ServletContextListener) context
.getBean("registration", ServletListenerRegistrationBean.class)
.getListener();
verify(servletContextListener).contextInitialized(any(ServletContextEvent.class));
context.close();
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:EmbeddedServletContainerServletContextListenerTests.java
示例8: 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;
}
示例9: monitoringSessionListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入依赖的package包/类
/**
* Registers the JavaMelody {@link SessionListener}.
* @param servletContext ServletContext
* @return ServletListenerRegistrationBean
*/
@Bean
public ServletListenerRegistrationBean<EventListener> monitoringSessionListener(
ServletContext servletContext) {
final ServletListenerRegistrationBean<EventListener> servletListenerRegistrationBean = new ServletListenerRegistrationBean<EventListener>(
new SessionListener());
if (servletContext.getFilterRegistration("javamelody") != null) {
// if webapp deployed as war in a container with MonitoringFilter and SessionListener already added by web-fragment.xml,
// do not add again
servletListenerRegistrationBean.setEnabled(false);
}
return servletListenerRegistrationBean;
}
示例10: sessionListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入依赖的package包/类
@Bean
public ServletListenerRegistrationBean<HttpSessionListener> sessionListener() {
return new ServletListenerRegistrationBean<HttpSessionListener>(new SessionListener());
}
示例11: httpSessionEventPublisher
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Bean
public static ServletListenerRegistrationBean httpSessionEventPublisher() {
return new ServletListenerRegistrationBean(new HttpSessionEventPublisher());
}
示例12: registration
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入依赖的package包/类
@Bean
public ServletListenerRegistrationBean<ServletContextListener> registration() {
return new ServletListenerRegistrationBean<ServletContextListener>(
mock(ServletContextListener.class));
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:6,代码来源:EmbeddedServletContainerServletContextListenerTests.java
示例13: keycloakSessionDestroyListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入依赖的package包/类
@Bean
ServletListenerRegistrationBean<KeycloakSessionDestroyListener> keycloakSessionDestroyListener() {
return new ServletListenerRegistrationBean<>(new KeycloakSessionDestroyListener());
}
开发者ID:thomasdarimont,项目名称:spring-boot-keycloak-server-example,代码行数:5,代码来源:EmbeddedKeycloakConfig.java
示例14: jsfConfigureListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入依赖的package包/类
@Bean
public ServletListenerRegistrationBean<JsfApplicationObjectConfigureListener> jsfConfigureListener() {
return new ServletListenerRegistrationBean<>(
new JsfApplicationObjectConfigureListener());
}
示例15: jsfConfigureListener
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入依赖的package包/类
@Bean
public ServletListenerRegistrationBean<ConfigureListener> jsfConfigureListener() {
return new ServletListenerRegistrationBean<ConfigureListener>(new ConfigureListener());
}