maven+SSM框架基本整合之配置文件的配置

小白刚学会基于maven的SSM框架整合做了小小的CRUD的demo写这篇博客就是为了做下笔记,巩固下现有的学习知识。

这篇博客主要是介绍使用maven实现SSM框架整合的基本的配置。

新建一个maven项目以后

1、pom.xml(基础)配置


  4.0.0
  com.demo
  ssm_crud
  0.0.1-SNAPSHOT
  war
  
  
  
  
  
	
		
		    org.springframework
		    spring-webmvc
		    4.3.7.RELEASE
		
		
  
  
	
	    org.springframework
	    spring-jdbc
	    4.3.7.RELEASE
	
	
	
	
	
	    org.springframework
	    spring-aspects
	    4.3.7.RELEASE
	
	
	
	
	
	    org.mybatis
	    mybatis
	    3.4.2
	
	
	
	
	
	    org.mybatis
	    mybatis-spring
	    1.3.1
	
	
	
    
      org.mybatis.generator
      mybatis-generator-core
      1.3.5
    
	
	
    
      com.github.pagehelper
      pagehelper
      5.0.0
    
	
	
	
	
	    c3p0
	    c3p0
	    0.9.1
	
	
	
	    mysql
	    mysql-connector-java
	    5.1.41
	
	
	
	
	
	    jstl
	    jstl
	    1.2
	
	
	
	
	
	    javax.servlet
	    javax.servlet-api
	    3.0.1
	    provided
	
	
		javax.servlet
		jsp-api
		2.0
		provided
	
	
	
	
	
	    junit
	    junit
	    4.12
	    test
	
	
	
		
	
	
	    org.springframework
	    spring-test
	    4.3.7.RELEASE
	    test
	
	
	
    
      com.fasterxml.jackson.core
      jackson-databind
      2.8.8
    
    
    
	
	    org.hibernate
	    hibernate-validator
	    5.4.1.Final
	
    
  
  

2、web.xml配置



  
  
    contextConfigLocation
    classpath:applicationContext.xml
  
  
    org.springframework.web.context.ContextLoaderListener
  
  
  
  
	
		springmvc
		org.springframework.web.servlet.DispatcherServlet
		
			contextConfigLocation
			classpath:springmvc.xml
		
		1
	
	
	
		springmvc
		/
	
  
  
  
    characterEncodingFilter
    org.springframework.web.filter.CharacterEncodingFilter
    
      encoding
      UTF-8
    
    
		forceRequestEncoding
		true
		
		
			forceResponseEncoding
			true
		
  
  
    characterEncodingFilter
    /*
  
  

3、springmvc.cml配置




    
    
        
        
    

    
    
    
    
    
    
    
    
        
        
    

4、applicationContext.xml配置




    
    
        
    

    


    
    
    
        
        
        
        
    

    
    
        
        
        
        
        
    
    
    
    
        
        
    

    
    
    
        
        
    

    
    
        
        
    
    
    
        
        
        
        
    
    
    
        
            
            
            
            
        
    

    

注意:在applicationContext.xml配置中的与Mybatis整合mapper与dao接口是不在一个文件下下面,要想在同一个文件下下面的写法如下:


    
        
        
        
    
    
    
    
        
        
    

5、Mybatis-config.xml配置




    
   
 

以上就是基于maven的SSM基本整合配置文件的配置

第一次写博客,写的不好大家理解下。

你可能感兴趣的:(基于maven的SSM基本整合)