SSM框架搭建(配置文件)

pom文件(引入依赖包)

	
		
		
			javax.servlet
			javax.servlet-api
			3.1.0
			provided
		
		
		
			org.springframework
			spring-context
			4.3.13.RELEASE
		
		
		
			org.springframework
			spring-web
			4.3.13.RELEASE
		
		
		
			org.springframework
			spring-webmvc
			4.3.13.RELEASE
		
		
		
			org.mybatis
			mybatis
			3.4.5
		
		
		
			org.mybatis
			mybatis-spring
			1.3.2
		
		
		
			com.alibaba
			druid
			1.1.10
		
		
			org.springframework
			spring-jdbc
			4.3.13.RELEASE
		
		
		
			mysql
			mysql-connector-java
			5.1.35
		
		
		
			com.google.code.gson
			gson
			2.8.1
		
		
		
			javax.servlet
			jstl
			1.2
		
		
		
			org.aspectj
			aspectjweaver
			1.8.13
		
		
		
			commons-fileupload
			commons-fileupload
			1.3.2
		
		
			commons-io
			commons-io
			2.5
		
		
		   
            org.apache.shiro
            shiro-core
            1.3.2
        
			 
            org.apache.shiro
            shiro-spring
             1.3.2
        
        
            org.apache.shiro
            shiro-web
             1.3.2
         
		
		
			junit
			junit
			4.12
			test
		
		
		
			org.slf4j
			slf4j-api
			1.7.22
		
		
			org.slf4j
			slf4j-log4j12
			1.7.22
		
		
			log4j
			log4j
			1.2.17
		
		
			jstl
			jstl
			1.2
		
	
	
		JiuDingHaoPai
	

web.xml文件

	
	
		contextConfigLocation
		
		classpath:spring.xml,classpath:shiro.xml
	
	
	
	
		org.springframework.web.context.ContextLoaderListener
	

	
	
		SpringMVC
		org.springframework.web.servlet.DispatcherServlet
		
			contextConfigLocation
			
		
		1
	

	
		SpringMVC
		*.do
	

	
	
		SimpleCORSFilter
		qiangduanyang.controller.other.SimpleCORSFilter
	
	
		SimpleCORSFilter
		/*
	

	
	
		字符集过滤器
		encodingFilter
		org.springframework.web.filter.CharacterEncodingFilter
		
			字符集编码
			encoding
			UTF-8
		
	
	
		encodingFilter
		/*
	

	
	
		shiroFilter
		org.springframework.web.filter.DelegatingFilterProxy
		
			targetFilterLifecycle
			true
		
	
	
	
	
	
		shiroFilter
		/*
	
	
	
	
        120
    
	
	
	
		login.html
	

	
	
		org.apache.shiro.authz.UnauthorizedException
		/unauthorized.jsp
	

spring.xml

	
	
		
		
	
	
	
	
	
	
		
	

	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
		
		
		
			
		
	
	
	
		
		
		
		
		
	
	
	
	
		
	
	
	
	
		
	
		
	
	

另一种数据源:druid

  1. 数据库配置文件
driver=com.mysql.jdbc.Driver
url=jdbc:mysql://localhost:3306/sys_exam?useUnicode=true&characterEncoding=UTF8&rewriteBatchedStatements=true
user=root
password=123
  1. 数据源配置
	

	
		
		
		
		
		

		
		

		
		
		
		

		
		

		
		

		
		

		
		
		

		
		
		
	

mybatis.xml




	
	
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		

	


shiro.xml




	
	
		
		
			
				# some example chain definitions:
				
				/**=anon
				
			
		
	

	
	
		
	
	
	
	

	
	

	

generatorConfig.xml




	
	
	
		
			
			
			
		
       
		
		
		
		
		
		
		

		

mapper.xml




  
    
    
    
    
    
    
    
   		
    	
    
    
   		
    	
    
  

MyRealm

public class MyRealm extends AuthorizingRealm {
}

你可能感兴趣的:(MyNote)