当前位置: 首页>>代码示例>>Java>>正文


Java ServletListenerRegistrationBean类代码示例

本文整理汇总了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;
    }
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:14,代码来源:ShiroCasConfiguration.java

示例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;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:14,代码来源:ShiroConfiguration.java

示例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;
}
 
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:9,代码来源:CasWebAppConfiguration.java

示例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;
}
 
开发者ID:cairenjie1985,项目名称:springBoot-demo,代码行数:8,代码来源:SpringBootDemoApplication.java

示例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;
}
 
开发者ID:e-gov,项目名称:TARA-Server,代码行数:9,代码来源:CasWebAppConfiguration.java

示例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;
}
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:12,代码来源:CasConfig.java

示例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;
}
 
开发者ID:JerryXia,项目名称:BizHttpRequestTest,代码行数:13,代码来源:DevHelperAutoConfiguration.java

示例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;
}
 
开发者ID:javamelody,项目名称:javamelody,代码行数:18,代码来源:JavaMelodyAutoConfiguration.java

示例10: sessionListener

import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入依赖的package包/类
@Bean
public ServletListenerRegistrationBean<HttpSessionListener> sessionListener() {
    return new ServletListenerRegistrationBean<HttpSessionListener>(new SessionListener());
}
 
开发者ID:Mahidharmullapudi,项目名称:timesheet-upload,代码行数:5,代码来源:ApplicationSessionConfiguration.java

示例11: httpSessionEventPublisher

import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Bean
public static ServletListenerRegistrationBean httpSessionEventPublisher() {
    return new ServletListenerRegistrationBean(new HttpSessionEventPublisher());
}
 
开发者ID:chaokunyang,项目名称:amanda,代码行数:6,代码来源:SecurityConfiguration.java

示例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());
}
 
开发者ID:UrsZeidler,项目名称:checksumDatabase,代码行数:6,代码来源:Application.java

示例15: jsfConfigureListener

import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; //导入依赖的package包/类
@Bean
public ServletListenerRegistrationBean<ConfigureListener> jsfConfigureListener() {
	return new ServletListenerRegistrationBean<ConfigureListener>(new ConfigureListener());
}
 
开发者ID:SchweizerischeBundesbahnen,项目名称:releasetrain,代码行数:5,代码来源:PrimeBootAdapterConfiguration.java


注:本文中的org.springframework.boot.web.servlet.ServletListenerRegistrationBean类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。