> 文档中心 > ssm框架搭建 SpringMVC4 + Spring 4+ MyBatis3+JQuery+JQueryUI+Echarts3

ssm框架搭建 SpringMVC4 + Spring 4+ MyBatis3+JQuery+JQueryUI+Echarts3

                    SSM详细整合之  SpringMVC4 + Spring 4+ MyBatis3+JQuery+JQueryUI+Echarts3

                                   +Bootstrap3+MVC+Ajax(图文教程)

                                                                     撰稿人:高薪启蒙Array老师

本文衍生的零基础视频:https://edu.csdn.net/course/detail/4468

本文衍生的实战项目,手把手让你张工作经验视频:https://edu.csdn.net/course/detail/9614

摘要: SpringMVC4 + Spring 4+ MyBatis3+JQuery+JQueryUI+Echarts3+Bootstrap3+MVC+Ajax等整合环境的搭建。

【技术架构(技术选型)】

          手把手教你整合最优雅SSM框架:     SpringMVC4 + Spring 4+ MyBatis3+JQuery+JQueryUI+Echarts3+Bootstrap3+MVC+Ajax

【现状】

              当我们看大部分教学课堂或者机构的实体课堂中把SSH(Struts1.x/ Struts 2.x+hibernate4/hibernate5.x+Spring4.x) 作为最核心教学内容。但实际互联网企业应用中,SpringMVC可以完全替代Struts系列,注解方式,快捷编程,通过restful风格定义url,让地址看起来非常优雅。MyBatis也可以替换Hibernate,正因为MyBatis的半自动特点,这会让有数据库经验的软件设计师能开发出高效率的SQL语句。

【文章目标】

         一次就成功SSM整合,搭建环境成功

   

【详细步骤】

第一部分:整体展示

====================整体项目结构展示===================

=========================整体lib结构展示===============

第二部分:实战环境搭建

===================2.1新建项目工程=====================

===================2.2改变字符集utf-8==================

 

===============2.3创建package========================

==================2.4 复制jar放入lib文件夹===============

========(涉及的jar文件可以联系作者提供,也可以上网自己搜索下载)======

==========2.5 复制js,jquery到新建的js文件=================

========(涉及的js文件可以联系作者提供,也可以上网自己搜索下载)======

===============2.6.1  新建src下面的config  ==================

============2.6.2 在config中新建 mybatis-config.xml=============

============2.6.3 配置mybatis和分页插件:mybatis-config.xml=======

<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"

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

    

        

    

============2.7.1 在config中新建 spring-array.xml  ==============

============2.7.2 配置Spring配置文件:spring-array.xml===========

<beans xmlns="http://www.springframework.org/schema/beans"

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

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-4.0.xsd

http://www.springframework.org/schema/context

http://www.springframework.org/schema/context/spring-context-4.0.xsd

http://www.springframework.org/schema/tx

http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">

               

          

          

classpath:config/log4j.properties

          

       

============2.8.1 在config中新建 spring-mvc.xml  ==============

============2.8.2 配置Spring配置文件:spring-mvc.xml===========

<beans xmlns="http://www.springframework.org/schema/beans"

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

http://www.springframework.org/schema/context/spring-context-4.0.xsd

http://www.springframework.org/schema/mvc

http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">

============2.9.1 在config中新建 log4j.properties   ==============

============2.9.2 配置日志配置文件:log4j.properties(可选)========

log4j.rootLogger=DEBUG,CONSOLE,FILEOUT

log4j.addivity.org.apache=true

# CONSOLE  \u6253\u5370\u5230\u63A7\u5236\u53F0

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender

log4j.appender.Threshold=ALL

log4j.appender.CONSOLE.Target=System.out

log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout

log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH\:mm\:ss} \:%m%n

#

# FILEOUT \u6253\u5370\u5230 D\:\\report.log

log4j.appender.FILEOUT=org.apache.log4j.RollingFileAppender

log4j.appender.FILEOUT.File=D\:\\report.log

log4j.appender.FILEOUT.layout=org.apache.log4j.PatternLayout

log4j.appender.fileout.MaxFileSize=100000KB

log4j.appender.FILEOUT.Append=true

#log4j.appender.CONSOLE.layout.ConversionPattern=[framework] %d \u2013 %c -%-4r [%t] %-5p %c %x \u2013 %m%n

log4j.appender.FILEOUT.layout.ConversionPattern=[%-5p]_%d{yyyy-MM-dd HH\:mm\:ss} \:%m%n

============2.10.1 SSM整合核心Web.xml的详细配置=============

============2.10.2 SSM整合核心Web.xml的详细配置=============

===========springmvc4和spring4容器的对象加载核心配置详解========

<web-app version="2.5"

       xmlns="http://java.sun.com/xml/ns/javaee"

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

       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

org.springframework.web.context.ContextLoaderListener

contextConfigLocation

classpath:config/spring-*.xml

springMVC

org.springframework.web.servlet.DispatcherServlet

contextConfigLocation

classpath:config/spring-mvc.xml

1

   

           springMVC

           *.do

   

org.springframework.web.util.IntrospectorCleanupListener

 

    index.jsp

 

============2.11 整合完毕,环境测试效果如下================

===============2.12 成功展示===================

======================环境搭建完毕======================

注意:

      大家不要怕麻烦,正因为SSM4整合的麻烦,一般人不会,您会了,企业才会录用你,不然企业凭什么给您高薪?无论生活之路有多难,却始终保持平和心态,不叫屈,不埋怨,怀揣希望,阔步向前……

            

本文衍生的零基础视频:https://edu.csdn.net/course/detail/4468

本文衍生的实战项目,手把手让你张工作经验视频:https://edu.csdn.net/course/detail/9614

~~~干货博客继续更新中~~~