Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to integrate SSM environment

2025-04-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

怎么进行SSM环境整合,相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。

服务器开发:分成3层

表现层:使用SpringMVC框架

业务层:使用Spring框架

持久层:Mybatis框架

通过Spring框架整合其他2个框架

整合的思路:

1、先搭建整合的环境

2、先把Spring的配置搭建完成

3、在使用Spring整合SpringMVC框架

4、最后使用Spring整合MyBatis框架

步骤:

第一步:导入jar包坐标

4.0.0 lianbang.wu ssm_simpelDemo 1.0-SNAPSHOT war ssm_simpelDemo Maven Webapp http://www.example.com UTF-8 1.8 1.8 5.0.2.RELEASE 1.6.6 1.2.12 5.1.6 3.4.5 junit junit 4.11 compile org.aspectj aspectjweaver 1.9.4 org.springframework spring-aop ${spring.version} org.springframework spring-context ${spring.version} org.springframework spring-web ${spring.version} org.springframework spring-webmvc ${spring.version} org.springframework spring-test ${spring.version} org.springframework spring-tx ${spring.version} org.springframework spring-jdbc ${spring.version} mysql mysql-connector-java ${mysql.version} javax.servlet servlet-api 2.5 provided javax.servlet.jsp jsp-api 2.2 provided jstl jstl 1.2 log4j log4j ${log4j.version} org.slf4j slf4j-api ${slf4j.version} org.slf4j slf4j-log4j12 ${slf4j.version} org.mybatis mybatis-spring 1.3.0 org.mybatis mybatis ${mybatis.version} c3p0 c3p0 0.9.1.2 jar compile ssm_simpelDemo maven-clean-plugin 3.1.0 maven-resources-plugin 3.0.2 maven-compiler-plugin 3.8.0 maven-surefire-plugin 2.22.1 maven-war-plugin 3.2.2 maven-install-plugin 2.5.2 maven-deploy-plugin 2.8.2 org.apache.tomcat.maven tomcat7-maven-plugin 2.2

第二步:搭建spring

第三步:搭建springmvc

3.1、web.xml中配置

dispatcherServlet org.springframework.web.servlet.DispatcherServlet contextConfigLocation classpath:springmvc.xml 1 dispatcherServlet / characterEncodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 characterEncodingFilter /*

3.2 、springmvc.xml中配置

第四步:spring整合springmvc,在web .xml配置监听器

Archetype Created Web Application org.springframework.web.context.ContextLoaderListener contextConfigLocation classpath:applicationContext.xml

第五步:spring整合Mybaits

第6步:配置事务

看完上述内容,你们掌握怎么进行SSM环境整合的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注行业资讯频道,感谢各位的阅读!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report