SSM项目中配置问题

创建Spring+SpringMVC+Mybatis项目时候,首先需要配置一些对应的配置文件,下面简要介绍下这些配置文件所需的最简单需求。
1 Mybatis.xml



 
    
    
        
        
        
        
    
 
    
    
        
    
    
    
        
        
    
    
    
    
        
    
 
    
    
 

2 springmvc-servlet.xml
此配置文件配置了SpringMVC框架所需的内容。带*的部分均为自己填写内容



 
     
    
    
    
 
    
    
 
    
    
        
        
    

3 applicationContext.xml
此为Spring所需的配置文件。此处注意:带*部分是项目名称,不具体到包。



 
    
    
        
    
    
    
 

4 web.xml



 
 
    
            org.springframework.web.context.ContextLoaderListener
    
 
    
    
        contextConfigLocation
        classpath:applicationContext.xml
    
 
    
        springmvc
        org.springframework.web.servlet.DispatcherServlet
        
            contextConfigLocation
            classpath:springmvc-servlet.xml
        
        1
    
    
    
        springmvc
        /
    

listener必须有,缺少则会报错,之后也可以加入filter等内容。

你可能感兴趣的:(SSM项目中配置问题)