本文整理汇总了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);
}
}
示例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);
}
}
示例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));
}
示例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;
}
示例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);
}
示例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, "/*");
}
}
示例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());
}
示例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);
}
示例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()
};
}
示例11: requestContextFilter
import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Bean
public RequestContextFilter requestContextFilter() {
return new RequestContextFilter();
}
示例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();
}
示例14: registrationRequestFilter
import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Bean
public RequestContextFilter registrationRequestFilter() {
RequestContextFilter requestContextFilter = new RequestFilter();
return requestContextFilter;
}
示例15: registrationRequestFilter
import org.springframework.web.filter.RequestContextFilter; //导入依赖的package包/类
@Bean
public RequestContextFilter registrationRequestFilter() {
RequestContextFilter requestContextFilter = new RequestFilter();
return requestContextFilter;
}