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


Java ServletListenerRegistrationBean.setEnabled方法代码示例

本文整理汇总了Java中org.springframework.boot.web.servlet.ServletListenerRegistrationBean.setEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java ServletListenerRegistrationBean.setEnabled方法的具体用法?Java ServletListenerRegistrationBean.setEnabled怎么用?Java ServletListenerRegistrationBean.setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.boot.web.servlet.ServletListenerRegistrationBean的用法示例。


在下文中一共展示了ServletListenerRegistrationBean.setEnabled方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例5: 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

示例6: 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


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