介绍SSM框架

介绍SSM框架

介绍SSM框架<原理>

一、什么是SSM框架?

SSM框架是spring、spring MVC 、和mybatis框架的整合,是标准的MVC模式。SSM框架即是将SpringMVC框架、Spring框架、MyBatis框架整合使用。以简化在web开发中繁琐、重复的操作,让开发人员的精力专注于业务处理的开发上。标准的SSM框架有四层,分别是dao层(mapper),service层,controller层和View层。使用spring实现业务对象管理,使用spring MVC负责请求的转发和视图管理,mybatis作为数据对象的持久化引擎。

二、系统架构图

三、搭建步骤

SSM框架搭建实现步骤

(1)创建Web项目

创建项目包结构

pom文件依赖

org.mybatis

mybatis

3.5.7

org.mybatis

mybatis-spring

2.0.6

junit

junit

4.12

test

mysql

mysql-connector-java

5.1.49

javax.servlet

javax.servlet-api

4.0.1

provided

org.springframework

spring-webmvc

5.3.1

org.thymeleaf

thymeleaf-spring5

3.0.12.RELEASE

com.fasterxml.jackson.core

jackson-databind

2.12.1

com.alibaba

druid

1.2.18

org.springframework

spring-jdbc

5.3.1

db.properties

#key=value

db.driver=com.mysql.jdbc.Driver

db.url=jdbc:mysql://localhost:3306/yubencheng

db.username=root

db.password=root

applicationContext.xml

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:context="http://www.springframework.org/schema/context"

xmlns:aop="http://www.springframework.org/schema/aop"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop https://www.springframework.org/schema/aop/spring-aop.xsd">

mybatis-config.xml

PUBLIC "-//mybatis.org//DTD Config 3.0//EN"

"http://mybatis.org/dtd/mybatis-3-config.dtd">

applicationContext-mybatis.xml

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

application-mvc.xml

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:context="http://www.springframework.org/schema/context"

xmlns:mvc="http://www.springframework.org/schema/mvc"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd">

error

web.xm

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"

version="4.0">

CharacterEncodingFilter

org.springframework.web.filter.CharacterEncodingFilter

encoding

UTF-8

forceResponseEncoding

true

CharacterEncodingFilter

/*

HiddenHttpMethodFilter

org.springframework.web.filter.HiddenHttpMethodFilter

HiddenHttpMethodFilter

/*

springMVC

org.springframework.web.servlet.DispatcherServlet

contextConfigLocation

classpath:application-mvc.xml

1

springMVC

/

org.springframework.web.context.ContextLoaderListener

contextConfigLocation

classpath:applicationContext*.xml

相关推荐

年字笔画写法
best365怎么登

年字笔画写法

⏱️ 08-20 👁️ 685
DNF法驱刷图武器排行,大智度论为何是完美武器?dnf60级法驱带什么武器?
药皇熏:掌握这个秘诀,你也能实现钱生钱
best365怎么登

药皇熏:掌握这个秘诀,你也能实现钱生钱

⏱️ 09-17 👁️ 1212
超神学院观看顺序是怎样的?
be365体育平台app

超神学院观看顺序是怎样的?

⏱️ 07-03 👁️ 8262
为什么嗑CP开心,看别人秀恩爱却不爽?
be365体育平台app

为什么嗑CP开心,看别人秀恩爱却不爽?

⏱️ 10-20 👁️ 752
脑干受损最多能睡多久
best365怎么登

脑干受损最多能睡多久

⏱️ 10-21 👁️ 7521