• SSM整合框架(相关依赖)


    SSM整合框架是指Spring+SpringMVC+MyBatis三个开源框架的整合。

    以下是SSM整合框架的搭建步骤:

    1. 创建maven项目

    2. 在pom.xml中添加Spring、SpringMVC、MyBatis等必要依赖

    3. 在web.xml中配置DispatcherServlet和ContextLoaderListener

    4. 创建Spring的配置文件applicationContext.xml,并在其中配置dataSource、sqlSessionFactory、transactionManager和MyBatis的Mapper扫描器等

    5. 创建SpringMVC的配置文件spring-mvc.xml,并在其中配置视图解析器、处理器映射器、异常处理器等

    6. 配置MyBatis的Mapper文件

    7. 创建Controller、Service和Mapper等业务相关的类

    8. 在Controller中编写处理请求的方法,调用Service层提供的方法完成业务逻辑,最终返回视图

    9. 在Service层中编写业务逻辑相关的方法,并调用Mapper层提供的方法来完成数据访问操作

    10. 在Mapper层中编写对数据库的操作方法

    完成以上步骤后,即可成功搭建基于SSM整合框架的Web应用程序。

    1. <dependencies>
    2. <dependency>
    3. <groupId>org.springframeworkgroupId>
    4. <artifactId>spring-contextartifactId>
    5. <version>4.3.2.RELEASEversion>
    6. dependency>
    7. <dependency>
    8. <groupId>org.springframeworkgroupId>
    9. <artifactId>spring-webmvcartifactId>
    10. <version>4.3.2.RELEASEversion>
    11. dependency>
    12. <dependency>
    13. <groupId>org.mybatisgroupId>
    14. <artifactId>mybatisartifactId>
    15. <version>3.4.4version>
    16. dependency>
    17. <dependency>
    18. <groupId>org.mybatisgroupId>
    19. <artifactId>mybatis-springartifactId>
    20. <version>1.3.1version>
    21. dependency>
    22. <dependency>
    23. <groupId>mysqlgroupId>
    24. <artifactId>mysql-connector-javaartifactId>
    25. <version>5.1.47version>
    26. dependency>
    27. <dependency>
    28. <groupId>javax.servletgroupId>
    29. <artifactId>servlet-apiartifactId>
    30. <version>2.5version>
    31. <scope>providedscope>
    32. dependency>
    33. dependencies>

  • 相关阅读:
    Linux中 vim 编辑器的使用
    SimVODIS++: Neural Semantic Visual Odometry in Dynamic Environments 论文阅读
    P09 约束
    初学者看 “图“
    C语言:不创建临时变量实现两数交换
    mac apktool安装
    Webpack 热更新原理
    死亡游戏:密室互猜硬币规则及其破解方法
    NumPy掩码数组
    Python 高级函数map、reduce、filter与sorted
  • 原文地址:https://blog.csdn.net/NanCheng_666/article/details/133047095