Maven-SSM框架整合
1、创建Maven项目
配置pom.xml依赖
<!-- 允许创建jsp页面 -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<!-- jsp页面标签 -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!-- jsp API -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<!-- servlet Api -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency> <!-- SSM依赖 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.2.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-instrument-tomcat</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-messaging</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc-portlet</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-websocket</artifactId>
<version>4.2.1.RELEASE</version>
</dependency>
<!-- mybatis核心包 -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.40</version>
</dependency>
<!-- jackjson,支持接口返回输出json格式 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.2.1</version>
</dependency>
<!--打印日志 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency> <!-- 文件上传处理 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.2</version>
</dependency>
<build>
<finalName>SSM-project</finalName>
<plugins>
<!--JDK版本 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<showWarnings>true</showWarnings>
</configuration>
</plugin> <!-- Tomcat7插件 -->
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<!-- tomcat7的插件, 不同tomcat版本这个也不一样 -->
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
<configuration>
<!-- 通过maven tomcat7:run运行项目时,访问项目的端口号 -->
<port>8080</port>
<!-- 项目访问路径 本例:localhost:9090, 如果配置的aa, 则访问路径为localhost:9090/aa -->
<path>/SpringMVC_Maven</path>
<uriEncoding>UTF-8</uriEncoding>
</configuration>
</plugin>
</plugins>
</build>
2、导入db.properties
dataSource.driverName=com.mysql.jdbc.Driver
dataSource.jdbcUrl=jdbc:mysql://{主机IP}/{数据库名称}
dataSource.user={数据库用户名}
dataSource.password={数据库密码}
导入日志:log4j.properties
log4j.rootLogger=Console,File
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.Target=System.out
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=[%c]%m%n
log4j.appender.File=org.apache.log4j.RollingFileAppender
log4j.appender.File.File=../log/error.log
log4j.appender.File.MaxFileSize=10MB
log4j.appender.File.Threshold=ALL
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=[%p][%d{yyyy-MM-dd HH\:mm\:ss,SSS}][%c]%m%n
3、配置springMVC配置文件:src/main/resources/springmvc/springmvc-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<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: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.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- 扫描器,指定DispatcherServlet去扫描当前包名下的所有类, base-package属性不能精确到类级别,只能到包级别 -->
<context:component-scan
base-package="com.maven.controller" />
<!-- exception -->
<context:component-scan
base-package="com.maven.exception" />
<!-- 视图解析器 -->
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean> <!-- 解决@ResponseBody中文乱码 -->
<mvc:annotation-driven>
<mvc:message-converters>
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8" />
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<!-- 文件上传配置 -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- defaultEncoding:请求的编码格式必须和用户JSP的编码一致,以便正确读取表单中的内容。
uploadTempDir:文件上传过程中的临时目录,上传完成后,临时文件会自动删除
maxUploadSize:设置文件上传大小上限(单位为字节)-1为无限制 -->
<property name="defaultEncoding" value="UTF-8" />
<property name="maxUploadSize" value="102400000" />
<!-- uploadTempDir可以不做设置,有默认的路径,上传完毕会临时文件会自动被清理掉 -->
<property name="uploadTempDir" value="/upload/"></property>
</bean> <!-- 处理器映射器 -->
<!-- <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"
/> --> <!-- 处理器适配器 -->
<!-- <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter"
/> --> <!-- 配置注解驱动,配置之后就不用配置处理器映射器和处理器适配器了 -->
<mvc:annotation-driven />
<!-- 静态资源不拦截 -->
<mvc:resources location="/staitcSources/"
mapping="/staitcSources/**" /> <!-- 配置拦截器,可以配置多个拦截器,按顺序执行 -->
<!-- <mvc:interceptors>
第一个拦截器
<mvc:interceptor>
<mvc:mapping path="/**" /> 所有请求都拦截
<mvc:exclude-mapping path="/staticRescoures/**"/> 静态资源不拦截
<bean class="org.sprigmvc.Interceptor.MyInterceptor1" />
</mvc:interceptor>
第二个拦截器
<mvc:interceptor>
<mvc:mapping path="/**" /> 所有请求都拦截
<mvc:exclude-mapping path="/staticRescoures/**"/> 静态资源不拦截
<bean class="org.sprigmvc.Interceptor.MyInterceptor2" />
</mvc:interceptor>
</mvc:interceptors> -->
</beans>
4、配置mybaits配置文件:src/main/resources/mybaits/mybatis-config.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration>
<!-- 别名 -->
<typeAliases>
<typeAlias type="com.maven.pojo.animalPojo" alias="Animal"/>
<typeAlias type="com.maven.pojo.cttablePojo" alias="Cttable"/>
</typeAliases>
</configuration>
5、配置spring配置文件:/resources/spring/applicationContent-dao.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd"> <!-- 数据源 -->
<context:property-placeholder
location="classpath:db.properties" ignore-unresolvable="true" />
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${dataSource.driverName}" />
<property name="url" value="${dataSource.jdbcUrl}" />
<property name="username" value="${dataSource.user}" />
<property name="password" value="${dataSource.password}" />
</bean>
<!-- 会话工厂 -->
<bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<!-- 载入mybaits配置文件 -->
<property name="configLocation"
value="classpath:mybaits/mybatis-config.xml"></property>
<!-- 载入SQL映射文件 -->
<property name="mapperLocations"
value="classpath:com/maven/dao/*.xml"></property>
</bean>
<!-- 事务管理器 -->
<bean id="txManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean> <!-- 事务注解驱动,注解@Transactional的类和方法将具有事务性
<tx:annotation-driven transaction-manager="txManager" />--> <!-- 配置事务增强处理Bean,指定事务管理器 -->
<tx:advice id="txAdvice"
transaction-manager="txManager">
<!-- 用于配置详细的事务传播、隔离、是否只读等属性, 这些属性会封装到底层事务代码中的TransactionDefinition中 -->
<tx:attributes>
<!-- 所有以'get'开头的方法是read-only的 事务的隔离性isolation="DEFAULT" 事务的传播行为 propagation="REQUIRED"
REQUIRED 支持当前的事务,如果不存在就创建一个新的。这是最常用的选择。 SUPPORTS 支持当前的事务,如果不存在就不使用事务。 MANDATORY
支持当前的事务,如果不存在就抛出异常。 REQUIRES_NEW 创建一个新的事务,并暂停当前的事务(如果存在)。 NOT_SUPPORTED 不使用事务,并暂停当前的事务(如果存在)。
NEVER 不使用事务,如果当前存在事务就抛出异常。 NESTED 如果当前存在事务就作为嵌入事务执行,否则与REQUIRED类似。 事务的超时
timeout="-1" -1为永不超时,8代表8秒超时 -->
<tx:method name="get*,login*" read-only="true"
isolation="DEFAULT" propagation="REQUIRED" timeout="-1" />
<!-- 其他方法使用默认的事务设置 -->
<tx:method name="*" />
</tx:attributes>
</tx:advice> <aop:config>
<!-- 配置一个切入点,org.fkjava.service以及子包下面的所有类需要做事务 -->
<aop:pointcut id="pointcut"
expression="execution(* com.maven.service..*ServiceImpl.*(..))" /> <!-- 指定在pointcut切入点应用txAdvice事务增强处理 aop:advisor的作用是在已有的advice前提下,通过该元素指定将advice织入哪些位置 -->
<aop:advisor advice-ref="txAdvice" pointcut-ref="pointcut" />
</aop:config> </beans>
配置spring-service层:/resources/spring/applicationContent-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd"> <beans>
<bean id="userdao" class="com.maven.service.impl.UserServiceImpl" p:sqlSessionFactory-ref="sqlSessionFactory"></bean>
</beans>
</beans>
6、配置web.xml
<!-- log4j配置 -->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener> <!-- Spring容器加载所有的配置文件的路径 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring/applicationContent-*.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener> <!-- 配置SpringMVC核心控制器 -->
<servlet>
<servlet-name>MVC</servlet-name>
<!-- SpringMVC的中央处理器:DispathcherServlet有,其成为分派器, 把所有的请求url分派给其他的处理器 -->
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc/springmvc-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup> <!-- 加载的时候就启动 -->
</servlet>
<servlet-mapping>
<servlet-name>MVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping> <!-- 解决中文乱码 -->
<filter>
<filter-name>EncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>EncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <!-- 404页面 -->
<error-page>
<error-code>404</error-code>
<location>/404.jsp</location>
</error-page>
自此,最基本的配置就完成了,用的时候注意改相对应的配置文件地址
7、最简单的测试
UserLoginController:
package com.maven.controller; import java.util.List; import javax.annotation.Resource; import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.portlet.ModelAndView; import com.maven.pojo.animalPojo;
import com.maven.service.UserService; @Controller
public class UserLoginController {
@Resource(name="userdao")
private UserService userservice;
@RequestMapping(value="/home")
@ResponseBody
public ModelAndView login(ModelAndView mv) {
List<animalPojo> list=userservice.getAllDate();
mv.setViewName("home");
mv.addObject("json", list);
System.out.println(list);
return mv;
}
}
animalMapper,java
package com.maven.dao; import java.util.List; import com.maven.pojo.animalPojo; public interface animalMapper {
List<animalPojo> selectAllData();
}
animalMapper.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.maven.dao.animalMapper">
<resultMap type="Animal" id="AnimalResultMap">
<id column="id" property="id"/>
<result column="Species_id" property="SpeciesId"/>
<result column="animal" property="animalName"/>
</resultMap>
<select id="selectAllData" resultMap="AnimalResultMap">
select *from animal
</select>
</mapper>
animalPojo.java
package com.maven.pojo; public class animalPojo {
private int id;
private String SpeciesId;
private String animalName;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getSpeciesId() {
return SpeciesId;
}
public void setSpeciesId(String speciesId) {
SpeciesId = speciesId;
}
public String getAnimalName() {
return animalName;
}
public void setAnimalName(String animalName) {
this.animalName = animalName;
}
@Override
public String toString() {
return "animalPojo [id=" + id + ", SpeciesId=" + SpeciesId + ", animalName=" + animalName + "]";
}
public animalPojo() {
super();
// TODO Auto-generated constructor stub
}
public animalPojo(int id, String speciesId, String animalName) {
super();
this.id = id;
SpeciesId = speciesId;
this.animalName = animalName;
} }
cttablePojo.java
package com.maven.pojo; public class cttablePojo {
private Integer id;
private String Species;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getSpecies() {
return Species;
}
public void setSpecies(String species) {
Species = species;
}
@Override
public String toString() {
return "cttablePojo [id=" + id + ", Species=" + Species + "]";
}
public cttablePojo() {
super();
// TODO Auto-generated constructor stub
}
public cttablePojo(Integer id, String species) {
super();
this.id = id;
Species = species;
} }
UserService.java
package com.maven.service; import java.util.List; import com.maven.pojo.animalPojo; public interface UserService {
/**
* 获取animal所有的数据
* */
List<animalPojo> getAllDate();
}
UserServiceImpl.java
package com.maven.service.impl; import java.util.List; import javax.annotation.Resource; import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Repository; import com.maven.dao.animalMapper;
import com.maven.pojo.animalPojo;
import com.maven.service.UserService; public class UserServiceImpl implements UserService { private SqlSessionFactory sqlSessionFactory; public SqlSessionFactory getSqlSessionFactory() {
return sqlSessionFactory;
} public void setSqlSessionFactory(SqlSessionFactory sqlSessionFactory) {
this.sqlSessionFactory = sqlSessionFactory;
}
public UserServiceImpl() {}
@Override
public List<animalPojo> getAllDate() {
// TODO Auto-generated method stub
SqlSession session=sqlSessionFactory.openSession();
animalMapper am=session.getMapper(animalMapper.class);
return am.selectAllData();
} }
结果:
Maven-SSM框架整合的更多相关文章
- IDEA + Maven + SSM 框架整合步骤
因为前段时间自己想写个SSM的demo,然而不知怎么回事,配置完之后出现错误,怎么都调不好.最后从朋友那里拷了一个SSM的demo过来搭建成功,写这篇东西也是为了以后如果还有需要可以方便的查阅,并且也 ...
- 基于maven的ssm框架整合
基于maven的ssm框架整合 第一步:通过maven建立一个web项目. 第二步:pom文件导入jar包 (1 ...
- 01 整合IDEA+Maven+SSM框架的高并发的商品秒杀项目之业务分析与DAO层
作者:nnngu 项目源代码:https://github.com/nnngu/nguSeckill 这是一个整合IDEA+Maven+SSM框架的高并发的商品秒杀项目.我们将分为以下几篇文章来进行详 ...
- 使用IntelliJ IDEA创建Maven聚合工程、创建resources文件夹、ssm框架整合、项目运行一体化
一.创建一个空的项目作为存放整个项目的路径 1.选择 File——>new——>Project ——>Empty Project 2.WorkspaceforTest为项目存放文件夹 ...
- 【转载】使用IntelliJ IDEA创建Maven聚合工程、创建resources文件夹、ssm框架整合、项目运行一体化
一.创建一个空的项目作为存放整个项目的路径 1.选择 File——>new——>Project ——>Empty Project 2.WorkspaceforTest为项目存放文件夹 ...
- IDEA下基于MAVEN的SSM框架整合
源码可以以上传github https://github.com/ingxx/ssm_first 最近把用IDEA把SSM框架整合一遍遇到了不少坑,在这里写出来 这里maven我使用的是自己下载的3. ...
- 史上最详细的IDEA优雅整合Maven+SSM框架(详细思路+附带源码)
目录 前言: 1. 搭建整合环境 2.Spring框架代码的编写 3.SpringMVC框架代码的编写 4. Spring整合SpringMVC的框架 5.MyBatis框架代码的编写 6. Spri ...
- [JSP]Maven+SSM框架(Spring+SpringMVC+MyBatis) - Hello World
来源:http://blog.csdn.net/zhshulin/article/details/37956105?utm_source=tuicool&utm_medium=referral ...
- SSM框架整合环境构建——基于Spring4和Mybatis3
目录 环境 配置说明 所需jar包 配置db.properties 配置log4j.properties 配置spring.xml 配置mybatis-spring.xml 配置springmvc.x ...
- Maven+SSM框架(Spring+SpringMVC+MyBatis)(二)
1.基本概念 2.开发环境搭建 3.Maven Web项目创建 4.SSM整合 此次整合我分两个配置文件: 1)分别是spring-mybatis.xml,包含spring和mybatis的配置文件, ...
随机推荐
- JDBC概述及JDBC完成对Oracle的增删改查
什么是JDBC JDBC(Java Data Base Connectivity,Java数据库连接),是一种用于执行SQL语句的Java API,为多种关系数据库提供统一访问.它由一组用Java语言 ...
- python面向编程;类的绑定与非绑定方法、反射、内置方法
一.类的绑定与非绑定方法 ''' 类中定义函数分为了两大类: 1. 绑定方法 特殊之处: 绑定给谁就应该由谁来调用,谁来调用就会将谁当做第一个参数自动传入 绑定给对象的方法: 在类中定义函数没有被任何 ...
- Sass的混合-@mixin,@include
1,无参数,有参数和带默认值参数的@mixin声明sass文件内容: //带参数,默认50@mixin opa($opa:50){ opacity: $opa / 100; filter:alpha( ...
- ubuntu下python3.6.5import tensorflow显示非法指令(核心已转储)
1.版本 ubuntu版本为14.04 python为3.6.5 tensorflow为pip3安装的1.8.0版本 2.解决 删除原先的tensorflow:sudo pip3 uninstall ...
- BZOJ 1006 完美消除序列&最大势算法&弦图
K国是一个热衷三角形的国度,连人的交往也只喜欢三角原则.他们认为三角关系:即AB相互认识,BC相互认识,CA相互认识,是简洁高效的.为了巩固三角关系,K国禁止四边关系,五边关系等等的存在.所谓N边关系 ...
- 博弈论BOSS
基础博弈的小结:http://blog.csdn.net/acm_cxlove/article/details/7854530 经典翻硬币游戏小结:http://blog.csdn.net/acm_c ...
- CSS基础学习-13.CSS 浮动
如果前一个元素设置浮动属性,则之后的元素也会继承float属性,我觉得这里说是继承不太对,可以理解为会影响到之后的元素,所以在设置浮动元素之后的元素要想不被影响就需要清除浮动.元素设置左浮动,则清除左 ...
- Python把多行文本合并
在引用论文时,往往格式出错,出现非常多行,这样操作非常不方便.这种方法讲多行合并之后,再处理: # 文件空格和回车键处理工具infile = r'C:\Users\SAM\Desktop\新建文本文档 ...
- 【51nod 2004】终结之时
题目大意 "将世界终结前最后的画面,深深刻印进死水般的心海." 祈愿没有得到回应,雷声冲破云霄,正在祈愿的洛天依受到了极大的打击. 洛天依叹了口气,说:"看来这个世界正如 ...
- Vue3.0+TypeScript
序言 资料 https://www.cnblogs.com/chanwahfung/p/11968205.html