一、以用户注册和列出用户功能说明ssm如何整合
二、新建一个maven工程,大致模样如下
三、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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ssm</groupId>
<artifactId>ssm-Integration</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>ssm-Integration Maven Webapp</name>
<url>http://maven.apache.org</url>
<!-- 集中定义依赖版本号 -->
<properties>
<junit.version>4.9</junit.version>
<spring.version>4.2.6.RELEASE</spring.version>
<mybatis.version>3.4.0</mybatis.version>
<mybatis.spring.version>1.3.0</mybatis.spring.version>
<mysql.version>6.0.2</mysql.version>
<slf4j.version>1.7.20</slf4j.version>
<druid.version>1.0.23</druid.version>
<jstl.version>1.2</jstl.version>
<servlet-api.version>3.1.0</servlet-api.version>
<standard.version>1.1.2</standard.version>
</properties> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<!-- 日志处理 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<!-- Mybatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${mybatis.spring.version}</version>
</dependency>
<!-- MySql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.version}</version>
</dependency>
<!-- 连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid.version}</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
<version>${spring.version}</version>
</dependency>
<!-- JSP相关 -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency> <dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>${standard.version}</version>
</dependency> <dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${servlet-api.version}</version>
<scope>provided</scope>
</dependency>
</dependencies> <build>
<finalName>${project.artifactId}</finalName>
<plugins>
<!-- java编译插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<!-- 配置Tomcat插件 -->
<plugin>
<!-- 命令为clean tomcat7:run -->
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<configuration>
<port>8888</port>
<path>/</path>
</configuration>
<version>2.2</version>
</plugin>
</plugins>
</build>
</project>
四、web.xml
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1" metadata-complete="true"> <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/springContext-*.xml</param-value>
</context-param> <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <servlet>
<servlet-name>springMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/springMVC-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<filter>
<filter-name>characterEncodingFilter</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>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> </web-app>
五、配置文件
1、src/main/resources/mybatis/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>
<!-- 设置全局配置 -->
<settings>
<!-- 使用主键自增策略 -->
<setting name="useGeneratedKeys" value="true" />
<!-- select name as title from user 用于识别别名, -->
<setting name="useColumnLabel" value="true" />
<!-- 开启驼峰命名转换,如:table中(create_time)->entity(createTime)这样在sql语句中就不需要使用as来显式的去定义别名 -->
<setting name="mapUnderscoreToCamelCase" value="true" />
</settings> </configuration>
2、src/main/resources/mybatis/mapper/User.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.ssm.mapper.UserDao">
<insert id="save" parameterType="User">
insert into t_user values(null, #{username}, #{age}, #{date})
</insert> <update id="update"> update t_user set username=#{username}, age=#{age}, birthday=#{date}
</update> <delete id="delete">
delete from t_user where id=#{id}
</delete> <select id="getUsers" resultType="User">
select id, username, age, birthday as date from t_user </select> </mapper>
3、src/main/resources/resources/jdbc.properties
jdbc.driverClassName=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/test?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC
jdbc.username=root
jdbc.password=root
4、src/main/resources/spring/springContext-dao.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:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.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
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd"> <context:property-placeholder location="classpath:resources/*.properties" /> <!-- 数据源配置, 使用 Druid 数据库连接池 -->
<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
init-method="init" destroy-method="close"> <property name="driverClassName" value="${jdbc.driverClassName}" /> <!-- 基本属性 url、user、password -->
<property name="url" value="${jdbc.url}" />
<property name="username" value="${jdbc.username}" />
<property name="password" value="${jdbc.password}" /> <!-- 配置初始化大小、最小、最大 -->
<property name="initialSize" value="1" />
<property name="minIdle" value="1" />
<property name="maxActive" value="5" /> <!-- 配置获取连接等待超时的时间 -->
<property name="maxWait" value="10000" /> </bean> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="configLocation" value="classpath:mybatis/mybatis-config.xml"></property>
<!-- 定义别名,如果使用了mybatis的逆向工程,无需这个,因为配置文件是自动生成的,不用你写。 -->
<property name="typeAliasesPackage" value="com.ssm.pojo"></property> <property name="mapperLocations" value="classpath:mybatis/mapper/*.xml"></property>
<!-- 配置映射文件的位置,如果配置文件与mapper接口在同一个位置,可以不写 -->
<!-- <property name="mapperLocations">
<array>
<value>classpath:mybatis/mapper/User.xml</value>
</array>
</property> --> </bean> <!-- 将mybatis实现的接口注入到spring容器中 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"></property>
<property name="basePackage" value="com.ssm.mapper"></property>
</bean> </beans>
5、src/main/resources/spring/springContext-service.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:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.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
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<!-- 扫描这个包下以及子包的内容 -->
<context:component-scan base-package="com.ssm.service"></context:component-scan> </beans>
6、src/main/resources/spring/springContext-trascation.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:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.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
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd"> <aop:config>
<aop:advisor advice-ref="txAdvice"
pointcut="execution(* com.ssm.service..*.*(..))" />
</aop:config> <tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<!-- 传播行为REQUIRED时,有实物就是用但钱事务,没有就自动创建一个新的事务 -->
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<!-- SUPPORTS有事务就支持事务,没有就没有 -->
<tx:method name="*" propagation="SUPPORTS" read-only="true" />
</tx:attributes>
</tx:advice> <bean id="txManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource" />
</bean> </beans>
7、src/main/resources/spring/springMVC-servlet.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:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.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
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<context:component-scan base-package="com.ssm.controller"></context:component-scan> <bean id="formattingConversionService"
class="org.springframework.format.support.FormattingConversionServiceFactoryBean">
<property name="formatters">
<set>
<bean class="com.ssm.convert.DateFormatter">
<constructor-arg name="datePattern" value="yyyy-MM-dd"></constructor-arg>
</bean>
</set>
</property>
</bean> <!-- 开启mvc注解,可使用@DateTimeFormat,@NumberFormat -->
<mvc:annotation-driven conversion-service="formattingConversionService"></mvc:annotation-driven> <mvc:resources location="/WEB-INF/css/" mapping="/css/**"></mvc:resources> <bean id="internalResourceViewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView"></property>
<property name="prefix" value="/WEB-INF/jsp/"></property>
<property name="suffix" value=".jsp"></property>
</bean> </beans>
8、src/main/resources/log4j.properties
log4j.rootLogger=DEBUG,A1
log4j.logger.org.mybatis = DEBUG
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss,SSS} [%t] [%c]-[%p] %m%n
六、Java文件
1、com.ssm.pojo.User
package com.ssm.pojo; import java.util.Date; public class User { private int id; private String username; private int age; private String password; private Date date; public User(String username, int age, String password, Date date) {
this.username = username;
this.age = age;
this.password = password;
this.date = date; } public User() { } public String getPassword() {
return password;
} public void setPassword(String password) {
this.password = password;
} public int getId() {
return id;
} public void setId(int id) {
this.id = id;
} public String getUsername() {
return username;
} public void setUsername(String username) {
this.username = username;
} public int getAge() {
return age;
} public void setAge(int age) {
this.age = age;
} public Date getDate() {
return date;
} public void setDate(Date date) {
this.date = date;
} }
2、com.ssm.controller.UserController
package com.ssm.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping; import com.ssm.pojo.User;
import com.ssm.service.UserService; @Controller
@RequestMapping("/user")
public class UserController { @Autowired
private UserService userService; public UserController() { } @RequestMapping("/register")
public String save(@ModelAttribute("user") User user) {
int row = userService.save(user);
if(row > 0) {
return "success"; }
return "register";
} @RequestMapping("/index")
public String register() { return "register";
} @RequestMapping("/list")
public String list_user(Model model) {
List<User> users = userService.getUsers();
model.addAttribute("users", users);
return "userList";
} }
3、com.ssm.service.UserService
package com.ssm.service; import java.util.List; import com.ssm.pojo.User; public interface UserService { int save(User user); int update(User user); List<User> getUsers(); User validateUser(User user); int delete(int id); int register(User user); }
4、com.ssm.service.impl.UserService
package com.ssm.service.impl; import java.util.Collections;
import java.util.List; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import com.ssm.mapper.UserDao;
import com.ssm.pojo.User;
import com.ssm.service.UserService; @Service
public class UserServiceImpl implements UserService { @Autowired
private UserDao userDao; @Override
public int save(User user) {
return userDao.save(user);
} @Override
public int update(User user) {
return userDao.update(user);
} @Override
public User validateUser(User user) {
return userDao.validateUser(user);
} @Override
public int delete(int id) {
return userDao.delete(id);
} @Override
public int register(User user) {
return userDao.register(user);
} @Override
public List<User> getUsers() {
List<User> users = userDao.getUsers();
if(null == users) {
users = Collections.emptyList(); } return users;
} }
5、com.ssm.mapper.UserDao
package com.ssm.mapper; import java.util.List; import com.ssm.pojo.User; public interface UserDao { int save(User user); int update(User user); List<User> getUsers(); User validateUser(User user); int delete(int id); int register(User user); }
6、com.ssm.convert.DateFormatter
package com.ssm.convert; import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale; import org.springframework.format.Formatter; public class DateFormatter implements Formatter<Date> { private String datePattern;
private SimpleDateFormat simpleDateFormat = null; public DateFormatter(String datePattern) {
this.datePattern = datePattern; } @Override
public String print(Date date, Locale locale) {
simpleDateFormat = new SimpleDateFormat(datePattern);
String dateStr = simpleDateFormat.format(date);
return dateStr;
} @Override
public Date parse(String dateStr, Locale locale) throws ParseException {
simpleDateFormat = new SimpleDateFormat(datePattern);
Date date = simpleDateFormat.parse(dateStr);
return date;
} }
七、view文件
1、register.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<style type="text/css">
#register {
width:400px;
height:400px;
margin:0 auto;
padding:10px;
background-color: green;
} #register form {
margin-top:80px
} #register div {
padding:10px; text-align:center; }
</style>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<div id="register">
<form action="/user/register" method="post">
<div>用户名:<input type="text" name="username" /></div>
<div>年 龄:<input type="text" name="age" /></div>
<div>密 码:<input type="password" name="password" /></div>
<div>生 日:<input type="text" name="date" /></div>
<div><input type="submit" value="提交" /></div>
</form>
</div> </body>
</html>
2、success.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
恭喜${user.username },注册成功!
</body>
</html>
3、userList.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>user list</title>
<!-- 引入的是bootstrap的css样式 -->
<link rel="stylesheet" href="/css/bootstrap.min.css">
<style type="text/css">
#main{
width:400px;
margin:0 auto;
} </style> </head>
<body> <div id="main">
<table class="table table-bordered table-hover table-condensed">
<caption style="text-align:center; font-size:18px;">user list</caption>
<tr>
<th>姓名</th>
<th>年龄</th>
<th>生日</th>
</tr> <c:forEach items="${users }" var="t_user">
<tr>
<td>${t_user.username }</td>
<td>${t_user.age }</td>
<td><fmt:formatDate value="${t_user.date }" pattern="yyyy-MM-dd" /></td>
</tr>
</c:forEach> </table> </div> </body>
</html>
八、在项目上右击debug as 输入clean tomcat7:run运行
1、http://localhost:8888/user/index
2、http://localhost:8888/user/list
ssm整合的更多相关文章
-
Maven + 最新SSM整合
. 1. 开发环境搭建 参考博文:Eclipse4.6(Neon) + Tomcat8 + MAVEN3.3.9 + SVN项目完整环境搭建 2. Maven Web项目创建 2.1. 2.2. 2. ...
-
SSM整合配置
SSM三大框架整合详细教程(Spring+SpringMVC+MyBatis) 使用SSM(Spring.SpringMVC和Mybatis)已经有三个多月了,项目在技术上已经没有什么难点了,基于现有 ...
-
SSM整合中遇到的不能扫描注解的bug
我的开发环境为: ubuntu14.04LTS 64bit; Spring Tool Suite 3.5.0.RELEASE Maven 3.2.3 SSM整合中遇到的不能扫描注解的bug 最终解决 ...
-
基于Maven的SSM整合的web工程
此文章主要有以下几个知识点: 一.如何创建 Maven的Web 工程 二.整合SSM(Spring,SpringMvc,Mybatis),包括所有的配置文件 三.用 mybatis 逆向工程生成对应的 ...
-
ssm整合说明与模板-Spring Spring MVC Mybatis整合开发
ssm整合说明 spring+spring mvc+mybatis 说明 源码下载 由于之前存在ssh框架,spring+struts+hibernate,其中spring负责aop与ioc,所以一般 ...
-
04.redis集群+SSM整合使用
redis集群+SSM整合使用 首先是创建redis-cluster文件夹: 因为redis最少需要6个节点(三主三从),为了更好的理解,我这里创建了两台虚拟机(192.168.0.109 192.1 ...
-
SSM整合---实现全部用户查询
SSM整合 准备 1.创建工程 2.导入必须jar包 链接: https://pan.baidu.com/s/1nvCDQJ3 密码: v5xs 3.工程结构 代码 SqlMapConfig < ...
-
spring MVC框架入门(外加SSM整合)
spring MVC框架 一.什么是sping MVC Spring MVC属于SpringFrameWork的后续产品,已经融合在Spring Web Flow里面.Spring 框架提供了构建 W ...
-
SpringMVC之简单的增删改查示例(SSM整合)
本篇文章主要介绍了SpringMVC之简单的增删改查示例(SSM整合),这个例子是基于SpringMVC+Spring+Mybatis实现的.有兴趣的可以了解一下. 虽然已经在做关于SpringMVC ...
-
ssm 整合(方案二 maven)
通过maven来整合ssm方便很多,至少不用去找jar包 具体架构如下: 1.配置pom.xml <project xmlns="http://maven.apache.org/POM ...
随机推荐
-
Maximum number of WAL files in the pg_xlog directory (1)
Guillaume Lelarge: Hi, As part of our monitoring work for our customers, we stumbled upon an issue ...
-
jQuery+AJAX实现网页无刷新上传
新年礼,提供简单.易套用的 jQuery AJAX上传示例及代码下载.后台对文件的上传及检查,以 C#/.NET Handler 处理 (可视需要改写成 Java 或 PHP). 有时做一个网站项目 ...
-
状压dp(状态压缩&;&;dp结合)学习笔记(持续更新)
嗯,作为一只蒟蒻,今天再次学习了状压dp(学习借鉴的博客) 但是,依旧懵逼·································· 这篇学习笔记是我个人对于状压dp的理解,如果有什么不对的 ...
-
day 16 - 1 内置函数(二)
内置函数(二) reversed() 返回一个反向的迭代器 k = [1,2,3,4,5] k.reverse() #反转 print(k) k = [1,2,3,4,5] k2 = reverse ...
-
datatable 添加列之前判断是否存在该列
if (!dt.Columns.Contains("BDate")) { DataColumn dc1 = new DataColumn("BDate", ty ...
-
Cookie保存用户名和密码
首次登录: 第二次登录: 百度网盘: 链接: https://pan.baidu.com/s/12W4B5-Bfyc_021oyVYkEJw 提取码: r55h
-
十七、 Observer 观察者设计模式
设计: 代码清单: Observer public interface Observer { void update(NumberGenerator generator); } DigitObserv ...
-
springboot自带定时任务和集成quartz
1,springboot自带的定时任务 默认是单线程 有这个依赖就可以 <dependency> <groupId>org.springframework.boot</ ...
-
Python之路(第十五篇)sys模块、json模块、pickle模块、shelve模块
一.sys模块 1.sys.argv 命令行参数List,第一个元素是程序本身路径 2.sys.exit(n) 退出程序,正常退出时exit(0) 3.sys.version . sys.maxint ...
-
封装,策略,Asp换脸
封装.策略 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespac ...