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


Java RequestContextFilter类代码示例

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


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

示例1: BaseApplicaionConfig

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
public BaseApplicaionConfig() {
    //设置默认时区
    System.setProperty("user.timezone", "Asia/Shanghai");

    register(ValidationContextResolver.class);
    property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
    property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);

    this.packages(packages());
    register(ObjectMapperResolver.class);
    register(JacksonFeature.class);
    register(JacksonJsonProvider.class);
    register(new BaseExceptionMapper(createExcetionWrapper()));
    register(RequestContextFilter.class);

    register(DefaultWebFilter.class);

    if (FilterConfig.apiDocEnabled()) {
        register(SwaggerSerializers.class);
    }
}
 
开发者ID:warlock-china,项目名称:azeroth,代码行数:22,代码来源:BaseApplicaionConfig.java

示例2: BaseApplicaionConfig

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
public BaseApplicaionConfig() {
	//设置默认时区
	System.setProperty("user.timezone","Asia/Shanghai");
	
	register(ValidationContextResolver.class);
	property(ServerProperties.BV_SEND_ERROR_IN_RESPONSE, true);
    property(ServerProperties.BV_DISABLE_VALIDATE_ON_EXECUTABLE_OVERRIDE_CHECK, true);
			
	this.packages(packages());
	
	register(ObjectMapperResolver.class);
	register(JacksonFeature.class);
	register(JacksonJsonProvider.class);
	register(new BaseExceptionMapper(createExcetionWrapper()));
	register(RequestContextFilter.class);
	
	register(DefaultWebFilter.class);
	//
	if(FilterConfig.apiDocEnabled()){
		register(SwaggerSerializers.class);
	}
}
 
开发者ID:vakinge,项目名称:jeesuite-libs,代码行数:23,代码来源:BaseApplicaionConfig.java

示例3: onStartup

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
	Map<String, String> filterChainDefinitionMap = Application.getSecurityFilterChainDefinitionMap();
	filterChainDefinitionMap.put("/admin", DefaultFilter.authc.name());
	filterChainDefinitionMap.put("/admin/logout", DefaultFilter.logout.name());
	filterChainDefinitionMap.put("/admin/**", DefaultFilter.authc.name());

	List<Filter> filters = Application.getFilters();

	DelegatingFilterProxy shiroFilter = new DelegatingFilterProxy("shiroFilter");
	shiroFilter.setTargetFilterLifecycle(true);
	filters.add(shiroFilter);

	filters.add(new RequestContextFilter());
	filters.add(new CharacterEncodingFilter("UTF-8", true));
}
 
开发者ID:xiangxik,项目名称:java-platform,代码行数:17,代码来源:CentralizeInitializer.java

示例4: requestContextFilter

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Bean
public FilterRegistrationBean requestContextFilter() {
    final FilterRegistrationBean filterRegBean = new FilterRegistrationBean();
    filterRegBean.setFilter(new RequestContextFilter());
    filterRegBean.addUrlPatterns("*");
    filterRegBean.setEnabled(Boolean.TRUE);
    filterRegBean.setName("RequestContextFilter");
    return filterRegBean;
}
 
开发者ID:expansel,项目名称:errai-spring-boot-sample,代码行数:10,代码来源:Application.java

示例5: ApplicationConfig

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
public ApplicationConfig() {

		System.setProperty("user.timezone", "Asia/Shanghai");
		this.packages(new String[]{this.getClass().getPackage().getName()});
		this.register(ObjectMapperResolver.class);
		this.register(JacksonFeature.class);
		this.register(JacksonJsonProvider.class);
		this.register(BaseExceptionMapper.class);
		this.register(RequestContextFilter.class);
		//this.register(CorsFilter.class);
		register(FormatJsonDynamicFeature.class);

	}
 
开发者ID:vakinge,项目名称:jeesuite-demo,代码行数:14,代码来源:ApplicationConfig.java

示例6: requestContextFilter

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean
public FilterRegistrationBean requestContextFilter() {
	FilterRegistrationBean registration = new FilterRegistrationBean();
	registration.setFilter(new RequestContextFilter());
	registration.setOrder(this.jersey.getFilter().getOrder() - 1);
	registration.setName("requestContextFilter");
	return registration;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:10,代码来源:JerseyAutoConfiguration.java

示例7: initRequestContextFilter

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
/**
 * <p>默认关闭<p>
 * 加载RequestContextFilter 用于将RequestContext存储于当前线程
 * @param servletContext
 */
protected void initRequestContextFilter(ServletContext servletContext){
	String enableRequestContextFilter  = servletContext.getInitParameter("enableRequestContext");
	if(BooleanUtils.valueOf(enableRequestContextFilter)){
		//RequestContextFilter  
		RequestContextFilter requestContextFilter =  new RequestContextFilter();
		
		FilterRegistration filterRegistration =  servletContext.addFilter("requestContextFilter", requestContextFilter);
		
		filterRegistration.addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), false, "/*");
	}
}
 
开发者ID:thinking-github,项目名称:nbone,代码行数:17,代码来源:SpringWebApplicationInitializer.java

示例8: initialize

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@PostConstruct
private void initialize() {
    mvc = MockMvcBuilders.webAppContextSetup(webApplicationContext)
          .addFilter(new RequestContextFilter())
          .addFilter(springSecurityFilterChain)
          .build();

    mockSession = new MockHttpSession(webApplicationContext.getServletContext(), UUID.randomUUID().toString());
}
 
开发者ID:bsblabs,项目名称:cf-sample-service,代码行数:10,代码来源:ApplicationWebSecurityConfigurerAdapterIT.java

示例9: JerseyConfig

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
public JerseyConfig() {
    System.out.println("Initializing JerseyConfig");
    register(RequestContextFilter.class);

    // NOTE: scanning does not appear to work with java jar launcher (as opposed to 'mvn springboot:run' which does) !?
    //       Explicitly register all resources here instead :-(
    register(ActivityResource.class);
    register(AlmanacResource.class);
    register(AuthenticationResource.class);
    register(GenericCommandResource.class);
    register(OrganizationResource.class);
    register(UniqueIdResource.class);
    register(UserResource.class);
    register(LoggingFilter.class);
}
 
开发者ID:dma-graveyard,项目名称:MaritimeCloudPortalTestbed,代码行数:16,代码来源:JerseyConfig.java

示例10: getServletFilters

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Override
protected Filter[] getServletFilters() {
    return new Filter[]{
            new MDCInsertingServletFilter(),
            new HiddenHttpMethodFilter(),
            new OpenEntityManagerInViewFilter(),
            new RequestContextFilter(),
            new SecurityContextPersistenceFilter()
    };
}
 
开发者ID:martinlau,项目名称:unidle-old,代码行数:11,代码来源:DispatcherServletInitializer.java

示例11: requestContextFilter

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Bean
public RequestContextFilter requestContextFilter() {
	return new RequestContextFilter();
}
 
开发者ID:allianzit,项目名称:ait-platform,代码行数:5,代码来源:AitOAuth2ConfigBase.java

示例12: requestContextFilter

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean({ RequestContextListener.class,
		RequestContextFilter.class })
public static RequestContextFilter requestContextFilter() {
	return new OrderedRequestContextFilter();
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:7,代码来源:WebMvcAutoConfiguration.java

示例13: requestContextFilter

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Bean
@ConditionalOnMissingBean({ RequestContextListener.class,
		RequestContextFilter.class })
public RequestContextFilter requestContextFilter() {
	return new OrderedRequestContextFilter();
}
 
开发者ID:philwebb,项目名称:spring-boot-concourse,代码行数:7,代码来源:WebMvcAutoConfiguration.java

示例14: registrationRequestFilter

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Bean
public RequestContextFilter registrationRequestFilter() {
    RequestContextFilter requestContextFilter = new RequestFilter();
    return requestContextFilter;
}
 
开发者ID:sercxtyf,项目名称:onboard,代码行数:6,代码来源:RedisMessageReceiver.java

示例15: registrationRequestFilter

import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Bean
public RequestContextFilter registrationRequestFilter() {

    RequestContextFilter requestContextFilter = new RequestFilter();

    return requestContextFilter;

}
 
开发者ID:sercxtyf,项目名称:onboard,代码行数:9,代码来源:Application.java


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