SSM项目中配置问题

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

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

1  Mybatis.xml






















































2 springmvc-servlet.xml

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

  1. 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

     

3 applicationContext.xml

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

  1. 
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

     

4 web.xml

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

     

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

转载于:https://my.oschina.net/u/3873725/blog/1933310

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