本文整理匯總了Java中org.springframework.boot.web.servlet.FilterRegistrationBean.setUrlPatterns方法的典型用法代碼示例。如果您正苦於以下問題:Java FilterRegistrationBean.setUrlPatterns方法的具體用法?Java FilterRegistrationBean.setUrlPatterns怎麽用?Java FilterRegistrationBean.setUrlPatterns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.springframework.boot.web.servlet.FilterRegistrationBean
的用法示例。
在下文中一共展示了FilterRegistrationBean.setUrlPatterns方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: responseHeadersSecurityFilter
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@RefreshScope
@Bean
public FilterRegistrationBean responseHeadersSecurityFilter() {
final HttpWebRequestProperties.Header header = casProperties.getHttpWebRequest().getHeader();
final Map<String, String> initParams = new HashMap<>();
initParams.put("enableCacheControl", BooleanUtils.toStringTrueFalse(header.isCache()));
initParams.put("enableXContentTypeOptions", BooleanUtils.toStringTrueFalse(header.isXcontent()));
initParams.put("enableStrictTransportSecurity", BooleanUtils.toStringTrueFalse(header.isHsts()));
initParams.put("enableXFrameOptions", BooleanUtils.toStringTrueFalse(header.isXframe()));
initParams.put("enableXSSProtection", BooleanUtils.toStringTrueFalse(header.isXss()));
final FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new ResponseHeadersEnforcementFilter());
bean.setUrlPatterns(Collections.singleton("/*"));
bean.setInitParameters(initParams);
bean.setName("responseHeadersSecurityFilter");
bean.setAsyncSupported(true);
return bean;
}
示例2: requestParameterSecurityFilter
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@RefreshScope
@Bean
public FilterRegistrationBean requestParameterSecurityFilter() {
final Map<String, String> initParams = new HashMap<>();
initParams.put(RequestParameterPolicyEnforcementFilter.PARAMETERS_TO_CHECK,
casProperties.getHttpWebRequest().getParamsToCheck());
initParams.put(RequestParameterPolicyEnforcementFilter.CHARACTERS_TO_FORBID, "none");
initParams.put(RequestParameterPolicyEnforcementFilter.ALLOW_MULTI_VALUED_PARAMETERS,
BooleanUtils.toStringTrueFalse(casProperties.getHttpWebRequest().isAllowMultiValueParameters()));
initParams.put(RequestParameterPolicyEnforcementFilter.ONLY_POST_PARAMETERS,
casProperties.getHttpWebRequest().getOnlyPostParams());
final FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new RequestParameterPolicyEnforcementFilter());
bean.setUrlPatterns(Collections.singleton("/*"));
bean.setName("requestParameterSecurityFilter");
bean.setInitParameters(initParams);
bean.setAsyncSupported(true);
return bean;
}
示例3: casClientInfoLoggingFilter
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean casClientInfoLoggingFilter() {
final AuditProperties audit = casProperties.getAudit();
final FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new ClientInfoThreadLocalFilter());
bean.setUrlPatterns(Collections.singleton("/*"));
bean.setName("CAS Client Info Logging Filter");
bean.setAsyncSupported(true);
bean.setOrder(Ordered.HIGHEST_PRECEDENCE);
final Map<String, String> initParams = new HashMap<>();
if (StringUtils.isNotBlank(audit.getAlternateClientAddrHeaderName())) {
initParams.put(ClientInfoThreadLocalFilter.CONST_IP_ADDRESS_HEADER, audit.getAlternateClientAddrHeaderName());
}
if (StringUtils.isNotBlank(audit.getAlternateServerAddrHeaderName())) {
initParams.put(ClientInfoThreadLocalFilter.CONST_SERVER_IP_ADDRESS_HEADER, audit.getAlternateServerAddrHeaderName());
}
initParams.put(ClientInfoThreadLocalFilter.CONST_USE_SERVER_HOST_ADDRESS, String.valueOf(audit.isUseServerHostAddress()));
bean.setInitParameters(initParams);
return bean;
}
示例4: casClientInfoLoggingFilter
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean casClientInfoLoggingFilter() {
final FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new ClientInfoThreadLocalFilter());
bean.setUrlPatterns(Collections.singleton("/*"));
bean.setName("CAS Client Info Logging Filter");
bean.setAsyncSupported(true);
return bean;
}
示例5: characterEncodingFilter
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@RefreshScope
@Bean
public FilterRegistrationBean characterEncodingFilter() {
final FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new CharacterEncodingFilter(
casProperties.getHttpWebRequest().getWeb().getEncoding(),
casProperties.getHttpWebRequest().getWeb().isForceEncoding()));
bean.setUrlPatterns(Collections.singleton("/*"));
bean.setName("characterEncodingFilter");
bean.setAsyncSupported(true);
return bean;
}
示例6: currentCredentialsAndAuthenticationClearingFilter
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean currentCredentialsAndAuthenticationClearingFilter() {
final FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new AuthenticationCredentialsLocalBinderClearingFilter());
bean.setUrlPatterns(Collections.singleton("/*"));
bean.setName("currentCredentialsAndAuthenticationClearingFilter");
bean.setAsyncSupported(true);
return bean;
}
示例7: threadContextMDCServletFilter
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean threadContextMDCServletFilter() {
final Map<String, String> initParams = new HashMap<>();
final FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new ThreadContextMDCServletFilter(ticketRegistrySupport, this.ticketGrantingTicketCookieGenerator));
bean.setUrlPatterns(Collections.singleton("/*"));
bean.setInitParameters(initParams);
bean.setName("threadContextMDCServletFilter");
bean.setOrder(Ordered.HIGHEST_PRECEDENCE + 1);
return bean;
}
示例8: jerseyFilterRegistration
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
/**
* Register the Jersey filter
*/
@Bean
public FilterRegistrationBean jerseyFilterRegistration(
javax.ws.rs.core.Application eurekaJerseyApp) {
FilterRegistrationBean bean = new FilterRegistrationBean();
bean.setFilter(new ServletContainer(eurekaJerseyApp));
bean.setOrder(Ordered.LOWEST_PRECEDENCE);
bean.setUrlPatterns(
Collections.singletonList(EurekaConstants.DEFAULT_PREFIX + "/*"));
return bean;
}
示例9: resteasyFilterRegistration
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
@ConditionalOnMissingBean(name = "jerseyFilterRegistration")
@ConditionalOnProperty(prefix = "holon.resteasy", name = "type", havingValue = "filter")
public FilterRegistrationBean resteasyFilterRegistration() {
final Filter filter = new Filter30Dispatcher();
FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setFilter(filter);
registration.setUrlPatterns(Arrays.asList(this.path));
registration.setOrder(this.resteasy.getFilter().getOrder());
registration.setName("resteasyFilter");
registration.setDispatcherTypes(EnumSet.allOf(DispatcherType.class));
return registration;
}
示例10: filterRegistrationBean
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean filterRegistrationBean() {
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setUrlPatterns(Collections.singletonList("/*"));
registrationBean.setFilter(new OpenSessionInViewFilter());
return registrationBean;
}
示例11: sessionRepositoryFilterRegistration
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
@Order(value = 0)
FilterRegistrationBean sessionRepositoryFilterRegistration(
SessionRepositoryFilter filter) {
FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(
new DelegatingFilterProxy(filter));
filterRegistrationBean.setUrlPatterns(Arrays.asList("/*"));
return filterRegistrationBean;
}
示例12: LoginFilter
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
/**
* 用於登錄時攔截
*/
@Bean
public FilterRegistrationBean LoginFilter() {
FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setFilter(loginFilter);
registration.setUrlPatterns(Collections.singletonList("/oauth/token"));
return registration;
}
示例13: xAPIValidationFilterBean
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean xAPIValidationFilterBean() {
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(xAPIRequestValidationFilter);
List<String> urls = new ArrayList<String>(1);
urls.add("/xAPI/*");
registrationBean.setUrlPatterns(urls);
registrationBean.setOrder(3);
return registrationBean;
}
示例14: xAPIHeaderFilterBean
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
public FilterRegistrationBean xAPIHeaderFilterBean() {
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(xAPIHeaderFilter);
List<String> urls = new ArrayList<String>(1);
urls.add("/xAPI/*");
registrationBean.setUrlPatterns(urls);
registrationBean.setOrder(4);
return registrationBean;
}
示例15: filterRegistrationBean2
import org.springframework.boot.web.servlet.FilterRegistrationBean; //導入方法依賴的package包/類
@Bean
@Order(Integer.MIN_VALUE)
public FilterRegistrationBean filterRegistrationBean2() {
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
InitialFilter initialFilter = new InitialFilter();
registrationBean.setFilter(initialFilter);
List<String> urlPatterns = new ArrayList();
urlPatterns.add("/*");
registrationBean.setUrlPatterns(urlPatterns);
return registrationBean;
}