通讯录改造——MVC设计模式
将之前用servlet写的程序转化为jsp+servlet的简单的MVC的三层结构。项目中程序的包如图

首先是实体对象:
package com.contactSystem.entiey;
public class Contact {
private String Id;
private String name;
private String sex;
private String age;
private String phone;
private String qq;
private String email;
public String getId() {
return Id;
}
public void setId(String id) {
Id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getAge() {
return age;
}
public void setAge(String age) {
this.age = age;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getQq() {
return qq;
}
public void setQq(String qq) {
this.qq = qq;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
@Override
public String toString() {
return "Contact [Id=" + Id + ", name=" + name + ", sex=" + sex
+ ", age=" + age + ", phone=" + phone + ", qq=" + qq
+ ", email=" + email + "]";
}
}
然后就是对数据操作的抽象类
package com.contactSystem.dao; import java.io.FileNotFoundException;
import java.io.UnsupportedEncodingException;
import java.util.List; import org.dom4j.DocumentException;
import com.contactSystem.entiey.Contact; public interface ContactOperate {
public void addContact(Contact contact) throws Exception;
public void updateContact(Contact contact) throws Exception;
public void removeContact(String id) throws Exception;
public Contact findContact(String id) throws Exception;
public List<Contact> allContacts();
//根据名称姓名查询是否有存在重复。
public boolean checkIfContact(String name);
}
具体实现类
package com.contactSystem.dao.daoImpl; import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID; import javax.persistence.Id;
import javax.persistence.Tuple; import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.io.SAXReader; import com.contactSystem.dao.ContactOperate;
import com.contactSystem.entiey.Contact;
import com.contactSystem.util.XMLUtil; public class Operater implements ContactOperate { @Override
//添加联系人
public void addContact(Contact contact) throws Exception {
// TODO Auto-generated method stub
File file=new File("e:/contact.xml");
Document doc=null;
Element rootElem=null;
if (file.exists()) {
doc=new SAXReader().read(file);
rootElem=doc.getRootElement();
}else {
doc=DocumentHelper.createDocument();
rootElem=doc.addElement("ContactList");
} //开始添加个体
Element element=rootElem.addElement("contact");
//有系统自动生成一随机且唯一的ID,赋给联系人Id,系统提供了一个包UUID包
String uuid=UUID.randomUUID().toString().replace("-", ""); element.addAttribute("Id", uuid);
element.addElement("姓名").setText(contact.getName());
element.addElement("name").setText(contact.getName());
element.addElement("sex").setText(contact.getSex());
element.addElement("age").setText(contact.getAge());
element.addElement("phone").setText(contact.getPhone());
element.addElement("email").setText(contact.getEmail());
element.addElement("qq").setText(contact.getQq()); //写入到本地的xml文档中
XMLUtil.write2xml(doc); } @Override
public void updateContact(Contact contact) throws Exception {
// TODO Auto-generated method stub
//通过xpath查找对应id的联系人
Document document=XMLUtil.getDocument();
Element element=(Element) document.selectSingleNode("//contact[@Id='"+contact.getId()+"']");
//根据标签改文本
System.out.println(element);
element.element("name").setText(contact.getName());
element.element("age").setText(contact.getAge());
element.element("email").setText(contact.getEmail());
element.element("phone").setText(contact.getPhone());
element.element("sex").setText(contact.getSex());
element.element("qq").setText(contact.getQq());
XMLUtil.write2xml(document); } @Override
public void removeContact(String id) throws Exception {
// TODO Auto-generated method stub
//通过xpath去查找对应的contact
Document document=XMLUtil.getDocument();
Element element=(Element) document.selectSingleNode("//contact[@Id='"+id+"']");
/**
* 如果是火狐浏览器,其本身有一个bug,对于一个get请求,它会重复做两次,
* 第一次会把一个唯一的id给删除掉,但是在第二次的时候,它会继续去删,而这个时候查找不到,会报错,会发生错误,
* 为了解决这个bug,我们在这里验证其是否为空
*/
if (element!=null) {
element.detach();
XMLUtil.write2xml(document);
}
} @Override
public Contact findContact(String id) throws Exception {
// TODO Auto-generated method stub
Document document=XMLUtil.getDocument();
Element e=(Element) document.selectSingleNode("//contact[@Id='"+id+"']"); Contact contact=null;
if (e!=null) {
contact=new Contact();
contact.setAge(e.elementText("age"));
contact.setEmail(e.elementText("email"));
contact.setId(id);
contact.setName(e.elementText("name"));
contact.setPhone(e.elementText("phone"));
contact.setSex(e.elementText("sex"));
contact.setQq(e.elementText("qq"));
}
return contact;
} @Override
public List<Contact> allContacts() {
// TODO Auto-generated method stub
Document document=XMLUtil.getDocument();
List<Contact> list=new ArrayList<Contact>();
List<Element> conElements=(List<Element>)document.selectNodes("//contact");
for (Element element : conElements) {
Contact contact=new Contact();
contact.setId(element.attributeValue("Id"));
contact.setAge(element.elementText("age"));
contact.setEmail(element.elementText("email"));
contact.setName(element.elementText("name"));
contact.setPhone(element.elementText("phone"));
contact.setQq(element.elementText("qq"));
contact.setSex(element.elementText("sex"));
list.add(contact);
}
return list;
}
/**
* true:说明重复
* false:说明没有重复
*/
@Override
public boolean checkIfContact(String name) {
// TODO Auto-generated method stub
//查询name标签是否一样
Document doc=XMLUtil.getDocument();
Element element=(Element) doc.selectSingleNode("//name[text()='"+name+"']");
if (element!=null) {
return true;
}else {
return false;
} } }
为了减轻Servlet的负担在增加一层(业务逻辑层)Service,这里举例,当联系人的名字存在时,提示出错,不在servlet中去判断,而在service中去处理,同样首先写出service抽象接口
package com.contactSystem.service;
import java.util.List;
import com.contactSystem.entiey.Contact;
public interface ContactService {
public void addContact(Contact contact) throws Exception;
public void updateContact(Contact contact) throws Exception;
public void removeContact(String id) throws Exception;
public Contact findContact(String id) throws Exception;
public List<Contact> allContacts();
}
这个时候有点相当于在Operate操作中添加了一层操作,在contactService的实现类中去有逻辑判断的去使用Operater的方法
package com.contactSystem.service.imple; import java.util.List; import com.contactSystem.dao.daoImpl.Operater;
import com.contactSystem.entiey.Contact;
import com.contactSystem.exception.NameRepeatException;
import com.contactSystem.service.ContactService;
/**
* 处理项目中出现的业务逻辑
* @author Administrator
*
*/
public class ContactServiceImpe implements ContactService {
Operater operater =new Operater();
@Override
public void addContact(Contact contact) throws Exception {
// TODO Auto-generated method stub
//执行业务逻辑判断
/**
* 添加是否重复的业务逻辑
*/
if (operater.checkIfContact(contact.getName())) {
//重复
/**
* 注意:如果业务层方法出现任何错误,则返回标记(自定义的异常)到servlet
*/
throw new NameRepeatException("姓名重复,不可使用");
}
operater.addContact(contact); } @Override
public void updateContact(Contact contact) throws Exception {
// TODO Auto-generated method stub
operater.updateContact(contact);
} @Override
public void removeContact(String id) throws Exception {
// TODO Auto-generated method stub
operater.removeContact(id);
} @Override
public Contact findContact(String id) throws Exception {
// TODO Auto-generated method stub
return operater.findContact(id);
} @Override
public List<Contact> allContacts() {
// TODO Auto-generated method stub
return operater.allContacts();
} }
这里通过抛出异常去将信息传递给Servlet,异常代码如下
package com.contactSystem.exception;
/**
* 姓名重复的自定义异常
* @author Administrator
*
*/
public class NameRepeatException extends Exception{
public NameRepeatException(String msg) {
super(msg);
}
}
现在来写Servlet,首先是首页的联系人列表Servlet
package com.contactSystem.servlet; import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import com.contactSystem.dao.daoImpl.Operater;
import com.contactSystem.entiey.Contact;
import com.contactSystem.service.ContactService;
import com.contactSystem.service.imple.ContactServiceImpe; public class Index extends HttpServlet { /**
* 显示所有联系人的逻辑方式
*/
private static final long serialVersionUID = 1L; public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=utf-8");
ContactService service=new ContactServiceImpe();
List<Contact> contacts=service.allContacts(); /**
* shift+alt+A ——>区域选择
* 正则表达式:“."表示任意字符,"*"表示多个字符
* “/1”表示一行代表匹配一行内容
*/ request.setAttribute("contacts", contacts);
request.getRequestDispatcher("/index.jsp").forward(request, response); } public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doGet(request, response);
} }
添加联系人
package com.contactSystem.servlet; import java.io.IOException;
import java.io.PrintWriter; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import com.contactSystem.dao.daoImpl.Operater;
import com.contactSystem.entiey.Contact;
import com.contactSystem.exception.NameRepeatException;
import com.contactSystem.service.ContactService;
import com.contactSystem.service.imple.ContactServiceImpe; public class addServlet extends HttpServlet { /**
* 处理添加联系人的逻辑
*/
private static final long serialVersionUID = 1L; public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
String userName=request.getParameter("userName");
String age=request.getParameter("age");
String sex=request.getParameter("sex");
String phone=request.getParameter("phone");
String qq=request.getParameter("qq");
String email=request.getParameter("email"); ContactService service=new ContactServiceImpe(); Contact contact=new Contact();
contact.setName(userName);
contact.setAge(age);
contact.setSex(sex);
contact.setPhone(phone);
contact.setQq(qq);
contact.setEmail(email);
try {
service.addContact(contact);
} catch (NameRepeatException e) {
// TODO Auto-generated catch block
//处理名字重复的异常
request.setAttribute("message", e.getMessage());
request.getRequestDispatcher("/add.jsp").forward(request, response);
return;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} response.sendRedirect(request.getContextPath()+"/Index");
} public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doGet(request, response);
} }
查找联系人
package com.contactSystem.servlet; import java.io.IOException;
import java.io.PrintWriter; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import com.contactSystem.dao.daoImpl.Operater;
import com.contactSystem.entiey.Contact;
import com.contactSystem.service.ContactService;
import com.contactSystem.service.imple.ContactServiceImpe; public class FindIdServlet extends HttpServlet { /**
* 修改联系人逻辑
*/
private static final long serialVersionUID = 1L; public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { response.setContentType("text/html;charset=utf-8"); ContactService service=new ContactServiceImpe(); String id=request.getParameter("id"); Contact contact=null;
try {
contact=service.findContact(id);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} request.setAttribute("contact", contact);
request.getRequestDispatcher("/update.jsp").forward(request, response);
} public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doGet(request, response);
} }
修改联系人
package com.contactSystem.servlet; import java.io.IOException;
import java.io.PrintWriter; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import com.contactSystem.dao.daoImpl.Operater;
import com.contactSystem.entiey.Contact;
import com.contactSystem.service.ContactService;
import com.contactSystem.service.imple.ContactServiceImpe; public class UpdateServlet extends HttpServlet { /**
* 将修改后的数据提交
*/
private static final long serialVersionUID = 1L; public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { response.setContentType("text/html"); request.setCharacterEncoding("utf-8");
String userName=request.getParameter("userName");
String age=request.getParameter("age");
String sex=request.getParameter("sex");
String phone=request.getParameter("phone");
String qq=request.getParameter("qq");
String email=request.getParameter("email");
String id=request.getParameter("id");
ContactService service=new ContactServiceImpe();
Contact contact=new Contact();
contact.setId(id);
contact.setName(userName);
contact.setAge(age);
contact.setSex(sex);
contact.setPhone(phone);
contact.setQq(qq);
contact.setEmail(email);
try {
service.updateContact(contact);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} response.sendRedirect(request.getContextPath()+"/Index"); } public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doGet(request, response);
} }
删除联系人
package com.contactSystem.servlet; import java.io.IOException;
import java.io.PrintWriter; import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import com.contactSystem.dao.daoImpl.Operater;
import com.contactSystem.service.ContactService;
import com.contactSystem.service.imple.ContactServiceImpe; public class DeleteServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException { response.setContentType("text/html;charset=utf-8"); String id=request.getParameter("id");
ContactService service=new ContactServiceImpe();
try {
service.removeContact(id);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
} response.sendRedirect(request.getContextPath()+"/Index"); } public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
this.doGet(request, response);
}
}
以上完成了MVC的M和C,还差View,现在来具体显示jsp页面
首页所有联系人的显示
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html> <head>
<meta charset='utf-8'>
<title>查询所有联系人</title>
<style media='screen'>
table td {
text-align: center;
} table {
border-collapse: collapse;
}
</style>
</head> <body>
<center>
<h2>查询所有联系人</h2>
</center>
<table border='1' align='center'>
<tbody>
<thead>
<th>编号</th>
<th>姓名</th>
<th>性别</th>
<th>年龄</th>
<th>电话</th>
<th>QQ</th>
<th>邮箱</th>
<th>操作</th>
</thead>
<c:forEach items="${contacts}" var="con" varStatus="varSta">
<tr>
<td>${varSta.count }</td>
<td>${con.name }</td>
<td>${con.sex }</td>
<td>${con.age }</td>
<td>${con.phone }</td>
<td>${con.qq }</td>
<td>${con.email }</td>
<td><a href='${pageContext.request.contextPath }/FindIdServlet?id=${con.id}'>修改</a> <a href='${pageContext.request.contextPath }/DeleteServlet?id=${con.id}'>删除</a></td>
</tr>
</c:forEach>
<tr>
<td colspan='8'>
<a href='${pageContext.request.contextPath}/add.jsp'>添加联系人</a>
</td>
</tr>
</tbody>
</table>
</body> </html>
修改联系人,首先要把要修改联系人的信息都显示在信息栏中,然后用户去修改相关信息
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html> <head>
<meta charset="utf-8">
<title>修改联系人</title>
<style media="screen">
#btn{
width:40px;
width: 50px;
background: green;
color: white;
font-size:14px;
}
</style>
</head> <body>
<center>
<h2>修改联系人</h2>
</center>
<form action="${pageContext.request.contextPath }/UpdateServlet" method="post">
<table border="1" align="center">
<tbody> <tr>
<th>姓名</th>
<td><input type="text" name="userName" value="${contact.name}"/></td>
<input type="hidden" name="id" value="${contact.id }"/> </tr>
<tr>
<th>年龄</th>
<td><input type="text" name="age" value="${contact.age }" /></td>
</tr>
<tr>
<th>性别</th>
<td> <input type="radio" name="sex" value="男" <c:if test="${contact.sex=='男' }"> checked="true"</c:if>/>男
<input type="radio" name="sex" value="女" <c:if test="${contact.sex=='女' }"> checked="true"</c:if> />女
</td>
</tr>
<tr>
<th>电话</th>
<td><input type="text" name="phone" value="${contact.phone }" /></td>
</tr>
<tr>
<th>QQ</th>
<td><input type="text" name="qq" value="${contact.qq }" /></td>
</tr>
<tr>
<th>邮箱</th>
<td><input type="text" name="email" value="${contact.email }" /></td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="submit" value="提交" id="btn"/>
</td>
</tr>
</tbody>
</table>
</form>
</body> </html>
最后就是添加联系人了
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html> <head>
<meta charset="utf-8">
<title>添加联系人</title>
<style media="screen">
#btn{
width:40px;
width: 50px;
background: green;
color: white;
font-size:14px;
}
</style>
</head> <body>
<center>
<h2>添加联系人</h2>
</center>
<form action="${pageContext.request.contextPath}/addServlet" method="post">
<table border="1" align="center">
<tbody> <tr>
<th>姓名</th>
<td><input type="text" name="userName" value="${message }" /></td>
</tr>
<tr>
<th>年龄</th>
<td><input type="text" name="age" /></td>
</tr>
<tr>
<th>性别</th>
<td>
<input type="radio" name="sex" value="男"/>男
<input type="radio" name="sex" value="女" />女
</td>
</tr>
<tr>
<th>电话</th>
<td><input type="text" name="phone" /></td>
</tr>
<tr>
<th>QQ</th>
<td><input type="text" name="qq" /></td>
</tr>
<tr>
<th>邮箱</th>
<td><input type="text" name="email" /></td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="submit" value="提交" id="btn"/>
</td>
</tr>
</tbody>
</table>
</form>
</body> </html>
最后可以加上一个测试类,方便自己调试
package com.contactSystem.Junit; import static org.junit.Assert.*; import java.util.List; import org.junit.Before; import com.contactSystem.dao.daoImpl.Operater;
import com.contactSystem.entiey.Contact; public class Test {
Operater operator=null; //初始化这个对象的实例
@Before
public void init(){
operator=new Operater();
} @org.junit.Test
public void Add() throws Exception{
Contact contact=new Contact(); contact.setAge("21");
contact.setEmail("454444@qq.com");
contact.setName("gqxing");
contact.setPhone("13455555");
contact.setQq("235346662");
contact.setSex("男");
operator.addContact(contact);
} @org.junit.Test
public void update() throws Exception{
Contact contact=new Contact();
contact.setId("002");
contact.setAge("0");
contact.setEmail("0000000@qq.com");
contact.setName("test");
contact.setPhone("0-00000000000");
contact.setQq("000000000000");
contact.setSex("男");
operator.updateContact(contact);
} @org.junit.Test
public void removeContact() throws Exception{
operator.removeContact("002");
} @org.junit.Test
public void findContact() throws Exception{
Contact contact=operator.findContact("002");
System.out.println(contact);
} @org.junit.Test
public void allContact() throws Exception{
List<Contact> contacts= operator.allContacts();
for (Contact contact : contacts) {
System.out.println(contact);
}
}
@org.junit.Test
public void TetsCheckBoolean() throws Exception{
Boolean flag=operator.checkIfContact("郭庆兴");
System.out.println(flag);
} }
最后运行的结构示意图:

当名字重复的时候:提交就会显示

通讯录改造——MVC设计模式的更多相关文章
- AngularJS_01之基础概述、设计原则及MVC设计模式
1.AngularJS: 开源的JS框架,用来开发单一页面应用,以及数据操作频繁的场景:2.设计原则: ①YAGNI原则:You Aren't Gonna Need It! 不要写不需要的代码! ②K ...
- 谈谈JAVA工程狮面试中经常遇到的面试题目------什么是MVC设计模式
作为一名java工程狮,大家肯定经历过很多面试,但每次几乎都会被问到什么是MVC设计模式,你是怎么理解MVC的类似这样的一系列关于MVC的问题. [出现频率] [关键考点] MVC的含义 MVC的结构 ...
- Java Web开发中MVC设计模式简介
一.有关Java Web与MVC设计模式 学习过基本Java Web开发的人都已经了解了如何编写基本的Servlet,如何编写jsp及如何更新浏览器中显示的内容.但是我们之前自己编写的应用一般存在无条 ...
- MVC设计模式与三层架构
三层架构分别是:表示层(Web层).业务逻辑层(BLL层)和数据访问层(DAL层). (1)表示层负责: a.从用户端收集信息 b.将用户信息发送到业务服务层做处理 c.从业务服务层接收处理结果 d. ...
- 传智播客JavaWeb day07、day08-自定义标签(传统标签和简单标签)、mvc设计模式、用户注册登录注销
第七天的课程主要是讲了自定义标签.简单介绍了mvc设计模式.然后做了案例 1. 自定义标签 1.1 为什么要有自定义标签 前面所说的EL.JSTL等技术都是为了提高jsp的可读性.可维护性.方便性而取 ...
- mvc设计模式和mvc框架的区别
Spring中的新名称也太多了吧!IOC/DI/MVC/AOP/DAO/ORM... 对于刚刚接触spring的我来说确实晕了头!可是一但你完全掌握了一个概念,那么它就会死心塌地的为你服务了.这可比女 ...
- MVC设计模式((javaWEB)在数据库连接池下,实现对数据库中的数据增删改查操作)
设计功能的实现: ----没有业务层,直接由Servlet调用DAO,所以也没有事务操作,所以从DAO中直接获取connection对象 ----采用MVC设计模式 ----采用到的技术 .MVC设计 ...
- MVC设计模式(持续更新中)
MVC设计模式--->英文全称为: model(模型) View (视图) Controller(控制) MVC是一种设计思想.这种思想强调实现模型(Model).视图(View)和控制 ...
- iOS中MVC设计模式
在组织大型项目的代码文件时,我们常用MVC的思想.MVC的概念讲起来非常简单,就和对象(object)一样.但是理解和应用起来却非常困难.今天我们就简单总结一下MVC设计理念. MVC(Model V ...
随机推荐
- python【第十九篇】Django进阶
1.路由系统优化 1.1 路由分发 前面我们已经知道,在工程名下的urls.py中写我们的路由映射关系,那么问题来了,假设我们有10个app,如果把所有的url映射都写在urls.py文件中,那么每一 ...
- java中动态反射
java中动态反射能达到的效果和python的语法糖很像,能够截获方法的实现,在真实方法调用之前和之后进行修改,甚至能够用自己的实现进行特别的替代,也可以用其实现面向切片的部分功能.动态代理可以方便实 ...
- WIFI破解总结
寒假回家了,由于家里没有宽带,而周围又有好多WIFI所以尝试了破解人家的WIFI,嘻嘻. 1.准备u盘一个,格式化 2.用制作工具,将cdlinux系统的镜像安装进u盘 3.用u盘启动电脑,进入cdl ...
- SQL Server执行计划
要理解执行计划,怎么也得先理解,那各种各样的名词吧.鉴于自己还不是很了解.本文打算作为只写懂的,不懂的懂了才写. 在开头要先说明,第一次看执行计划要注意,SQL Server的执行计划是从右向左看的. ...
- VHDL程序的库
VHDL库存储和放置了可被其他VHDL程序调用的数据定义.器件说明.程序包等资源.VHDL库的种类有很多,但最常见的库有IEEE标准库.WORK库.IEEE标准库主要包括STD_LOGIC_1164. ...
- 配置Apache服务器 数据库mySQL
Mac 配置 apache php 详细解说 一.开启apache 并切改变引导 1.打开终端 输入:sudo apachectl start 回车,关闭终端 2.打开浏览器,地址栏输入 ...
- Linux发行版
Linux 发行版(英语:Linux distribution,也被叫做GNU/Linux 发行版),为一般用户预先集成好的Linux操作系统及各种应用软件.一般用户不需要重新编译,在直接安装之后,只 ...
- 关于ARP欺骗与MITM(中间人攻击)的一些笔记( 二 )
一直没有折腾啥东西,直到最近kali Linux发布,才回想起应该更新博客了….. 再次说明,这些技术并不是本人原创的,而是以前记录在Evernote的旧内容(排版不是很好,请谅解),本文是继关于AR ...
- cisco telnet会话SESSION管理及相关Dynagen配置文件
#Lab 2-5 autostart = False [localhost] [[2621]] ram = 64 image = C:\Program Files (x86)\Dynamips\ima ...
- SPRING IN ACTION 第4版笔记-第二章-004-Bean是否单例
spring的bean默认是单例,加载容器是会被化,spring会拦截其他再次请求bean的操作,返回spring已经创建好的bean. It appears that the CompactDisc ...