Java maven搭建SSM框架主要配置文件

web.xml配置



    
    
        contextConfigLocation
        
            classpath:applicationContext.xml
        
    
    
    
        org.springframework.web.context.ContextLoaderListener
    
    

    
    
        encodingFilter
        org.springframework.web.filter.CharacterEncodingFilter
        
            encoding
            UTF-8
        
        
            forceEncoding
            true
        
    
    
        encodingFilter
        /*
    

    
    
        log4jConfigLocation
        classpath:log4j.properties
    
    
    
        log4jRefreshInterval
        60000
    

    
    
        org.springframework.web.util.Log4jConfigListener
    

    
    
        dispatcher
        org.springframework.web.servlet.DispatcherServlet
        
            contextConfigLocation
            classpath*:spring-mvc.xml
        
        1
    
    
        dispatcher
        
        *.do
    

    
    
        index
    



spring-mvc.xml




    
    
    
	
    
        
            
                text/plain;charset=UTF-8
                application/json;charset=UTF-8
            
        
    
    

    
    
        
            
                
            
        
    

    
    

    
    
        
        
        
    



applicationContext.xml




    
    

    
	  
		  
			  
                 /WEB-INF/classes/jdbc.properties
              
          
	
	
	
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
	

    
    

    
    

    
    

    
    
        
            
            
            
            
            
            
            
            
            
        
    

    
    
        
        
    

    
    
	

mybatis-config.xml





    
        
    



jdbc.properties

##\u5168\u5C40\u8BBE\u7F6EJDBC Global Setting
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/project?useUnicode=true&characterEncoding=utf-8
jdbc.username=root
jdbc.password=

#\u914D\u7F6E\u521D\u59CB\u5316\u5927\u5C0F\u3001\u6700\u5C0F\u3001\u6700\u5927
ds.initialSize=1
ds.minIdle=1
ds.maxIdle=1000
ds.maxActive=20
#\u914D\u7F6E\u83B7\u53D6\u8FDE\u63A5\u7B49\u5F85\u8D85\u65F6\u7684\u65F6\u95F4
ds.maxWait=60000
#\u914D\u7F6E\u95F4\u9694\u591A\u4E45\u624D\u8FDB\u884C\u4E00\u6B21\u68C0\u6D4B\uFF0C\u68C0\u6D4B\u9700\u8981\u5173\u95ED\u7684\u7A7A\u95F2\u8FDE\u63A5\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
ds.timeBetweenEvictionRunsMillis=60000
#\u914D\u7F6E\u4E00\u4E2A\u8FDE\u63A5\u5728\u6C60\u4E2D\u6700\u5C0F\u751F\u5B58\u7684\u65F6\u95F4\uFF0C\u5355\u4F4D\u662F\u6BEB\u79D2
ds.minEvictableIdleTimeMillis=300000

log4j.properties

# DEBUG,INFO,WARN,ERROR,FATAL
LOG_LEVEL=DEBUG
log4j.rootLogger=${LOG_LEVEL},CONSOLE,FILE
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Encoding=UTF-8
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
#log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH:mm:ss} %C{8}@(%F:%L):%m%n 
log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH:mm:ss} %C{1}@(%F:%L):%m%n

log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.FILE.File=${catalina.base}/logs/project.log
log4j.appender.FILE.Encoding=UTF-8
log4j.appender.FILE.DatePattern='.'yyyy-MM-dd
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
#log4j.appender.FILE.layout=org.apache.log4j.HTMLLayout
log4j.appender.FILE.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH\:mm\:ss} %C{8}@(%F\:%L)\:%m%n 

pom.xml


  4.0.0
  com
  project
  war
  0.0.1-SNAPSHOT
  project Maven Webapp
  http://maven.apache.org
  
		
		UTF-8
		zh_CN
		1.7
		
		4.0.2.RELEASE
		
		3.2.6
		
		1.7.7
		1.2.17
	
	
		
			junit
			junit
			4.11
			
			test
		
		
		
			org.springframework
			spring-core
			${spring.version}
		

		
			org.springframework
			spring-web
			${spring.version}
		
		
			org.springframework
			spring-oxm
			${spring.version}
		
		
			org.springframework
			spring-tx
			${spring.version}
		

		
			org.springframework
			spring-jdbc
			${spring.version}
		

		
			org.springframework
			spring-webmvc
			${spring.version}
		
		
			org.springframework
			spring-aop
			${spring.version}
		

		
			org.springframework
			spring-context-support
			${spring.version}
		

		
			org.springframework
			spring-test
			${spring.version}
		
		
		
			org.mybatis
			mybatis
			${mybatis.version}
		
		
		
			org.mybatis
			mybatis-spring
			1.2.2
		
		
		
			javax
			javaee-api
			7.0
		
		
			com.alibaba
			druid
			1.0.31
		
		
		
			mysql
			mysql-connector-java
			5.1.30
		
		
		
			commons-dbcp
			commons-dbcp
			1.2.2
		
		
		
			jstl
			jstl
			1.2
		
		
		
		
			log4j
			log4j
			${log4j.version}
		


		
		
			com.alibaba
			fastjson
			1.1.41
		


		
			org.slf4j
			slf4j-api
			${slf4j.version}
		

		
			org.slf4j
			slf4j-log4j12
			${slf4j.version}
		
		
		
		
			org.codehaus.jackson
			jackson-mapper-asl
			1.9.13
		
		
		
			commons-fileupload
			commons-fileupload
			1.3.1
		
		
			commons-io
			commons-io
			2.4
		
		
			commons-codec
			commons-codec
			1.9
		
		
			org.aspectj
			aspectjweaver
			1.7.3
		
	
  
    project
  



你可能感兴趣的:(代码开发相关)