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


Java DelegatingFilterProxy.setContextAttribute方法代码示例

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


在下文中一共展示了DelegatingFilterProxy.setContextAttribute方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerRestApiServlet

import org.springframework.web.filter.DelegatingFilterProxy; //导入方法依赖的package包/类
protected void registerRestApiServlet(ServletContext servletContext) {
    CubaRestApiServlet cubaRestApiServlet = new SingleAppRestApiServlet(dependencyJars);
    try {
        cubaRestApiServlet.init(new CubaServletConfig("rest_api", servletContext));
    } catch (ServletException e) {
        throw new RuntimeException("An error occurred while initializing dispatcher servlet", e);
    }
    ServletRegistration.Dynamic cubaRestApiServletReg = servletContext.addServlet("rest_api", cubaRestApiServlet);
    cubaRestApiServletReg.setLoadOnStartup(2);
    cubaRestApiServletReg.addMapping("/rest/*");

    DelegatingFilterProxy restSpringSecurityFilterChain = new DelegatingFilterProxy();
    restSpringSecurityFilterChain.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.rest_api");
    restSpringSecurityFilterChain.setTargetBeanName("springSecurityFilterChain");

    FilterRegistration.Dynamic restSpringSecurityFilterChainReg =
            servletContext.addFilter("restSpringSecurityFilterChain", restSpringSecurityFilterChain);
    restSpringSecurityFilterChainReg.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/rest/*");
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:20,代码来源:SingleAppWebContextLoader.java

示例2: registerIdpServlet

import org.springframework.web.filter.DelegatingFilterProxy; //导入方法依赖的package包/类
protected void registerIdpServlet(ServletContext servletContext) {
    String serviceProvidersUrls = AppContext.getProperty(IDP_SERVICE_PROVIDERS_URLS);
    if (StringUtils.isEmpty(serviceProvidersUrls)) {
        log.debug("No service providers were found. IDP Servlet will not be started");
        return;
    }

    CubaIdpServlet idpServlet = new SingleAppIdpServlet(dependencyJars);
    try {
        idpServlet.init(new CubaServletConfig("idp", servletContext));
    } catch (ServletException e) {
        throw new RuntimeException("An error occurred while initializing idp servlet", e);
    }

    ServletRegistration.Dynamic idpServletRegistration = servletContext.addServlet("idp", idpServlet);
    idpServletRegistration.setLoadOnStartup(4);
    idpServletRegistration.addMapping("/idp/*");

    DelegatingFilterProxy idpSpringSecurityFilterChain = new DelegatingFilterProxy();
    idpSpringSecurityFilterChain.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.idp");
    idpSpringSecurityFilterChain.setTargetBeanName("springSecurityFilterChain");

    FilterRegistration.Dynamic idpSpringSecurityFilterChainReg =
            servletContext.addFilter("idpSpringSecurityFilterChain", idpSpringSecurityFilterChain);

    idpSpringSecurityFilterChainReg.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), true, "/idp/*");
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:28,代码来源:SingleAppWebContextLoader.java

示例3: getServletFilters

import org.springframework.web.filter.DelegatingFilterProxy; //导入方法依赖的package包/类
@Override
protected Filter[] getServletFilters() {
    DelegatingFilterProxy filter = new DelegatingFilterProxy("securitySwitchFilter");
    filter.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher");
    filter.setTargetFilterLifecycle(true);
    return new Filter[] { filter, new DelegatingFilterProxy("dawgCorsFilter"), new DelegatingFilterProxy("logFilter") };
}
 
开发者ID:Comcast,项目名称:dawg,代码行数:8,代码来源:ServletInitializer.java

示例4: getServletFilters

import org.springframework.web.filter.DelegatingFilterProxy; //导入方法依赖的package包/类
@Override
protected Filter[] getServletFilters() {
    DelegatingFilterProxy filter = new DelegatingFilterProxy("securitySwitchFilter");
    filter.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher");
    filter.setTargetFilterLifecycle(true);
    return new Filter[] { filter, new DelegatingFilterProxy("dawgCorsFilter"), new DelegatingFilterProxy("logFilter")};
}
 
开发者ID:Comcast,项目名称:dawg,代码行数:8,代码来源:ServletInitializer.java

示例5: init

import org.springframework.web.filter.DelegatingFilterProxy; //导入方法依赖的package包/类
/**
 * Initialize the wrapped security filter here
 * @param filterConfig the configuration of filters
 */
@Override
public void init(FilterConfig filterConfig) throws ServletException {
    securityFilter = new DelegatingFilterProxy("springSecurityFilterChain");
    securityFilter.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher");
    securityFilter.init(filterConfig);
}
 
开发者ID:Comcast,项目名称:dawg,代码行数:11,代码来源:SecuritySwitchFilter.java

示例6: getServletFilters

import org.springframework.web.filter.DelegatingFilterProxy; //导入方法依赖的package包/类
@Override
protected Filter[] getServletFilters() {
    DelegatingFilterProxy filter = new DelegatingFilterProxy("securitySwitchFilter");
    filter.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher");
    filter.setTargetFilterLifecycle(true);
    return new Filter[] { filter, new DelegatingFilterProxy("logFilter") };
}
 
开发者ID:Comcast,项目名称:dawg,代码行数:8,代码来源:ServletInitializer.java

示例7: onStartup

import org.springframework.web.filter.DelegatingFilterProxy; //导入方法依赖的package包/类
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
	super.onStartup(servletContext);
	DelegatingFilterProxy filter = new DelegatingFilterProxy("springSecurityFilterChain");
	filter.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher");
	servletContext.addFilter("springSecurityFilterChain", filter).addMappingForUrlPatterns(null, false, "/*");
}
 
开发者ID:ishaigor,项目名称:rest-retro-sample,代码行数:8,代码来源:SecureWebAppInitializer.java

示例8: insertSessionRepositoryFilter

import org.springframework.web.filter.DelegatingFilterProxy; //导入方法依赖的package包/类
/**
 * Registers the springSessionRepositoryFilter.
 * @param servletContext the {@link ServletContext}
 */
private void insertSessionRepositoryFilter(ServletContext servletContext) {
	String filterName = DEFAULT_FILTER_NAME;
	DelegatingFilterProxy springSessionRepositoryFilter = new DelegatingFilterProxy(
			filterName);
	String contextAttribute = getWebApplicationContextAttribute();
	if (contextAttribute != null) {
		springSessionRepositoryFilter.setContextAttribute(contextAttribute);
	}
	registerFilter(servletContext, true, filterName, springSessionRepositoryFilter);
}
 
开发者ID:spring-projects,项目名称:spring-session,代码行数:15,代码来源:AbstractHttpSessionApplicationInitializer.java

示例9: registerProxyFilter

import org.springframework.web.filter.DelegatingFilterProxy; //导入方法依赖的package包/类
private void registerProxyFilter(ServletContext servletContext, String name) {
	DelegatingFilterProxy filter = new DelegatingFilterProxy(name);
	filter.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher");
	servletContext.addFilter(name, filter).addMappingForUrlPatterns(null, false, "/*");
}
 
开发者ID:ishaigor,项目名称:rest-retro-sample,代码行数:6,代码来源:ClientSecureWebAppInitializer.java

示例10: registerProxyFilter

import org.springframework.web.filter.DelegatingFilterProxy; //导入方法依赖的package包/类
private void registerProxyFilter(ServletContext servletContext, String name) {
  DelegatingFilterProxy filter = new DelegatingFilterProxy(name);
  filter.setContextAttribute("org.springframework.web.servlet.FrameworkServlet.CONTEXT.dispatcher");
  servletContext.addFilter(name, filter).addMappingForUrlPatterns(null, false, "/*");
}
 
开发者ID:KaiHofstetter,项目名称:foosball-booking-client,代码行数:6,代码来源:ServletInitializer.java


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