SSM整合(一)

基于Maven的SSM整合,依赖关系搭建

pom依赖


  4.0.0
  com.liu.manage
  Student
  war
  1.0-SNAPSHOT
  SSM-4 Maven Webapp
  http://maven.apache.org

  
    UTF-8
    UTF-8

    
    4.2.5.RELEASE

    
    3.4.4

    
    5.1.39

    
    1.7.18
    1.2.17

  


  
    
    
      jstl
      jstl
      1.2
    

    
      javax
      javaee-api
      6.0
    

    
    
      junit
      junit
      4.12
      
      test
    

    
    
      org.springframework
      spring-core
      ${spring.version}
    
    
      org.springframework
      spring-web
      ${spring.version}
    
    
      org.springframework
      spring-tx
      ${spring.version}
    
    
      org.springframework
      spring-jdbc
      ${spring.version}
    
    
      org.springframework
      spring-webmvc
      ${spring.version}
    
    
      org.springframework
      spring-context
      ${spring.version}
    
    
      org.springframework
      spring-context-support
      ${spring.version}
    
    
      org.springframework
      spring-aop
      ${spring.version}
    

    
      org.springframework
      spring-test
      ${spring.version}
    
    
    
      org.mybatis
      mybatis
      ${mybatis.version}
    
    
    
      org.mybatis
      mybatis-spring
      1.3.0
    
    
      org.apache.velocity
      velocity
      1.7
    
    
      mysql
      mysql-connector-java
      ${mysql-driver.version}
    
    
      
          c3p0
          c3p0
          0.9.1.2
        

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

    
    
    
      org.codehaus.jackson
      jackson-mapper-asl
      1.9.13
    
    
      com.fasterxml.jackson.core
      jackson-core
      2.8.0
    
    
      com.fasterxml.jackson.core
      jackson-databind
      2.8.0
    
   
    
      commons-fileupload
      commons-fileupload
      1.3.1
    

    
      commons-io
      commons-io
      2.4
    

    
      commons-codec
      commons-codec
      1.9
    

    
      com.fasterxml.jackson.core
      jackson-core
      2.8.0
    
    
      com.fasterxml.jackson.core
      jackson-databind
      2.8.0
    
  

  
    Student
  


创建一个spring.xml文件

 
  
      
  
 
       
 
 
 
 
 
 
       
    
         
         
          
          
          
    
    
    
        
        
    
    
    
        
    
    
    

SpringMVC配置文件

 
 
 
 
 
 
  
 

数据库连接池配置C3p0

driverClasss=com.mysql.jdbc.Driver jdbcUrl=jdbc\:mysql\://127.0.0.1\:3306/stu_m?useUnicode\=true&characterEncoding\=utf8 user=root password=123123 maxPoolSize=20 minPoolSize=5  
#定义初始连接数 initialSize=0 
#定义最大连接数 maxActive=20
#定义最大空闲 maxIdle=20 
#定义最小空闲 minIdle=1 
#定义最长等待时间 maxWait=60000

  1. 至此,SSM环境搭建就OK了
    第二篇将会讲述运行的Demo

你可能感兴趣的:(SSM整合(一))