springSecurity入门小demo

1.添加依赖

 
        
            org.springframework.security
            spring-security-web
            4.1.0.RELEASE
        
        
            org.springframework.security
            spring-security-config
            4.1.0.RELEASE
        

2.配置spring-security.xml文件





	
	
	
	
	
		
		
		
		
		
		
	
	
	
		
			
				
			
		
	

3.在web.xml文件中配置spring-security的过滤器


        contextConfigLocation
        classpath:spring-security.xml
    
    
        
            org.springframework.web.context.ContextLoaderListener
        
    

    
        springSecurityFilterChain
        org.springframework.web.filter.DelegatingFilterProxy
    
    
        springSecurityFilterChain
        /*
    

4.创建配置文件中的相关页面

你可能感兴趣的:(spring-security)