接触SSM框架到现在也有很长时间了,之前也搭建过几个简单的项目,但是没有进行过记录学习和搭建的过程。网上关于ssm框架整合的资料也不少,不过说句实话,单看某一篇文章能够不踩坑的配置并跑起来的也不太多,在学习过程中筛选甄别这些就浪费了相当一部分时间。
本文理论+实践的方式,分享ssm的相关概念以及采用实践操作的方式搭建整套系统。把搭建过程中踩过的坑、笔记记录整理一下,用以和感兴趣的朋友分享下。
该项目持续更新中,会在代码以及该文档里面详细注释和介绍。
项目托管在码云
开源平台上,链接:
https://gitee.com/nelucifer/ssm-note,点击克隆/下载
获取该项目。
打开IDEA,选择New->Projects,按照下面的步骤选择:
选择Maven,然后勾选Create from archetype,选择webapp这一个
完成之后填入相应的maven项目组信息,GroupId是项目组织的标识符,对应java的包结构;ArtifactId是项目的标识符,对应项目的名称,即项目根目录的名称。groupId和artifactId统称为“坐标”。
在main文件夹下创建文件夹java、resources,src文件夹下创建test,test文件夹下创建java文件夹;
在java文件夹上右键 -> Mark Directory as
,java文件夹选择Sources Root
,resources文件夹上选择Resources Root
,test文件夹下的java文件夹上选择Test Resources Root
,
操作如下:
完成后的项目结构如下:
详细的解释直接在代码里面注释了。开始贴代码:
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0modelVersion>
<groupId>com.weyounggroupId>
<artifactId>ssm-noteartifactId>
<version>1.0-SNAPSHOTversion>
<packaging>warpackaging>
<name>ssm-note Maven Webappname>
<url>http://www.example.comurl>
<description>maven+ssm项目整合笔记description>
<issueManagement>
<system>jirasystem>
<url>url>
issueManagement>
<developers>
<developer>
<id>coder_lixiaid>
<name>lixianame>
<email>[email protected]email>
<url>http://www.wanglixia.top/url>
<roles>
<role>Project Managerrole>
roles>
<organization>organization>
<organizationUrl>organizationUrl>
developer>
developers>
<properties>
<project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
<maven.compiler.source>1.7maven.compiler.source>
<maven.compiler.target>1.7maven.compiler.target>
<plugin.maven-compiler>3.1plugin.maven-compiler>
<javac.target.version>1.8javac.target.version>
<spring.version>4.2.5.RELEASEspring.version>
<jstl.version>1.2jstl.version>
<commons-logging.version>1.1.1commons-logging.version>
<mybatis.version>3.3.1mybatis.version>
<mybatis-spring.version>1.2.4mybatis-spring.version>
<mysql-connector-java.version>5.1.26mysql-connector-java.version>
<log4j.version>1.2.14log4j.version>
<slf4j.log4j12.version>1.7.12slf4j.log4j12.version>
<servlet-api.version>2.5servlet-api.version>
<commons-io.version>2.4commons-io.version>
<commons-fileupload.version>1.3commons-fileupload.version>
<gson.version>2.2.2gson.version>
<druid.version>1.0.25druid.version>
<cxf.version>3.1.6cxf.version>
<fastjson.version>1.2.32fastjson.version>
<pagehelper.version>5.1.2pagehelper.version>
<jackson.version>2.7.4jackson.version>
properties>
<repositories>
<repository>
<id>publicid>
<name>aliyun nexusname>
<url>http://maven.aliyun.com/nexus/content/groups/public/url>
<releases>
<enabled>trueenabled>
<updatePolicy>neverupdatePolicy>
<checksumPolicy>ignorechecksumPolicy>
releases>
<snapshots>
<enabled>falseenabled>
<updatePolicy>neverupdatePolicy>
<checksumPolicy>ignorechecksumPolicy>
snapshots>
<layout>defaultlayout>
repository>
repositories>
<pluginRepositories>
<pluginRepository>
<id>publicid>
<name>aliyun nexusname>
<url>http://maven.aliyun.com/nexus/content/groups/public/url>
<releases>
<enabled>trueenabled>
releases>
<snapshots>
<enabled>falseenabled>
snapshots>
pluginRepository>
pluginRepositories>
<dependencies>
<dependency>
<groupId>junitgroupId>
<artifactId>junitartifactId>
<version>4.12version>
<type>jartype>
<scope>testscope>
<optional>trueoptional>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-aopartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-aspectsartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-beansartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-contextartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-context-supportartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-coreartifactId>
<version>${spring.version}version>
<exclusions>
<exclusion>
<groupId>commons-logginggroupId>
<artifactId>commons-loggingartifactId>
exclusion>
exclusions>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-expressionartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-jdbcartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-txartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-jmsartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-ormartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-oxmartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-webartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-webmvcartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>org.springframeworkgroupId>
<artifactId>spring-testartifactId>
<version>${spring.version}version>
<type>jartype>
<scope>compilescope>
dependency>
<dependency>
<groupId>commons-logginggroupId>
<artifactId>commons-loggingartifactId>
<version>${commons-logging.version}version>
dependency>
<dependency>
<groupId>org.mybatisgroupId>
<artifactId>mybatisartifactId>
<version>${mybatis.version}version>
dependency>
<dependency>
<groupId>org.mybatisgroupId>
<artifactId>mybatis-springartifactId>
<version>${mybatis-spring.version}version>
dependency>
<dependency>
<groupId>mysqlgroupId>
<artifactId>mysql-connector-javaartifactId>
<version>${mysql-connector-java.version}version>
dependency>
<dependency>
<groupId>com.alibabagroupId>
<artifactId>druidartifactId>
<version>${druid.version}version>
dependency>
<dependency>
<groupId>log4jgroupId>
<artifactId>log4jartifactId>
<version>${log4j.version}version>
dependency>
<dependency>
<groupId>org.slf4jgroupId>
<artifactId>slf4j-log4j12artifactId>
<version>${slf4j.log4j12.version}version>
dependency>
<dependency>
<groupId>javax.servletgroupId>
<artifactId>servlet-apiartifactId>
<version>${servlet-api.version}version>
dependency>
<dependency>
<groupId>javax.servletgroupId>
<artifactId>jstlartifactId>
<version>${jstl.version}version>
dependency>
<dependency>
<groupId>commons-iogroupId>
<artifactId>commons-ioartifactId>
<version>${commons-io.version}version>
dependency>
<dependency>
<groupId>commons-fileuploadgroupId>
<artifactId>commons-fileuploadartifactId>
<version>${commons-fileupload.version}version>
dependency>
<dependency>
<groupId>com.google.code.gsongroupId>
<artifactId>gsonartifactId>
<version>${gson.version}version>
dependency>
<dependency>
<groupId>com.fasterxml.jackson.coregroupId>
<artifactId>jackson-coreartifactId>
<version>${jackson.version}version>
dependency>
<dependency>
<groupId>com.fasterxml.jackson.coregroupId>
<artifactId>jackson-databindartifactId>
<version>${jackson.version}version>
dependency>
<dependency>
<groupId>com.fasterxml.jackson.coregroupId>
<artifactId>jackson-annotationsartifactId>
<version>${jackson.version}version>
dependency>
<dependency>
<groupId>com.alibabagroupId>
<artifactId>fastjsonartifactId>
<version>${fastjson.version}version>
dependency>
<dependency>
<groupId>com.github.pagehelpergroupId>
<artifactId>pagehelperartifactId>
<version>${pagehelper.version}version>
dependency>
<dependency>
<groupId>org.apache.cxfgroupId>
<artifactId>cxf-rt-frontend-jaxwsartifactId>
<version>${cxf.version}version>
dependency>
<dependency>
<groupId>org.apache.cxfgroupId>
<artifactId>cxf-coreartifactId>
<version>${cxf.version}version>
dependency>
<dependency>
<groupId>org.apache.cxfgroupId>
<artifactId>cxf-rt-transports-httpartifactId>
<version>${cxf.version}version>
dependency>
dependencies>
<build>
<finalName>ssm-notefinalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-pluginartifactId>
<version>3.1.0version>
plugin>
<plugin>
<artifactId>maven-resources-pluginartifactId>
<version>3.0.2version>
plugin>
<plugin>
<artifactId>maven-compiler-pluginartifactId>
<version>3.8.0version>
plugin>
<plugin>
<artifactId>maven-surefire-pluginartifactId>
<version>2.22.1version>
plugin>
<plugin>
<artifactId>maven-war-pluginartifactId>
<version>3.2.2version>
plugin>
<plugin>
<artifactId>maven-install-pluginartifactId>
<version>2.5.2version>
plugin>
<plugin>
<artifactId>maven-deploy-pluginartifactId>
<version>2.8.2version>
plugin>
plugins>
pluginManagement>
build>
project>
spring-config.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:tx="http://www.springframework.org/schema/tx"
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 http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
<context:component-scan base-package="com.weyoung.service"/>
<context:component-scan base-package="com.weyoung.dao"/>
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="MySQLDataSource"/>
<property name="mapperLocations" value="classpath:/mappers/*.xml"/>
<property name="configLocation" value="classpath:config/mybatis-config.xml"/>
bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="MySQLDataSource"/>
bean>
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.weyoung.dao"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
bean>
<bean id="dataSourceConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:config/jdbc.properties"/>
bean>
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>
<bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
list>
property>
bean>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="insert*" propagation="REQUIRED"/>
<tx:method name="update*" propagation="REQUIRED"/>
<tx:method name="edit*" propagation="REQUIRED"/>
<tx:method name="save*" propagation="REQUIRED"/>
<tx:method name="add*" propagation="REQUIRED"/>
<tx:method name="new*" propagation="REQUIRED"/>
<tx:method name="set*" propagation="REQUIRED"/>
<tx:method name="remove*" propagation="REQUIRED"/>
<tx:method name="delete*" propagation="REQUIRED"/>
<tx:method name="change*" propagation="REQUIRED"/>
<tx:method name="get*" propagation="REQUIRED" read-only="true"/>
<tx:method name="find*" propagation="REQUIRED" read-only="true"/>
<tx:method name="load*" propagation="REQUIRED" read-only="true"/>
<tx:method name="*" propagation="REQUIRED" read-only="true"/>
tx:attributes>
tx:advice>
<aop:config>
<aop:pointcut id="serviceOperation" expression="execution(* com.weyoung.service.*.*Impl.*(..))"/>
<aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation"/>
aop:config>
<bean id="MySQLDataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
<property name="driverClassName" value="${jdbc.mysql.driver}"/>
<property name="url" value="${jdbc.mysql.url}"/>
<property name="username" value="${jdbc.mysql.username}"/>
<property name="password" value="${jdbc.mysql.password}"/>
<property name="initialSize" value="${jdbc.initialSize}"/>
<property name="minIdle" value="${jdbc.minIdle}"/>
<property name="maxActive" value="${jdbc.maxActive}"/>
<property name="maxWait" value="${jdbc.maxWait}"/>
<property name="timeBetweenEvictionRunsMillis" value="${jdbc.timeBetweenEvictionRunsMillis}"/>
<property name="testWhileIdle" value="${jdbc.testWhileIdle}"/>
<property name="testOnBorrow" value="true" />
<property name="testOnReturn" value="false" />
<property name="poolPreparedStatements" value="true" />
<property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
<property name="defaultAutoCommit" value="${jdbc.defaultAutoCommit}"/>
<property name="filters" value="stat" />
<property name="proxyFilters">
<list>
<ref bean="logFilter" />
list>
property>
bean>
<bean id="logFilter" class="com.alibaba.druid.filter.logging.Slf4jLogFilter">
<property name="statementExecutableSqlLogEnable" value="false" />
bean>
beans>
spring-mvc.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
<context:component-scan base-package="com.weyoung.controller"/>
<context:annotation-config/>
<mvc:annotation-driven>
<mvc:message-converters>
<ref bean="stringHttpMessageConverter"/>
mvc:message-converters>
mvc:annotation-driven>
<mvc:resources mapping="/plugins/**" location="/plugins/"/>
<mvc:resources mapping="/layouts/**" location="/layouts/"/>
<mvc:resources mapping="/statics/**" location="/statics/"/>
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**"/>
<bean class="com.weyoung.system.LoginInterceptor">bean>
mvc:interceptor>
mvc:interceptors>
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="defaultEncoding" value="UTF-8"/>
<property name="maxUploadSize" value="10485760000"/>
<property name="maxInMemorySize" value="40960"/>
bean>
<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key="org.springframework.web.multipart.MaxUploadSizeExceededException">/error/upload_error.jsp
prop>
props>
property>
bean>
<bean id="beanNameViewResolver" class="org.springframework.web.servlet.view.BeanNameViewResolver">
<property name="order" value="1">property>
bean>
<bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"/>
<bean id="contentNegotiationManager"
class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
<property name="favorParameter" value="false"/>
<property name="parameterName" value="format"/>
<property name="ignoreAcceptHeader" value="true"/>
<property name="mediaTypes">
<value>
json=application/json
xml=application/xml
value>
property>
<property name="defaultContentType" value="text/html"/>
bean>
<bean id="stringHttpMessageConverter" class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8" index="0"/>
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=UTF-8value>
list>
property>
bean>
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/front-end/"/>
<property name="suffix" value=".jsp"/>
<property name="order" value="1"/>
bean>
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="contentNegotiationManager" ref="contentNegotiationManager"/>
<property name="defaultViews">
<bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView"/>
property>
bean>
beans>
jdbc.properties
#============================================================================
# MySQL
#============================================================================
jdbc.mysql.driver=com.mysql.jdbc.Driver
jdbc.mysql.url=jdbc:mysql://localhost:3306/SSM_NOTE?useUnicode=true&characterEncoding=utf8
jdbc.mysql.username=root
jdbc.mysql.password=lucifer
#============================================================================
# common settings
#============================================================================
jdbc.initialSize=5
jdbc.minIdle=5
jdbc.maxActive=100
jdbc.maxWait=100000
jdbc.defaultAutoCommit=false
jdbc.removeAbandoned=true
jdbc.removeAbandonedTimeout=600
jdbc.testWhileIdle=true
jdbc.timeBetweenEvictionRunsMillis=60000
jdbc.minEvictableIdleTimeMillis=300000
log4j.properties
# 定义输出风格
ConversionPattern=%d %-5p [%t] %c - %m%n
# 配置根Logger
## 日志输出级别
log4j.rootLogger=debug,Console,D
log4j.logger.com.cnblogs.lzrabbit=DEBUG
log4j.logger.org.springframework=ERROR
log4j.logger.org.mybatis=DEBUG
log4j.logger.org.apache.ibatis=DEBUG
log4j.logger.org.quartz=ERROR
log4j.logger.org.apache.axis2=ERROR
log4j.logger.org.apache.axiom=ERROR
log4j.logger.org.apache=ERROR
log4j.logger.httpclient=ERROR
#log4j.additivity.org.springframework=false
# ==========输出到控制台==========
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.Target=System.out
# Layout:日志输出格式
# org.apache.log4j.PatternLayout:可以灵活地指定布局模式
# org.apache.log4j.HTMLLayout:以HTML表格形式布局
# org.apache.log4j.SimpleLayout:包含日志信息的级别和信息字符串
# org.apache.log4j.TTCCLayout:包含日志产生的时间、线程、类别等等信息
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=${ConversionPattern}
#log4j.appender.Console.encoding=UTF-8
# ==========输出到日志文件==========
# Appender为日志输出目的地,Log4j提供的appender有以下几种:
# org.apache.log4j.ConsoleAppender(控制台),
# org.apache.log4j.FileAppender(文件),
# org.apache.log4j.DailyRollingFileAppender(每天产生一个日志文件),
# org.apache.log4j.RollingFileAppender(文件大小到达指定尺寸的时候产生一个新的文件),
# org.apache.log4j.WriterAppender(将日志信息以流格式发送到任意指定的地方)
log4j.appender.D=org.apache.log4j.DailyRollingFileAppender
log4j.appender.D.DatePattern='.'yyyy-MM-dd'.log'
log4j.appender.D.File=logs/ssm-note.log
log4j.appender.D.Append=true
## 输出日志级别
log4j.appender.D.Threshold=DEBUG
log4j.appender.D.layout=org.apache.log4j.PatternLayout
log4j.appender.D.encoding=UTF-8
# ==========输出异常信息日志文件==========
log4j.appender.E=org.apache.log4j.DailyRollingFileAppender
log4j.appender.E.DatePattern='.'yyyy-MM-dd'.log'
log4j.appender.E.File=logs/daily.log
log4j.appender.E.Append=true
log4j.appender.E.Threshold=ERROR
log4j.appender.E.layout=org.apache.log4j.PatternLayout
log4j.appender.E.encoding=UTF-8
log4j.appender.D.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [%t:%r]-[%p] %m%n
# 打印参数
# %c 输出日志信息所属的类的全名
# %d 输出日志时间点的日期或时间,默认格式为ISO8601,也可以在其后指定格式,比如:%d{yyy-MM-dd HH:mm:ss},
# 输出类似:2019-2-21 01:38:37
# %f 输出日志信息所属的类的类名
# %l 输出日志事件的发生位置,即输出日志信息的的语句处于它所在的类的第几行
# %m 输出代码中指定的信息,如log(message)中的message
# %n 输出一个回车换行符,Windows平台为"rn",Unix平台为"n"
# %p 输出优先级,即DEBUG.INFO,WARN,ERROR,FATAL.如果是调用debug()输出的,则为DEBUG,以此类推
# %r 输出自应用启动到输出该日志信息所耗费的毫秒数
# %t 输出产生该日志的线程名
登录业务实现代码:LoginController.java
,LoginDao.java
,User.java
,LoginService.java
,LoginServiceImpl.java
,LoginMapper.xml.xml
的具体实现请下载源码。
drop database if exists ssm_note;
create database ssm_note;
use ssm_note;
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2019/2/22 1:09:58 */
/*==============================================================*/
drop table if exists USER_LOGIN;
/*==============================================================*/
/* Table: USER_LOGIN */
/*==============================================================*/
create table USER_LOGIN
(
id int not null,
USER_NAME varchar(30) not null,
PASSWORD varchar(20) not null,
REG_TIME datetime not null default CURRENT_TIMESTAMP,
primary key (id)
);
登录页:
欢迎页:
Spring文档:https://spring.io/docs
史上最全的maven的pom.xml文件详解:https://www.cnblogs.com/hafiz/p/5360195.html
Spring 实战(第四版) [美]Craig Walls 著 张卫滨 译
Spring MVC 和 Spring 总结:https://www.cnblogs.com/doudouxiaoye/p/5693399.html
Mybatis 官方文档:http://www.mybatis.org/mybatis-3/zh/index.html
创建Spring的主要目的是用来替代更加重量级的企业级Java技术,尤其是EJB。Spring提供了更加轻量级和简单的编程模型。增强了简单老式Java对象(Plain Old Java Object,POJO)的功能。
为了降低Java开发的复杂性,Spring采取了以下四种关键策略:
- 基于POJO(Plain Old Java Object)的轻量级和最小侵入性编程;
- 通过依赖注入和面向接口实现松耦合;
- 基于切面和管理进行声明式编程;
- 通过切面和模板减少样板式代码。
Spring MVC
基于模型-视图-控制器(Model-View-Controller,MVC)模式实现,能够构建像Spring
框架那样灵活和松耦合的Web应用程序。Spring MVC
是一个基于mvc
的web
框架。Spring MVC
是Spring
框架的一个模块,Spring MVC
和Spring
无需通过中间整合层进行整合。
Mybatis是一款优秀的持久层框架,支持定制化SQL、存储过程以及高级映射。可以使用简单的XML或注解来配置和映射原生信息,将接口和Java的Pojo映射成数据库中的记录。
欢迎扫描下方二维码,关注weyoung公众号,一起交流学习~~
更多联系方式
平台 | 链接 |
---|---|
预览项目: | https://nelucifer.gitee.io/ |
个人微信公众号: | weyoung |
segmentfault: | https://segmentfault.com/u/nelucifer |
CSDN: | https://me.csdn.net/wlx001 |
简书: | https://www.jianshu.com/u/99211cc23788 |
掘金: | https://juejin.im/user/59b08c575188250f4850e80e |