SSM框架整合核心内容
阅读原文时间:2023年07月11日阅读:2

所需要的jar包及其版本

  Spring 版本:4.3.18   tx、aop、beans、core、web、web-mvc、context、expression、jdbc

  MyBatis:3.4.6

  mybatis-spring:1.3.2

  mysql-connector 连接数据库:5.1.44

  fastjson 生成json:1.2.13

  druid 数据源:1.1.9

  jsr 303 数据校验:hibernate-validate4.3.2、jboss-loggin3.1.0CR2、validation-api1.0GA

  面向切面:aopaliance、aspectjweaver1.8.13

  文件上传:commons-io、commons-fileupload、commons-loggin1.2

  jsp、jstl:jstl.jar、standart.jar

  log4j:1.2.17

准备配置文件:

  database.properties  连接数据库

  log4j.properties     输出日志

  mybatis-config.xml   mybatis配置文件

  applicationContext-mybatis.xml   spring配置数据操作的配置文件

  springmvc-servlet.xml  springmvc的配置文件

  web.xml  项目配置文件

mybatis-config.xml



                                                                       

applicationContext-mybatis.xml


             classpath:database.properties
    


                   


    
              
   
                                  classpath:cn/smbms/dao/**/*.xml         
    

    






springmvc-servlet.xml

http://www.springframework.org/schema/beans        http://www.springframework.org/schema/beans/spring-beans.xsd        http://www.springframework.org/schema/aop        http://www.springframework.org/schema/aop/spring-aop.xsd        http://www.springframework.org/schema/context        http://www.springframework.org/schema/context/spring-context.xsd        http://www.springframework.org/schema/tx        http://www.springframework.org/schema/tx/spring-tx.xsd        http://www.springframework.org/schema/mvc        http://www.springframework.org/schema/mvc/spring-mvc.xsd">          
                                





application/json;charset=utf-8


application/json;charset=utf-8 WriteDateUseDateFormat









web.xml


http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app\_3\_0.xsd" version="3.0">



springmvc
org.springframework.web.servlet.DispatcherServlet


contextConfigLocation classpath:springmvc-servlet.xml
1

springmvc /



encodingFilter
org.springframework.web.filter.CharacterEncodingFilter
encoding utf-8


forceEncoding true

encodingFilter /*


org.springframework.web.context.ContextLoaderListener


contextConfigLocation classpath:applicationContext-*.xml