搭建Spring+SpringMVC+MyBatis架构项目

项目SSM结构

搭建Spring+SpringMVC+MyBatis架构项目_第1张图片

1.导jar包


    UTF-8
    4.3.14.RELEASE
    4.3.8.Final
    1.9.0.RELEASE
    2.5.0
    1.6.1
    3.2.1
  

  
    
    
      org.springframework
      spring-webmvc
      ${org.springframework.version}
    
    
    
      org.springframework
      spring-core
      ${org.springframework.version}
    
    
      org.springframework
      spring-context
      ${org.springframework.version}
    
    
    
      org.springframework
      spring-web
      ${org.springframework.version}
    
    
    
      org.mybatis
      mybatis
      ${mybatis.version}
    
    
      org.mybatis
      mybatis-spring
      1.2.0
    
    
    
      mysql
      mysql-connector-java
      5.1.46
    
    
    
      commons-dbcp
      commons-dbcp
      1.2.2
    
    
    
      javax.servlet
      javax.servlet-api
      3.0.1
      provided
    
    
    
      aopalliance
      aopalliance
      1.0
    
    
      org.aspectj
      aspectjweaver
      1.6.8
    
    
    
      org.springframework
      spring-tx
      ${org.springframework.version}
    
    
      org.springframework
      spring-jdbc
      ${org.springframework.version}
    
    
    
      commons-fileupload
      commons-fileupload
      1.2.2
    
    
    
      org.apache.commons
      commons-io
      1.3.2
    
  

2.web.xml



  
  
    characterEncodingFilter
    org.springframework.web.filter.CharacterEncodingFilter
    
      encoding
      UTF-8
    
    
      forceEncoding
      true
    
  
  
    characterEncodingFilter
    /*
  
  
  
    contextConfigLocation
    classpath:spring.xml
  
  
  
    org.springframework.web.context.ContextLoaderListener
  
  
  
    dispatcherServlet
    org.springframework.web.servlet.DispatcherServlet
    
    
      contextConfigLocation
      classpath:spring-mvc.xml
    
    
    1
  
  
    dispatcherServlet
    /
  

3.spring.xml



    
    
        
        
        
        
    

    
    
        
        
        
        
        
    

    
    
        
    

    
    
        
    
    
    

    

4.spring-mvc.xml



    
    
    
    
    
    
    
    
        
        
    
    
    
    
        
        
            1048576
        
    

5.在resources目录下创建一个与Mapper层相同路径的文件夹

在这里插入图片描述

6.Dao层结构

搭建Spring+SpringMVC+MyBatis架构项目_第2张图片

7.完成业务测试

你可能感兴趣的:(搭建Spring+SpringMVC+MyBatis架构项目)