当前位置:网站首页>Steps of building SSM framework
Steps of building SSM framework
2022-07-07 12:49:00 【Six years of Surabaya】
SSM Steps of framework construction
1. Import Spring、SpringMVC、MyBatis Dependence
2. Import Spring、SpringMVC、MyBatis Configuration file for
3. stay Spring The following contents are configured in the configuration file of :
(1) Configure data sources
(2) To configure MyBatis The factory of conversation SqlSessionFactoryBean, And inject the data source
(3) To configure MyBatis Automatic scanning DAO layer Mapper Interface and configuration MyBatis Path to map file
(4) adopt component-scan Comment on service Scanning of layers
(5) Configure the propagation characteristics of transactions 、 Isolation level 、 Rollback strategy , Let those add、delete、update The first method starts the commit and rollback of transactions , Other methods are read-only transactions .
(6) Configure the transaction management aspect class , Crosscut service layer .
4. stay SpringMVC The following is configured in the configuration file :
(1) Use component-scan Tag open right controller Scanning of layers
(2) adopt annotation-driven Tags enable annotation driven
(3) Configure the view parser
(4) If you need to upload files , You also need to configure the file upload parser , And specify the size of file upload Limit
5. stay MyBatis The following contents are configured in the configuration file of :
(1) Configure printing on the console SQL sentence
(2) Configure enable L2 cache
(3) Configure underline to turn to small hump automatically
6. stay web.xml The following is configured in
(1) To configure Spring Listening in , And load Spring Configuration file for
(2) To configure SpringMVC Core controller of DispatcherServlet And load SpringMVC Configuration file for
(3) In order to prevent Chinese garbled , Generally, you will also configure an encoding filter and set the character encoding set to UTF-8
7. Actually, that's all , our SSM Even if the framework is built , Then you can develop the project .
Create a new control layer and add @Controller annotation , Then add @RequestMapping annotation , Next, in the control layer class, pass @Autowired or @Resource Annotation injection Service layer , stay Service Layers pass through @Autowired or @Resource Annotation injection DAO layer , What needs to be noted here is ,DAO Layer has only interfaces but no implementation classes , It's through MyBatis In the mapping file namespace Indicate the implemented DAO layer Mapper Interface , And pass MyBatis In the mapping file SQL Of ID Indicates the call DAO layer Mapper Interface method to be executed SQL sentence .
边栏推荐
- leetcode刷题:二叉树27(删除二叉搜索树中的节点)
- 【从 0 开始学微服务】【00】课程概述
- What is an esp/msr partition and how to create an esp/msr partition
- 在字符串中查找id值MySQL
- [statistical learning method] learning notes - support vector machine (Part 2)
- RHSA first day operation
- SQL Lab (41~45) (continuous update later)
- 普乐蛙小型5d电影设备|5d电影动感电影体验馆|VR景区影院设备
- Leetcode skimming: binary tree 22 (minimum absolute difference of binary search tree)
- [statistical learning methods] learning notes - Chapter 5: Decision Tree
猜你喜欢
2022 polymerization process test question simulation test question bank and online simulation test
什么是ESP/MSR 分区,如何建立ESP/MSR 分区
Static vxlan configuration
visual stdio 2017关于opencv4.1的环境配置
图形对象的创建与赋值
leetcode刷题:二叉树23(二叉搜索树中的众数)
Pule frog small 5D movie equipment | 5D movie dynamic movie experience hall | VR scenic area cinema equipment
Static comprehensive experiment
Airserver automatically receives multi screen projection or cross device projection
NPM instal reports agent or network problems
随机推荐
[learn wechat from 0] [00] Course Overview
Day21 multithreading
静态Vxlan 配置
The left-hand side of an assignment expression may not be an optional property access. ts(2779)
2022聚合工艺考试题模拟考试题库及在线模拟考试
聊聊Redis缓存4种集群方案、及优缺点对比
[爬虫]使用selenium时,躲避脚本检测
Static comprehensive experiment
Multi row and multi column flex layout
Vxlan static centralized gateway
The IDM server response shows that you do not have permission to download the solution tutorial
[statistical learning method] learning notes - support vector machine (I)
Cookie
Session
Visual stdio 2017 about the environment configuration of opencv4.1
Leetcode skimming: binary tree 27 (delete nodes in the binary search tree)
Day-15 common APIs and exception mechanisms
2022A特种设备相关管理(锅炉压力容器压力管道)模拟考试题库模拟考试平台操作
SQL Lab (46~53) (continuous update later) order by injection
Cryptography series: detailed explanation of online certificate status protocol OCSP