• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AntPathRequestMatcher类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: filterChain

import org.springframework.security.web.util.AntPathRequestMatcher; //导入依赖的package包/类
private List<SecurityFilterChain> filterChain() {
List<SecurityFilterChain> filters = new ArrayList<SecurityFilterChain>(12);
       RequestMatcher req = new AntPathRequestMatcher("/**");
       
       filters.add(new DefaultSecurityFilterChain(req, new SecurityContextPersistenceFilter(), 
               logoutFilter(),cojAuthenticationProcessingFilter(),new SecurityContextHolderAwareRequestFilter(),
               rememberMeAuthenticationFilter(),anonymousAuthenticationFilter(),exceptionTranslationFilter(),filterInvocationInterceptor()
               ));
return filters;
   }
 
开发者ID:dovier,项目名称:coj-web,代码行数:11,代码来源:SecurityConfiguration.java


示例2: handleRequest

import org.springframework.security.web.util.AntPathRequestMatcher; //导入依赖的package包/类
@Override
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    Map<String, String> urlPatternDispatchMap = (Map<String, String>) getApplicationContext().getBean("blResourceUrlPatternRequestDispatchMap");
    for (Map.Entry<String, String> entry : urlPatternDispatchMap.entrySet()) {
        RequestMatcher matcher = new AntPathRequestMatcher(entry.getKey());
        if (matcher.matches(request)){
            request.getRequestDispatcher(entry.getValue()).forward(request, response);
            return;
        }
    }
    super.handleRequest(request, response);
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:13,代码来源:BroadleafGWTModuleURLMappingResourceHttpRequestHandler.java


示例3: doFilter

import org.springframework.security.web.util.AntPathRequestMatcher; //导入依赖的package包/类
@Override
public void doFilter(ServletRequest baseRequest, ServletResponse baseResponse, FilterChain chain) throws IOException, ServletException {
    HttpServletRequest request = (HttpServletRequest) baseRequest;
    HttpServletResponse response = (HttpServletResponse) baseResponse;

    boolean excludedRequestFound = false;
    if (excludedRequestPatterns != null && excludedRequestPatterns.size() > 0) {
        for (String pattern : excludedRequestPatterns) {
            RequestMatcher matcher = new AntPathRequestMatcher(pattern);
            if (matcher.matches(request)){
                excludedRequestFound = true;
                break;
            }
        }
    }

    // We only validate CSRF tokens on POST
    if (request.getMethod().equals("POST") && !excludedRequestFound) {
        String requestToken = request.getParameter(exploitProtectionService.getCsrfTokenParameter());
        try {
            exploitProtectionService.compareToken(requestToken);
        } catch (ServiceException e) {
            throw new ServletException(e);
        }
    }
    
    chain.doFilter(request, response);
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:29,代码来源:CsrfFilter.java


示例4: requestRequiresLock

import org.springframework.security.web.util.AntPathRequestMatcher; //导入依赖的package包/类
/**
 * By default, all POST requests that are not matched by the {@link #getExcludedOrderLockRequestPatterns()} list
 * (using the {@link AntPathRequestMatcher}) will be marked as requiring a lock on the Order.
 * 
 * @param req
 * @return whether or not the current request requires a lock on the order
 */
protected boolean requestRequiresLock(ServletRequest req) {
    if (!(req instanceof HttpServletRequest)) {
           return false;
    }
    
    if (!orderLockManager.isActive()) {
        return false;
    }

    HttpServletRequest request = (HttpServletRequest) req;

    if (!request.getMethod().equalsIgnoreCase("post")) {
        return false;
    }
    
    if (excludedOrderLockRequestPatterns != null && excludedOrderLockRequestPatterns.size() > 0) {
        for (String pattern : excludedOrderLockRequestPatterns) {
            RequestMatcher matcher = new AntPathRequestMatcher(pattern);
            if (matcher.matches(request)){
                return false;
            }
        }
    }

    return true;
}
 
开发者ID:passion1014,项目名称:metaworks_framework,代码行数:34,代码来源:CartStateFilter.java


示例5: buildRequestMap

import org.springframework.security.web.util.AntPathRequestMatcher; //导入依赖的package包/类
/**
 * Builds the request map.
 * <p>return LinkedHashMap&lt; {@link RequestMatcher}, Collection&lt; {@link ConfigAttribute}&gt;&gt </p>
 * 
 * @return requestMap order-preserving map of request definitions to attribute lists
 */
protected LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> buildRequestMap() {
	 LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>();

	Map<String, String> resourceMap = findResources();

	for (Map.Entry<String, String> entry : resourceMap.entrySet()) {
		RequestMatcher key =new AntPathRequestMatcher(entry.getKey());
		requestMap.put(key, SecurityConfig.createListFromCommaDelimitedString(entry.getValue()));
	}

	return requestMap;
}
 
开发者ID:rockagen,项目名称:gnext,代码行数:19,代码来源:JdbcFilterInvocationSecurityMetadataSourceFactoryBean.java


示例6: getAppropriateEntryPoint

import org.springframework.security.web.util.AntPathRequestMatcher; //导入依赖的package包/类
private AuthenticationEntryPoint getAppropriateEntryPoint(HttpServletRequest request) {
    for (String pattern : m_patterns) {
        RequestMatcher matcher = new AntPathRequestMatcher(pattern);
        if (matcher.matches(request)) {
            return m_matchingEntryPoint;
        }
    }
    
    return m_nonMatchingEntryPoint;
    
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:12,代码来源:AntPatternBasedAuthenticationEntryPointChain.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Items类代码示例发布时间:2022-05-23
下一篇:
Java QueryResult类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap