SSM框架整合思路
SSM框架整合思路
Spring在整合中起到的作用(面试时常问到)
Spring管理持久层的mapper。
Spring管理业务层的service,service可以调用mapper接口。Spring进行事物控制。
Spring管理表现层的Handler,handler可以调用service接口。
mapper,service,handler都是javabean。
Spring的核心(面试时常问到)
Ioc:依赖注入、控制反转。意思是在一个类中不用new关键字来声明对象,而是在xml文件中配置相应的节点即可,这样使整个程序变得灵活多样。
aop:面对切面编程。Spring中AOP代理由Spring的IOC容器负责生成、管理,其依赖关系也由IOC容器负责管理。
工程结构
管理mybatis的 xml 文件(单独使用mybatis时需要配置许多,如数据库连接等,现与Spring进行整合,这些东西配置在了管理Spring的xml文件中)
SqlMapConfig.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>
<package name="cn.itcast.ssm.po"/>
</typeAliases>
<!-- <mappers>
<package name="cn.study.ssm.mapper" />
</mappers> -->
</configuration>
Spring配置文件
log4j.properties(日志文件,直接复制即可,开发模式使用DEBUG)
# Global logging configuration
#
log4j.rootLogger=DEBUG, stdout
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n
数据库连接文件
db.properties(账号密码是我的数据库的,修改即可)
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/device?characterEncoding=utf-8
jdbc.username=root
jdbc.password=root
applicationContext-dao.xml(Spring管理持久层的mapper)
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd "> <!-- 加载配置文件 -->
<context:property-placeholder location="classpath:db.properties"/>
<!-- 数据库连接池 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
<property name="maxActive" value="10"/>
<property name="maxIdle" value="5"/>
</bean> <!-- SqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<!-- 数据源 -->
<property name="dataSource" ref="dataSource" /> <!--配置mybatis文件 -->
<property name="configLocation"
value="classpath:mybatis/SqlMapConfig.xml" />
</bean> <!-- mapper扫描器 -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 扫描包路径,如果扫描多个包,中间用半角逗号隔开 -->
<property name="basePackage" value="cn.itcast.ssm.mapper"/>
<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>
</bean>
</beans>
applicationContext-service.xml(Spring管理业务层的service)
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd "> <!-- 留言管理的service -->
<bean id="liuyanService"
class="cn.itcast.ssm.service.impl.LiuyanServiceImpl" />
</beans>
applicationContext-transaction.xml(Spring进行事物控制)
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd "> <!-- 事务控制器 -->
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<!-- 数据源 -->
<property name="dataSource" ref="dataSource"></property>
</bean> <!-- 通知 -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<!-- 传播行为 -->
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="delete*" propagation="REQUIRED" />
<tx:method name="insert*" propagation="REQUIRED" />
<tx:method name="update*" propagation="REQUIRED" />
<tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="get*" propagation="SUPPORTS" read-only="true"/>
<tx:method name="select*" propagation="SUPPORTS" read-only="true"/>
</tx:attributes>
</tx:advice> <!-- aop:面向切面编程 -->
<aop:config>
<aop:advisor advice-ref="txAdvice"
pointcut="execution(* cn.itcast.ssm.service.impl.*.*(..))"/>
</aop:config> </beans>
springmvc.xml(Spring管理表现层的Handler)
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd "> <context:component-scan
base-package="cn.itcast.ssm.controller" >
</context:component-scan> <mvc:annotation-driven></mvc:annotation-driven> <!-- 视图解析器
解析jsp解析,默认使用jstl标签,classpath下的得有jstl的包-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" >
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>Device_web1.1</display-name>
<!-- 加载spring容器 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/spring/applicationContext-*.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.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>*.action</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>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
代码实现流程
LiuyanMapper.xml-->LiuyanMapper.java-->LiuyanService.java-->LiuyanServiceImpl.java-->LiuyanController.java-->jsp
LiuyanMapper.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"> <!-- namespace命名空间,作用是对sql分类隔离
--> <mapper namespace="cn.itcast.ssm.mapper.LiuyanMapper"> <select id="findLiuyanList" parameterType="cn.itcast.ssm.po.LiuyanQueryVo"
resultType="cn.itcast.ssm.po.LiuyanCustom">
SELECT * FROM liuyan ORDER BY TIMER DESC
</select> <select id="findLiuyanByname" parameterType="java.lang.String"
resultType="cn.itcast.ssm.po.LiuyanCustom">
SELECT * FROM liuyan WHERE liuyan LIKE '%${value}%'
</select> <insert id="insertLiuyan" parameterType="cn.itcast.ssm.po.Liuyan">
insert into liuyan(liuyan) value(#{liuyan})
</insert> <update id="updateLiuyan" parameterType="cn.itcast.ssm.po.Liuyan">
UPDATE liuyan SET liuyan=#{liuyan} WHERE id=#{id}
</update> <select id="findLiuyanBynameOne" parameterType="java.lang.String"
resultType="cn.itcast.ssm.po.LiuyanCustom">
SELECT * FROM liuyan WHERE liuyan=#{liuyan}
</select> <delete id="deleteLiuyanBynameOne" parameterType="java.lang.String">
DELETE FROM liuyan WHERE liuyan=#{liuyan}
</delete>
</mapper>
LiuyanMapper.java
package cn.itcast.ssm.mapper; import java.util.List; import cn.itcast.ssm.po.Liuyan;
import cn.itcast.ssm.po.LiuyanCustom;
import cn.itcast.ssm.po.LiuyanQueryVo; public interface LiuyanMapper { public List<LiuyanCustom> findLiuyanList(LiuyanQueryVo liuyanQueryVo) throws Exception; public List<LiuyanCustom> findLiuyanByname(String liuyan) throws Exception; public Liuyan findLiuyanBynameOne(String liuyan) throws Exception; public void insertLiuyan(Liuyan liuyan) throws Exception; int updateLiuyan(Liuyan liuyan) throws Exception; public void deleteLiuyanBynameOne(String liuyan) throws Exception;
}
LiuyanService.java
package cn.itcast.ssm.service; import java.util.List; import cn.itcast.ssm.po.Liuyan;
import cn.itcast.ssm.po.LiuyanCustom;
import cn.itcast.ssm.po.LiuyanQueryVo; public interface LiuyanService { public List<LiuyanCustom> findLiuyanList(LiuyanQueryVo liuyanQueryVo) throws Exception; public List<LiuyanCustom> findLiuyanByname(String liuyan) throws Exception; public Liuyan findLiuyanBynameOne(String liuyan) throws Exception; public void insertLiuyan(Liuyan liuyan) throws Exception; int updateLiuyan(Integer id,Liuyan liuyan) throws Exception; public void deleteLiuyanBynameOne(String liuyan) throws Exception;
}
LiuyanServiceImpl.java
package cn.itcast.ssm.service.impl; import java.util.List; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired; import cn.itcast.ssm.mapper.LiuyanMapper;
import cn.itcast.ssm.po.Liuyan;
import cn.itcast.ssm.po.LiuyanCustom;
import cn.itcast.ssm.po.LiuyanQueryVo;
import cn.itcast.ssm.service.LiuyanService; public class LiuyanServiceImpl implements LiuyanService{ @Autowired
private LiuyanMapper liuyanMapper;
@Override
public List<LiuyanCustom> findLiuyanList(LiuyanQueryVo liuyanQueryVo) throws Exception {
// TODO 自动生成的方法存根
return liuyanMapper.findLiuyanList(liuyanQueryVo);
}
@Override
public List<LiuyanCustom> findLiuyanByname(String liuyan) throws Exception {
// TODO 自动生成的方法存根 List<LiuyanCustom> liuyanCustom = liuyanMapper.findLiuyanByname(liuyan); return liuyanCustom; }
@Override
public void insertLiuyan(Liuyan liuyan) throws Exception {
// TODO 自动生成的方法存根 liuyanMapper.insertLiuyan(liuyan); return ;
}
@Override
public int updateLiuyan(Integer id,Liuyan liuyan) throws Exception {
return liuyanMapper.updateLiuyan(liuyan);
}
@Override
public Liuyan findLiuyanBynameOne(String liuyan) throws Exception {
// TODO 自动生成的方法存根
liuyanMapper.findLiuyanBynameOne(liuyan); return liuyanMapper.findLiuyanBynameOne(liuyan);
}
@Override
public void deleteLiuyanBynameOne(String liuyan) throws Exception {
// TODO 自动生成的方法存根
liuyanMapper.deleteLiuyanBynameOne(liuyan);
}
}
LiuyanController.java
package cn.itcast.ssm.controller; import java.util.List; import javax.servlet.http.HttpServletRequest; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView; import cn.itcast.ssm.po.Liuyan;
import cn.itcast.ssm.po.LiuyanCustom;
import cn.itcast.ssm.service.LiuyanService; @Controller
@RequestMapping("/liuyan")
public class LiuyanController { @Autowired
private LiuyanService liuyanService; @RequestMapping("/queryLiuyan")
public ModelAndView queryLiuyan()throws Exception {
//调用service查找 数据库,查询商品列表,这里使用静态数据模拟
List<LiuyanCustom> liuyanList = liuyanService.findLiuyanList(null); //返回ModelAndView
ModelAndView modelAndView = new ModelAndView();
//相当 于request的setAttribut,在jsp页面中通过itemsList取数据
modelAndView.addObject("liuyanList",liuyanList);
//modelAndView.addObject("liuyanList", liuyanList);
//不可以有空格
modelAndView.setViewName("liuyan/liuyanList");
return modelAndView;
} @RequestMapping("/queryLiuyanByname")
public ModelAndView queryLiuyanByname()throws Exception {
//调用service查找 数据库,查询商品列表,这里使用静态数据模拟
List<LiuyanCustom> liuyanCustom = liuyanService.findLiuyanByname("任秀兴"); //返回ModelAndView
ModelAndView modelAndView = new ModelAndView();
//相当 于request的setAttribut,在jsp页面中通过itemsList取数据
modelAndView.addObject("liuyanList",liuyanCustom);
//modelAndView.addObject("liuyanList", liuyanList);
//不可以有空格
modelAndView.setViewName("liuyan/liuyanList");
return modelAndView;
} @RequestMapping("/insertLiuyan")
public String insertLiuyan(HttpServletRequest request)throws Exception {
//调用service查找 数据库
String strliuyan = request.getParameter("liuyan");
//String strliuyan1 = request.getParameter("liuyan1");
System.out.println(request.getParameter("liuyan"));
//System.out.println(request.getParameter("liuyan1"));
Liuyan liuyan = new Liuyan();
liuyan.setLiuyan(strliuyan);
liuyanService.insertLiuyan(liuyan);
//重定向
return "redirect:queryLiuyan.action"; } @RequestMapping("/updateLiuyan")
public ModelAndView updateLiuyan(String liuyan)throws Exception { Liuyan speak = liuyanService.findLiuyanBynameOne(liuyan);
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("speak",speak);
modelAndView.setViewName("liuyan/updateliuyan"); return modelAndView;
} @RequestMapping("/updateLiuyanSubmit")
public String updateLiuyanSubmit(HttpServletRequest request,Liuyan liuyan)throws Exception { String strid = request.getParameter("id");
System.out.println(strid);
int id = Integer.parseInt(strid);
liuyan.setId(id);
liuyanService.updateLiuyan(id,liuyan);
//重定向
return "redirect:queryLiuyan.action"; } @RequestMapping("/deleteLiuyan")
public String deleteLiuyan(HttpServletRequest request)throws Exception {
String strliuyan = request.getParameter("liuyan"); liuyanService.deleteLiuyanBynameOne(strliuyan); return "redirect:queryLiuyan.action"; }
}
jsp
liuyanList.jsp
<%@page import =" java.text.SimpleDateFormat" %>
<%@page import =" java.util.Date" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="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>留言板</title>
</head>
<body>
<form
action="${pageContext.request.contextPath }/liuyan/insertLiuyan.action"
method="post">
留言:
<table width="100%" border=1>
<tr>
<td>
<input type="text" name="liuyan" id="liuyan" />
<!-- <input type="text" name="liuyan1" id="liuyan1" /> -->
<input type="submit" value="提交"/></td>
</tr>
</table>
列表:
<table width="100%" border=1>
<tr>
<td>时间</td>
<td>留言</td>
<td>修改</td>
<td>删除</td> </tr>
<c:forEach items="${liuyanList }" var="speak">
<tr>
<%
SimpleDateFormat format=new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒");
String time=format.format(new Date());
%> <td><fmt:formatDate value="${speak.timer }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${speak.liuyan }</td>
<td><a href="${pageContext.request.contextPath }/liuyan/updateLiuyan.action?liuyan=${speak.liuyan}" >修改</a></td>
<td><a href="${pageContext.request.contextPath }/liuyan/deleteLiuyan.action?liuyan=${speak.liuyan}" >删除</a></td>
</tr>
</c:forEach> </table>
</form>
</body>
</html>
SSM框架整合思路的更多相关文章
- 三:SSM框架整合思路
一:jar包 1.spring(包括springmvc) 2.mybatis 3.mybatis-spring整合包 4.数据库驱动 5.第三方连接池 6.json依赖包jackson 二:整合思路 ...
- SpringMVC札集(10)——SSM框架整合
自定义View系列教程00–推翻自己和过往,重学自定义View 自定义View系列教程01–常用工具介绍 自定义View系列教程02–onMeasure源码详尽分析 自定义View系列教程03–onL ...
- springmvc(二) ssm框架整合的各种配置
ssm:springmvc.spring.mybatis这三个框架的整合,有耐心一步步走. --WH 一.SSM框架整合 1.1.整合思路 从底层整合起,也就是先整合mybatis与spring,然后 ...
- JAVAEE——宜立方商城01:电商行业的背景、商城系统架构、后台工程搭建、SSM框架整合
1. 学习计划 第一天: 1.电商行业的背景. 2.宜立方商城的系统架构 a) 功能介绍 b) 架构讲解 3.工程搭建-后台工程 a) 使用maven搭建工程 b) 使用maven的tomcat插件启 ...
- (转)淘淘商城系列——SSM框架整合之Dao层整合
http://blog.csdn.net/yerenyuan_pku/article/details/72721093 一个项目中往往有三层即Dao层.Service层和Web层,看标题就知道了,本文 ...
- SpringMVC详解及SSM框架整合项目
SpringMVC ssm : mybatis + Spring + SpringMVC MVC三层架构 JavaSE:认真学习,老师带,入门快 JavaWeb:认真学习,老师带,入门快 SSM框架: ...
- SpringMVC--从理解SpringMVC执行流程到SSM框架整合
前言 SpringMVC框架是SSM框架中继Spring另一个重要的框架,那么什么是SpringMVC,如何用SpringMVC来整合SSM框架呢?下面让我们详细的了解一下. 注:在学习SpringM ...
- SSM框架整合项目 :租房管理系统
使用ssm框架整合,oracle数据库 框架: Spring SpringMVC MyBatis 导包: 1, spring 2, MyBatis 3, mybatis-spring 4, fastj ...
- 基于maven的ssm框架整合
基于maven的ssm框架整合 第一步:通过maven建立一个web项目. 第二步:pom文件导入jar包 (1 ...
随机推荐
- Cent OS 7下安装 mongodb
1.下载MongoDB 安装包 wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.6.8.tgz 2.解压并安装 .tgz 3. ...
- MySQL 下载,安装,配置windows 服务
本次使用的是压缩包的方式是可以纯手动自己折腾各种配置... ok,闲话少叙,我们准备发车... 一.先要去mysql官网去下载压缩包咯 ①下载地址:https://dev.mysql.com/down ...
- Arrays(二),对封装的数组进行增删改查操作
(一)添加元素 对任意位置添加元素 /** * 向数组中添加元素 * @param e 元素e * @param index 插入元素的在数组中的位置 * @return 添加结果 */ public ...
- C++11中vector的几种遍历方法
假设有这样的一个vector: vector<int> line={1,2,3,4,5,6,7,8,9}; 需要输出vector里的每个元素,主函数如下: void showvec(con ...
- python模块学习之testlink (自动回写测试案例执行结果到testlink)
安装 pip install TestLink-API-Python-client #!/usr/bin/env Python # -*- coding: utf-8 -*- ''' Created ...
- 泛微weaver_oa filebrowser.jsp 任意目录遍历
url//document/imp/filebrowser.jsp?dir=/etc/
- MySQL数据库学习初步
我使用的环境是Win7,开始学习PHP和MySQL,并且买了本<Head First PHP & MySQL>,可以从Head First Labs官网获得HeadFirst系列书 ...
- 深入JAVA虚拟机笔记
1.对堆的理解: a):所有的对象实例以及数据都要在堆中分配 b):新生代和老年代存在于堆中
- FrameWork内核解析之Handler消息机制(二)
阿里P7Android高级架构进阶视频(内含Handler视频讲解)免费学习请点击:https://space.bilibili.com/474380680 一.Handler 在Android开发的 ...
- leetcode.数组.667优美的排列II-Java
1. 具体题目 给定两个整数 n 和 k,你需要实现一个数组,这个数组包含从 1 到 n 的 n 个不同整数,同时满足以下条件:① 如果这个数组是 [a1, a2, a3, ... , an] ,那么 ...