Spring Security实战源码


该资源是基本Spring Security实战七篇文档中组织的源码,详情如下: ssecurity项目是Spring Security实战(一和二)的源码; ssecurity-db项目是Spring Security实战(三)的源码; ssceurity-page项目是Spring Security实战(四)的源码; ssecurity-pageClass项目是Spring Security实战(五)的源码; ssecurity-customFilter项目是Spring Security实战(六)的源码; ssecurity-rememberMe项目是Spring Security实战(七)的源码; 本人开发工具是IDEA,每个项目中的代码均可以运行并测试。Eclipse也是一样可以运行的。
资源截图
代码片段和文件信息
package cn.quan.ssm.sec;

/*import org.springframework.security.web.util.matcher.RequestMatcher;

import java.util.List;
import java.util.regex.Pattern;*/

/**
 * @auther zhangsq on 2017-9-5.
 */

/*
public class CsrfSecurityRequestMatcher implements RequestMatcher {

    private Pattern allowedMethods = Pattern.compile(“^(GET|HEAD|TRACE|OPTIONS)$“);

    public boolean matches(javax.servlet.http.HttpServletRequest request) {
        if(execludeUrls != null && execludeUrls.size() > 0){
            String servletPath = request.getServletPath();
            for(String url : execludeUrls){
                if(servletPath.contains(url)){
                    return false;
                }
            }
        }
        return !allowedMethods.matcher(request.getMethod()).matches();
    }

    */
/**
     * 需要排除的url列表
     *//*

    private List execludeUrls;

    public List getExecludeUrls() {
        return execludeUrls;
    }

    public void setExecludeUrls(List execludeUrls) {
        this.execludeUrls = execludeUrls;
    }
}
*/

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)