- 前言
- 一、使用步骤
- 1.创建一个maven项目,并且把项目添加为web项目
- 2.加入pom依赖
- 3、配置web.xml
- 4、配置spring.xml文件
- 5、配置springmvc.xml文件
- 6、mybatis的配置
- 总结
前言 虽然现在都在使用springboot开发,springboot也是基于ssm之后做的简化整合时的配置都是大同小异的,为了方便以后万一用到ssm框架,做个笔记方便以后搭建
提示:以下是本篇文章正文内容,下面案例可供参考
一、使用步骤 1.创建一个maven项目,并且把项目添加为web项目 2.加入pom依赖3、配置web.xmljunit junit 4.12 test org.springframework spring-context 5.2.3.RELEASE cglib cglib 3.3.0 org.aspectj aspectjweaver 1.9.5 aopalliance aopalliance 1.0 org.springframework spring-aspects 5.2.3.RELEASE com.alibaba druid 1.1.21 mysql mysql-connector-java 5.1.48 org.springframework spring-web 5.2.3.RELEASE org.springframework spring-webmvc 5.2.3.RELEASE javax.servlet servlet-api 2.5 provided javax.servlet jsp-api 2.0 provided com.fasterxml.jackson.core jackson-core 2.10.3 com.fasterxml.jackson.core jackson-databind 2.10.3 com.fasterxml.jackson.core jackson-annotations 2.10.3 commons-io commons-io 2.6 commons-fileupload commons-fileupload 1.4 javax.servlet jstl 1.2 org.mybatis mybatis 3.5.4 mysql mysql-connector-java 8.0.19 junit junit 4.13 test log4j log4j 1.2.17 org.mybatis.caches mybatis-ehcache 1.2.0 org.slf4j slf4j-api 2.0.0-alpha1 org.slf4j slf4j-log4j12 2.0.0-alpha1 test org.mybatis mybatis-spring 2.0.4
org.springframework.web.context.ContextLoaderListener
contextConfigLocation
classpath:spring.xml
springmvc
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
classpath:springmvc.xml
1
springmvc
/
CharacterEncoding
org.springframework.web.filter.CharacterEncodingFilter
encoding
utf-8
forceEncoding
true
CharacterEncoding
/*
rest
org.springframework.web.filter.HiddenHttpMethodFilter
rest
/*
4、配置spring.xml文件
spring配置时顺便吧mybatis也配置了,就不需要配置mybatis了
5、配置springmvc.xml文件
6、mybatis的配置
因为配置spring.xml中已经集成了mybatis的操作,所以我们如果需要懒加载之类的配置时在另行配置
总结ssm基本配置,需要的时候直接复制一下更改一下配置细节即可



