-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathblog.sql
100 lines (90 loc) · 115 KB
/
blog.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50629
Source Host : localhost:3306
Source Database : blog
Target Server Type : MYSQL
Target Server Version : 50629
File Encoding : 65001
Date: 2017-01-09 11:05:23
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `admin`
-- ----------------------------
DROP TABLE IF EXISTS `admin`;
CREATE TABLE `admin` (
`admin_name` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`admin_password` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
`admin_telephone` int(11) NOT NULL,
`admin_address` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`admin_checknum` int(10) NOT NULL,
PRIMARY KEY (`admin_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Records of admin
-- ----------------------------
-- ----------------------------
-- Table structure for `diary`
-- ----------------------------
DROP TABLE IF EXISTS `diary`;
CREATE TABLE `diary` (
`diary_id` int(100) NOT NULL AUTO_INCREMENT,
`diary_content` text COLLATE utf8_unicode_ci NOT NULL,
`diary_time` date NOT NULL,
PRIMARY KEY (`diary_id`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Records of diary
-- ----------------------------
INSERT INTO `diary` VALUES ('1', '2016年,还剩下不到20天,加油呀少年。', '2016-11-10');
INSERT INTO `diary` VALUES ('2', '放弃该放弃的是无奈,放弃不该放弃的是无能,不放弃该放弃的是无知,不放弃不该放弃的是执著!', '2016-11-15');
INSERT INTO `diary` VALUES ('3', '不要拿小人的错误来惩罚自己,不要在这些微不足道的事情上折磨浪费自己的宝贵时间。', '2016-11-19');
INSERT INTO `diary` VALUES ('4', '没有什么,比努力更值得我去做。', '2016-11-22');
INSERT INTO `diary` VALUES ('5', '生活是一面镜子。你对它笑,它就对你笑;你对它哭,它也对你哭。', '2016-11-25');
INSERT INTO `diary` VALUES ('6', '活着一天,就是有福气,就该珍惜。当我哭泣我没有鞋子穿的时候,我发现有人却没有脚。', '2016-11-28');
INSERT INTO `diary` VALUES ('7', '命运负责洗牌,但是玩牌的是我们自己!', '2016-11-30');
INSERT INTO `diary` VALUES ('8', '天将降大任于斯人也,必先苦其心志,劳其筋骨,饿其体肤,空乏其身,行拂乱其所为也,所以动心忍性,增益其所不能。', '2016-12-01');
INSERT INTO `diary` VALUES ('9', '立志、工作、成就,是人类活动的三大要素。立志是事业的大门,工作是登堂入室的旅程。这旅程的尽头有个成功在等待着,来庆祝你的努力结果。', '2016-12-03');
INSERT INTO `diary` VALUES ('10', '加油呀少年。', '2016-12-05');
INSERT INTO `diary` VALUES ('11', '好累。但是还要坚持。一定不要辜负老师的期望。', '2016-12-06');
INSERT INTO `diary` VALUES ('12', '读书,始读,未知有疑;其次,则渐渐有疑;中则节节是疑。过了这一番,疑渐渐释,以至融会贯通,都无所疑,方始是学。', '2016-12-07');
INSERT INTO `diary` VALUES ('13', '今天收获很多。', '2016-12-08');
INSERT INTO `diary` VALUES ('14', '夫志当存高远,慕先贤,绝情欲,弃疑滞,使庶几之志,揭然有所存,恻然有所感;忍屈伸,去细碎,广咨问,除嫌吝,虽有淹留,何损于美趣,何患于不济。', '2016-12-09');
INSERT INTO `diary` VALUES ('15', '凡事都要脚踏实地去作,不驰于空想,不骛于虚声,而惟以求真的态度作踏实的工夫。以此态度求学,则真理可明,以此态度作事,则功业可就。', '2016-12-09');
INSERT INTO `diary` VALUES ('16', '假如生活欺骗了你,不要心焦,也不要烦恼.阴郁的日子里要心平气和,相信吧,那快乐的日子就来到。', '2016-12-10');
INSERT INTO `diary` VALUES ('17', '读书,始读,未知有疑;其次,则渐渐有疑;中则节节是疑。过了这一番,疑渐渐释,以至融会贯通,都无所疑,方始是学。', '2016-12-11');
INSERT INTO `diary` VALUES ('18', '谚日:“积财千万,不如薄技在身。”使之易习而可贵者,无过读书也。世人不问愚智,皆欲识人之多,见事之广,而不肯读书,是犹求饱而懒劳馔,欲暖而惰裁衣也。', '2016-12-12');
INSERT INTO `diary` VALUES ('19', '烟台的今天,小雪,好希望老天爷可以下一场大雪,陪她去看看雪。2016年只剩下15天了,加油。', '2016-12-14');
INSERT INTO `diary` VALUES ('20', '今天天气好冷,还有5天,2016年就结束了,一丝的惶恐,一丝的不安,但是不管怎么样,努力的向前的。都在努力,我有什么理由不努力。', '2016-12-20');
-- ----------------------------
-- Table structure for `title`
-- ----------------------------
DROP TABLE IF EXISTS `title`;
CREATE TABLE `title` (
`title_id` int(11) NOT NULL AUTO_INCREMENT,
`title_article` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`title_time` date NOT NULL,
`title_read` int(11) NOT NULL DEFAULT '10',
`title_summary` varchar(500) COLLATE utf8_unicode_ci NOT NULL,
`title_content` text COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`title_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- ----------------------------
-- Records of title
-- ----------------------------
INSERT INTO `title` VALUES ('1', 'onload共享事件', '2016-11-03', '243', '让函数在网页加载完毕后立刻执行,网页加载完毕时会触发一个onload事件,这个事件与window对象相关联。 在这里,我推荐使用第三种方法,因为代码可以直接让你明白这些事什么意思,快速获取你的路径... ', '<p style=\"margin-top: 0px; margin-bottom: 1.1em; white-space: normal; padding: 0px; box-sizing: border-box; font-family: "microsoft yahei"; font-size: 14px; background-color: rgb(255, 255, 255);\">让函数在网页加载完毕后立刻执行,网页加载完毕时会触发一个onload事件,这个事件与window对象相关联。 <br/><strong style=\"box-sizing: border-box;\">在这里,我推荐使用第三种方法,因为代码可以直接拷贝使用,把需要执行的函数加入到队列里就可以,便于扩展。</strong></p><h4 style=\"white-space: normal; margin: 0.8em 0px; padding: 0px; box-sizing: border-box; font-weight: 100; font-family: "microsoft yahei"; font-size: 14px; background-color: rgb(255, 255, 255);\"><a style=\"color: rgb(255, 153, 0); box-sizing: border-box;\"></a>1.如果只有一个函数:</h4><pre class=\"prettyprint\" style=\"margin-top: 0px; margin-bottom: 1.1em; padding: 5px 5px 5px 60px; border-radius: 0px; background-color: rgba(128, 128, 128, 0.0470588); white-space: nowrap; word-wrap: break-word; box-sizing: border-box; position: relative; overflow-y: hidden; overflow-x: auto; font-family: "Source Code Pro", monospace; font-size: 14px; line-height: 1.45; word-break: break-all; color: rgb(51, 51, 51); border: 1px solid rgba(128, 128, 128, 0.0745098);\">window.onload = prepareGallery;11</pre><h4 style=\"white-space: normal; margin: 0.8em 0px; padding: 0px; box-sizing: border-box; font-weight: 100; font-family: "microsoft yahei"; font-size: 14px; background-color: rgb(255, 255, 255);\"><a style=\"color: rgb(255, 153, 0); box-sizing: border-box;\"></a>2.假设有两个函数,想让它们两个都在页面加载时得到执行。如果把它们逐一绑定到onload事件上,例如:</h4><pre class=\"prettyprint\" style=\"margin-top: 0px; margin-bottom: 1.1em; padding: 5px 5px 5px 60px; border-radius: 0px; background-color: rgba(128, 128, 128, 0.0470588); white-space: nowrap; word-wrap: break-word; box-sizing: border-box; position: relative; overflow-y: hidden; overflow-x: auto; font-family: "Source Code Pro", monospace; font-size: 14px; line-height: 1.45; word-break: break-all; color: rgb(51, 51, 51); border: 1px solid rgba(128, 128, 128, 0.0745098);\">window.onload = first;\r\nwindow.onload = second;1212</pre><p style=\"margin-top: 0px; margin-bottom: 1.1em; white-space: normal; padding: 0px; box-sizing: border-box; font-family: "microsoft yahei"; font-size: 14px; background-color: rgb(255, 255, 255);\"><strong style=\"box-sizing: border-box;\">second将取代first,只执行最后一个。</strong> <br/><strong style=\"box-sizing: border-box;\">解决方案:</strong>先创建一个匿名函数来容纳这两个函数,然后把那个匿名函数绑定到onload事件上,如下所示:</p><pre class=\"prettyprint\" style=\"margin-top: 0px; margin-bottom: 1.1em; padding: 5px 5px 5px 60px; border-radius: 0px; background-color: rgba(128, 128, 128, 0.0470588); white-space: nowrap; word-wrap: break-word; box-sizing: border-box; position: relative; overflow-y: hidden; overflow-x: auto; font-family: "Source Code Pro", monospace; font-size: 14px; line-height: 1.45; word-break: break-all; color: rgb(51, 51, 51); border: 1px solid rgba(128, 128, 128, 0.0745098);\">window.onload = function() {\r\n first();\r\n second();\r\n}12341234</pre><p style=\"margin-top: 0px; margin-bottom: 1.1em; white-space: normal; padding: 0px; box-sizing: border-box; font-family: "microsoft yahei"; font-size: 14px; background-color: rgb(255, 255, 255);\"><strong style=\"box-sizing: border-box;\">该方法只适用于绑定的函数不是很多的场合。</strong></p><h4 style=\"white-space: normal; margin: 0.8em 0px; padding: 0px; box-sizing: border-box; font-weight: 100; font-family: "microsoft yahei"; font-size: 14px; background-color: rgb(255, 255, 255);\"><a style=\"color: rgb(255, 153, 0); box-sizing: border-box;\"></a>3.如果存在多函数,使用addLoadEvent</h4><ul class=\" list-paddingleft-2\" style=\"width: 1010.8px; white-space: normal; box-sizing: border-box; font-family: "microsoft yahei"; font-size: 14px; background-color: rgb(255, 255, 255);\"><li><p>把现有的window.onload事件处理函数的值存入变量onload。</p></li><li><p>如果在这个处理函数上还没有绑定任何函数,则把新函数添加给它。</p></li><li><p>如果在这个处理函数上已经绑定了一些函数,就把新函数追加到现有指令末尾。</p></li></ul><pre class=\"prettyprint\" style=\"margin-top: 0px; margin-bottom: 1.1em; padding: 5px 5px 5px 60px; border-radius: 0px; background-color: rgba(128, 128, 128, 0.0470588); white-space: nowrap; word-wrap: break-word; box-sizing: border-box; position: relative; overflow-y: hidden; overflow-x: auto; font-family: "Source Code Pro", monospace; font-size: 14px; line-height: 1.45; word-break: break-all; color: rgb(51, 51, 51); border: 1px solid rgba(128, 128, 128, 0.0745098);\">function addLoadEvent(func) {\r\n var oldonload=window.onload; //把现有的事件处理函数的值存起来\r\n if(typeof window.onload != 'function') { //如果没有绑定任何函数\r\n window.onload=func; //添加新的函数\r\n } else {\r\n window.onload = function() {\r\n oldonload();\r\n func(); //把新函数追加到现有指令的末尾\r\n }\r\n }\r\n}12345678910111234567891011</pre><p style=\"margin-top: 0px; margin-bottom: 1.1em; white-space: normal; padding: 0px; box-sizing: border-box; font-family: "microsoft yahei"; font-size: 14px; background-color: rgb(255, 255, 255);\"><strong style=\"box-sizing: border-box;\">把在页面加载完毕时执行的函数创建为一个队列:</strong></p><pre class=\"prettyprint\" style=\"margin-top: 0px; margin-bottom: 1.1em; padding: 5px 5px 5px 60px; border-radius: 0px; background-color: rgba(128, 128, 128, 0.0470588); white-space: nowrap; word-wrap: break-word; box-sizing: border-box; position: relative; overflow-y: hidden; overflow-x: auto; font-family: "Source Code Pro", monospace; font-size: 14px; line-height: 1.45; word-break: break-all; color: rgb(51, 51, 51); border: 1px solid rgba(128, 128, 128, 0.0745098);\">addLoadEvent(first);\r\naddLoadEvent(second);\r\naddLoadEvent(third);</pre>');
INSERT INTO `title` VALUES ('2', '用js实现在现有元素后插入一个新元素', '2016-11-05', '341', 'JavaScript提供了一个insertBefore方法,但可惜的是DOM本身并没有提供insertAfter方法,不过我们完全可以利用已有的DOM方法和属性编写一个insertAfter函数。 \r\n这个函数用到了一下DOM方法和属性: ', '<p style=\"margin-top: 0px; margin-bottom: 1.1em; padding: 0px; box-sizing: border-box;\"><a href=\"http://lib.csdn.net/base/javascript\" class=\"replace_word\" title=\"JavaScript知识库\" target=\"_blank\" style=\"color: rgb(223, 52, 52); text-decoration: none; box-sizing: border-box; font-weight: bold;\">JavaScript</a>提供了一个insertBefore方法,但可惜的是DOM本身并没有提供insertAfter方法,不过我们完全可以<strong style=\"box-sizing: border-box;\">利用已有的DOM方法和属性编写一个insertAfter函数</strong>。 <br/><strong style=\"box-sizing: border-box;\">这个函数用到了一下DOM方法和属性:</strong></p><ul style=\"box-sizing: border-box;\" class=\" list-paddingleft-2\"><li><p>parentNode属性</p></li><li><p>lastChild属性</p></li><li><p>appendChild属性</p></li><li><p>insertBefore属性</p></li><li><p>nextSibling属性</p></li></ul><hr/><p style=\"margin-top: 0px; margin-bottom: 1.1em; padding: 0px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\">代码如下:</strong></p><pre class=\"brush:js;toolbar:false;\">function insertAfter(newElement,targetElement) {\r\n var parent=targetElement.parentNode; \r\n if (parent.lastChild==targetElement) { \r\n parent.appendChild(newElement);\r\n } else {\r\n parent.insertBefore(newElement,targetElement.nextSibling);\r\n }\r\n}</pre><p style=\"margin-top: 0px; margin-bottom: 1.1em; padding: 0px; box-sizing: border-box;\"><strong style=\"box-sizing: border-box;\"></strong><br/></p>');
INSERT INTO `title` VALUES ('3', '放手去闯吧', '2016-12-08', '543', '大三了,两年多的时间,就这么悄悄地走过,还有一年,就要离开烟台这个地方了,我,准备好了吗?看看眼前:每一次空闲时间特别多的时候,我都会提前想一想,我要做什么,可是时间过去之后,发现自己做的都是无用功,生生的把时间给浪费了。还记得大二的暑假,因为临放假前刚刚培训完H5,并且最后web的课程设计有一个js需要... ', '<h4 style=\"margin: 0.8em 0px; padding: 0px; box-sizing: border-box; font-weight: 100; font-family: "microsoft yahei"; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"box-sizing: border-box;\">大三了,两年多的时间,就这么悄悄地走过,还有一年,就要离开烟台这个地方了,我,准备好了吗?</strong></h4><hr/><h4 style=\"margin: 0.8em 0px; padding: 0px; box-sizing: border-box; font-weight: 100; font-family: "microsoft yahei"; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><a style=\"color: rgb(255, 153, 0); box-sizing: border-box;\"></a><strong style=\"box-sizing: border-box;\">看看眼前:</strong></h4><p style=\"margin-top: 0px; margin-bottom: 1.1em; padding: 0px; box-sizing: border-box; font-family: "microsoft yahei"; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\">每一次空闲时间特别多的时候,我都会提前想一想,我要做什么,可是时间过去之后,发现自己做的都是无用功,生生的把时间给浪费了。还记得大二的暑假,因为临放假前刚刚培训完<strong style=\"box-sizing: border-box;\">H5</strong>,并且最后<strong style=\"box-sizing: border-box;\">web</strong>的课程设计有一个js需要实现的地方我未完成,所以还没有放假,我就决定暑假一定好好学一下js。然而暑假的确到了,不到一个月的时间,<strong style=\"box-sizing: border-box;\">js</strong>我只是浅浅的一看,却花了大量的时间去看下一学期要学习的<strong style=\"box-sizing: border-box;\">jsp</strong>,以前听说过jsp只需要一个周的时间,我也明白,所谓的一个周,只是表面的理解,学而易,精而难,就是这个样子。现在接触了<strong style=\"box-sizing: border-box;\">jsp</strong>,又发现暑假时又走了那么多的弯路,还好吧,我是一个心理能力接受比较强的人,很多事情也不能总是很在意结果,过程同样重要嘛,肯定会有收获。 <br/>今天看到了一个词——命格,人的一辈子,从出生后,命便注定,但是随着自己的成长,因为外界的很多因素,运在不断的改变着,从而有了人们所说的命运。年纪轻轻的我,不完全认可,也不是绝对的否定。但我依旧坚持,<strong style=\"box-sizing: border-box;\">不是命改变人,而是人改变命,命也好,运也罢,好好珍惜眼前,脚踏实地就好。</strong></p><hr/><h4 style=\"margin: 0.8em 0px; padding: 0px; box-sizing: border-box; font-weight: 100; font-family: "microsoft yahei"; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><a style=\"color: rgb(255, 153, 0); box-sizing: border-box;\"></a><strong style=\"box-sizing: border-box;\">过去的两年:</strong></h4><p style=\"margin-top: 0px; margin-bottom: 1.1em; padding: 0px; box-sizing: border-box; font-family: "microsoft yahei"; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\">过去的两年,我花的最多的时间,就是打排球吧。但是我没有后悔什么,从最初的起点说,我高中时是一个体育生,再一次走到训练场,又有了新的队友,那种感觉还是用语言无法表达的。我女朋友曾经和我说,**养成一个习惯,只需要20天。**20天?在球场上,我在不止10倍的时间里,早起,训练,上课,约球……排球真的已经占据了我大学里的大部分。 <br/>我遇到了恩师,遇到了师哥师姐,遇到了女朋友,遇到了那么多的球友。甚至很多次,可以用我练的排球回到家乡去和他们一起去打比赛。大一,我只是开开心心的去打球,大二那一年,我迎来了我的第一批师弟师妹,这学期,大三的我,本没有了以前那么多的激情,但是看着那一群可爱的16级师弟师妹,肩上的责任又重了。我说过,我不是希望在我毕业之前我们拿到一个好的成绩,我只希望你们有一天在北排打球的时候不是你们自己一人。大二初,和我同一级进入球队的,因为各种原因纷纷退队,我自己一个人在北排呆了一年,这种感觉真的是够了。等我毕业,送我们4个人的,会是一大批人,球队壮大了,那就满足了。 <br/>我不得不承认,我是一个争强好胜的人,但是我个人认为,这没有什么错,关键在于如何去把握一个度的问题。所谓的争强好胜,不是狂妄自大,也正因为如此,一直激励着我在面对我喜欢的,我想做的事情面前,我要不断的努力,去做的更好的一些。</p><h4 style=\"margin: 0.8em 0px; padding: 0px; box-sizing: border-box; font-weight: 100; font-family: "microsoft yahei"; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"box-sizing: border-box;\">剩下的日子:</strong></h4><p style=\"margin-top: 0px; margin-bottom: 1.1em; padding: 0px; box-sizing: border-box; font-family: "microsoft yahei"; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\">我想起两个周前,我给妈妈打电话时,她说了一句让我一直忘不掉的话。<strong style=\"box-sizing: border-box;\">“今年工作感觉好累啊,老儿,你说我能坚持到你结婚的那一天吗?”</strong>我一时语塞,不知道该如何回答,每次给妈妈打电话发短信,我都会特意嘱咐,一定要好好休息,工作不要太累,我想要的并不多,很多我自己慢慢去满足。自从有了我,这个”傻“女人生命的全部意义,好像都在我的身上,总是那么的不顾一切。 <br/>2016年10月底,我创建了这个博客,以前看到的是我哥的技术博客,以为搭建这个东西很难,我不用了不同的技术,熬到了晚上1点多,终于成功,原来想要实现的东西,只要动起手来,又是那么的简单了。 <br/>11月的烟台,冷冷的,今天开始穿上了秋裤,这样的天气,似乎只适合睡觉,但是已经没有理由这样去放纵自己了。<strong style=\"box-sizing: border-box;\">2016年只剩下16.7%,好好读几本书,让自己的心,先静下来。</strong></p><hr/><h3 style=\"margin: 0.8em 0px; padding: 0px; box-sizing: border-box; font-weight: 100; font-family: "microsoft yahei"; white-space: normal; background-color: rgb(255, 255, 255);\"><a style=\"color: rgb(255, 153, 0); box-sizing: border-box;\"></a><strong style=\"box-sizing: border-box;\">有志者、事竟成,破釜沉舟,百二秦关终属楚;</strong></h3><h3 style=\"margin: 0.8em 0px; padding: 0px; box-sizing: border-box; font-weight: 100; font-family: "microsoft yahei"; white-space: normal; background-color: rgb(255, 255, 255);\"><a style=\"color: rgb(255, 153, 0); box-sizing: border-box;\"></a><strong style=\"box-sizing: border-box;\">苦心人、天不负,卧薪尝胆,三千越甲可吞吴</strong></h3><p><strong style=\"box-sizing: border-box;\"></strong></p>');
INSERT INTO `title` VALUES ('4', '两个人的生活', '2016-11-10', '351', '男孩是一个工科生兼体育生,女孩是一个文科生,但语言表达能力却差到了极致。他过着快节奏的生活,走路快,做很多事似乎也是快中夹杂着满满的急躁。女孩呢,整天慢悠悠的过着属于自己的生活,天真,在男孩眼里,有点傻,有一份悠闲,有一份懒散,甚至说她目标是啥都不知道也不为过。也许是男孩专业的原因,也许是... ', '<p><span style=\"font-family: Arial; font-size: 14px; background-color: rgb(255, 255, 255);\"> 男孩是一个工科生兼体育生,女孩是一个文科生,但语言表达能力却差到了极致。他过着快节奏的生活,走路快,做很多事似乎也是快中夹杂着满满的急躁。女孩呢,整天慢悠悠的过着属于自己的生活,天真,在男孩眼里,有点傻,有一份悠闲,有一份懒散,甚至说她目标是啥都不知道也不为过。也许是男孩专业的原因,也许是体育的原因,有时就像写程序一样,讲究这个算法的效率;像跑一个百米,终点会有人给你掐着秒表。</span><br/><span style=\"font-family: Arial; font-size: 14px; background-color: rgb(255, 255, 255);\"> 但是,男孩不得不承认,走的太急,走的太快,有时会忘记起点在哪,忘记为何出发。很不幸的是,女孩是一个没心没肺的人,也是一个有耐心的人,总是能在关键的时候,陪他停下步,慢慢的去享受一段很短的旅程,男孩也很享受这些少有的日子。</span><br/><span style=\"font-family: Arial; font-size: 14px; background-color: rgb(255, 255, 255);\"> 在实验室呆了一晚上,没有看一眼手机,下课后习惯性的拿出手机,看了一眼,好长的消息,很心疼女孩原来因为男孩受了这么大的无奈和委屈,男孩却全然不知,那时心里真的是五味杂陈。</span><br/><span style=\"font-family: Arial; font-size: 14px; background-color: rgb(255, 255, 255);\"> 两个人在一起的生活,都希望是开心的,但是,肯定少不了的有吵架.有眼泪,这也是给生活添加一些别样的乐趣吧。</span><br/><span style=\"font-family: Arial; font-size: 14px; background-color: rgb(255, 255, 255);\"> 男孩是理科生,有时读不懂女孩的心;女孩是文科生,语言能力差却总会给男生带来一次次的惊喜和感动。不过,很幸运,男孩和女孩都是排球人吧。</span><br/><span style=\"font-family: Arial; font-size: 14px; background-color: rgb(255, 255, 255);\"> 夜深了,女孩带着一句很简单的晚安,现在已经睡了,也不知道,是否还在不开心,不满意。</span><br/><span style=\"font-family: Arial; font-size: 14px; background-color: rgb(255, 255, 255);\"> 相信,明天的烟台,明天的女孩,依旧会很好。</span></p><p><img src=\"http://img.baidu.com/hi/jx2/j_0078.gif\"/></p>');
INSERT INTO `title` VALUES ('5', 'Only one Two years', '2016-11-12', '541', '2014.06.08高考结束,一年后的今天,我们再次坐在一起。 今天人蛮多的,一去我就在寻找电哥的身影,没有想到,电哥先叫了我一声:史小坤。真的不知道电哥今天这样喊了我多少声。 2年前的晚自习,那是高三刚刚开始,电哥把我叫到了楼道,问我压力大吗?我说还好吧,可能会有,因... ', '<p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 宋体; font-size: 10.5pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">2014.06.08</span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">高考结束,一年后的今天,我们再次坐在一起。</span></span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">今天人蛮多的,一去我就在寻找电哥的身影,没有想到,电哥先叫了我一声:史小坤。真的不知道电哥今天这样喊了我多少声。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 宋体; font-size: 10.5pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">2</span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">年前的晚自习,那是高三刚刚开始,电哥把我叫到了楼道,问我压力大吗?我说还好吧,可能会有,因为我一闭眼就要做梦,哪怕只睡</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">10</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">分钟,也会做梦。他问我,你去练体育怎么样。当时其实我自己就挺想去的,因为我已经不知道是什么一股阻力让我的学习死死的卡在那,不管是整天玩,还是很努力的学,几乎都改变不了。那晚,我们聊了整整一节晚自习。我就那么答应了。但是当时电哥和我说的是,即使你练体育了,你最后并不一定走体育,去放松一下,去改变一下自己的心态。或许会有意想不到的惊喜。</span></span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">我从来没有想到我会走体育这条路,我也从来没有想到我会一直坚持到我到济南体测结束,我更没有想到,也就是体育,改变了我整个的人生轨迹。我没有想到我的生活中会出现两次类似,两年前的9月,我在高中,踏入了田径场。当我以为我大学会彻底放弃体育后,一年前的9月,在大学,我又踏入了排球场。还好,我的体育梦还在,体育人。</span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">今天,两个人,问了我两个是否后悔。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">电哥问我:史小坤,我让你去练体育后悔么?我说,不后悔,如果没有训练场上的那些日子,也没有现在的我,我也不会考出那个成绩。电哥笑着说:这两年,我做了很多决定,我尝试着去改变很多我的学生,那晚我们的谈话,是我最明智的一次,也是我最成功,最骄傲的一次。和咱当初说的一样,你最后并不一定走体育。现在,挺好的。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 宋体; font-size: 10.5pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">英语老师问我:史坤,选择了用文化课成绩去鲁东挑战你自己,没有用体育去华师大,是不是很后悔啊。 我回答说:也许曾经是有吧,但现在我仍想说,不后悔。的确,上海是除大连之外,我最喜欢的城市了,更何况一所</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">211.985</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">大学, 免费的学习条件,对我诱惑挺大的,但我仍放弃了,虽然这是我曾经踏入训练场后唯一的大学目标。不过,轻松来到的生活,被别人安排的生活,又怎么体验到现在的快乐。</span></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">很庆幸,你们在为我有这样的勇气做出这样决定惊讶的同时,时至今日,也支持肯定了我的想法。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 宋体; font-size: 10.5pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">Only one Two years.</span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">很多人明白,但是也有更多的人不明白。只因为在英语老师</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">10</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">多年的教学中,我们是唯一一批在高中生涯里让她教过两年的。记得大学第一节英语精读课,老师问我们高中是怎么学好英语的,当提问到我时,我站起来很奇葩的说:我有一个好老师,她是我们市最好的英语老师,不用特意拿着英语单词去背,就可以学好英语。其实,最重要的还是她改变了我们。不仅仅是成绩,还有做人。想想我们那一大帮子每次英语六七十分的人,从未想过我们可以考</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">100</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">多分。想想没有英语带给我们的提高,高考对我们而言,注定是一场失败的旅途。</span></span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 宋体; font-size: 10.5pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">当时,我把这</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">4</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">个单词发到了青协</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">15</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">级的纳新群,学妹问这是什么意思,也许我的回答没有人会看懂。这,不就是缘分吗?我没有想让任何人去理解它的表面意思,只有一次的两年?也许,但这只是表面,人生,不就是这么多的巧合,巧合中又带着很大的缘分吗?什么叫做命中注定,并不是去相信命,而是去改变。</span></span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">我想用一句话和三个词结束我今天的聚会。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">路 ,选了,错没错,不知道,重要吗,不重要,关键是你怎么去走你选择的路。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">缘分、意想不到、感恩。<img src=\"http://img.baidu.com/hi/jx2/j_0059.gif\"/></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\"><img src=\"http://img.baidu.com/hi/jx2/j_0076.gif\"/></span></p>');
INSERT INTO `title` VALUES ('6', 'Only one Two years', '2016-11-17', '365', '2014.06.08高考结束,一年后的今天,我们再次坐在一起。 今天人蛮多的,一去我就在寻找电哥的身影,没有想到,电哥先叫了我一声:史小坤。真的不知道电哥今天这样喊了我多少声。 2年前的晚自习,那是高三刚刚开始,电哥把我叫到了楼道,问我压力大吗?我说还好吧,可能会有,因... ', '<p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 宋体; font-size: 10.5pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">2014.06.08</span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">高考结束,一年后的今天,我们再次坐在一起。</span></span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">今天人蛮多的,一去我就在寻找电哥的身影,没有想到,电哥先叫了我一声:史小坤。真的不知道电哥今天这样喊了我多少声。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 宋体; font-size: 10.5pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">2</span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">年前的晚自习,那是高三刚刚开始,电哥把我叫到了楼道,问我压力大吗?我说还好吧,可能会有,因为我一闭眼就要做梦,哪怕只睡</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">10</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">分钟,也会做梦。他问我,你去练体育怎么样。当时其实我自己就挺想去的,因为我已经不知道是什么一股阻力让我的学习死死的卡在那,不管是整天玩,还是很努力的学,几乎都改变不了。那晚,我们聊了整整一节晚自习。我就那么答应了。但是当时电哥和我说的是,即使你练体育了,你最后并不一定走体育,去放松一下,去改变一下自己的心态。或许会有意想不到的惊喜。</span></span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">我从来没有想到我会走体育这条路,我也从来没有想到我会一直坚持到我到济南体测结束,我更没有想到,也就是体育,改变了我整个的人生轨迹。我没有想到我的生活中会出现两次类似,两年前的9月,我在高中,踏入了田径场。当我以为我大学会彻底放弃体育后,一年前的9月,在大学,我又踏入了排球场。还好,我的体育梦还在,体育人。</span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">今天,两个人,问了我两个是否后悔。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">电哥问我:史小坤,我让你去练体育后悔么?我说,不后悔,如果没有训练场上的那些日子,也没有现在的我,我也不会考出那个成绩。电哥笑着说:这两年,我做了很多决定,我尝试着去改变很多我的学生,那晚我们的谈话,是我最明智的一次,也是我最成功,最骄傲的一次。和咱当初说的一样,你最后并不一定走体育。现在,挺好的。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 宋体; font-size: 10.5pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">英语老师问我:史坤,选择了用文化课成绩去鲁东挑战你自己,没有用体育去华师大,是不是很后悔啊。 我回答说:也许曾经是有吧,但现在我仍想说,不后悔。的确,上海是除大连之外,我最喜欢的城市了,更何况一所</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">211.985</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">大学, 免费的学习条件,对我诱惑挺大的,但我仍放弃了,虽然这是我曾经踏入训练场后唯一的大学目标。不过,轻松来到的生活,被别人安排的生活,又怎么体验到现在的快乐。</span></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">很庆幸,你们在为我有这样的勇气做出这样决定惊讶的同时,时至今日,也支持肯定了我的想法。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 宋体; font-size: 10.5pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">Only one Two years.</span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">很多人明白,但是也有更多的人不明白。只因为在英语老师</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">10</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">多年的教学中,我们是唯一一批在高中生涯里让她教过两年的。记得大学第一节英语精读课,老师问我们高中是怎么学好英语的,当提问到我时,我站起来很奇葩的说:我有一个好老师,她是我们市最好的英语老师,不用特意拿着英语单词去背,就可以学好英语。其实,最重要的还是她改变了我们。不仅仅是成绩,还有做人。想想我们那一大帮子每次英语六七十分的人,从未想过我们可以考</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">100</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">多分。想想没有英语带给我们的提高,高考对我们而言,注定是一场失败的旅途。</span></span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 宋体; font-size: 10.5pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">当时,我把这</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">4</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">个单词发到了青协</span><span style=\"font-family: "Times New Roman";\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">15</span></span><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">级的纳新群,学妹问这是什么意思,也许我的回答没有人会看懂。这,不就是缘分吗?我没有想让任何人去理解它的表面意思,只有一次的两年?也许,但这只是表面,人生,不就是这么多的巧合,巧合中又带着很大的缘分吗?什么叫做命中注定,并不是去相信命,而是去改变。</span></span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">我想用一句话和三个词结束我今天的聚会。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">路 ,选了,错没错,不知道,重要吗,不重要,关键是你怎么去走你选择的路。</span><span style=\"font-family: 宋体; font-size: 10.5pt;\"></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\">缘分、意想不到、感恩。<img src=\"http://img.baidu.com/hi/jx2/j_0059.gif\"/></span></p><p style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; text-indent: 21pt;\"><span style=\"font-family: 楷体, 楷体_GB2312; font-size: 16px; font-weight: bold;\"><img src=\"http://img.baidu.com/hi/jx2/j_0076.gif\"/></span></p>');
INSERT INTO `title` VALUES ('7', 'session和cookie', '2016-11-23', '964', '为什么我们要使用session和cookie 为什么要使用session和cookie这个话题就要从HTTP状态协议的无状态性开始说起了。 无状态协议是指协议对事物处理没有记忆能力。缺少状态意味着如果后续处理需要前面的信息,则必须重传,这样可能导致每次连接传送的数据量增大。另一方面,在服务...', '<p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">为什么我们要使用session和cookie</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">为什么要使用session和cookie这个话题就要从HTTP状态协议的无状态性开始说起了。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\"><span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">无状态协议是指协议对事物处理没有记忆能力</strong></span>。缺少状态意味着如果后续处理需要前面的信息,则必须重传,这样可能导致每次连接传送的数据量增大。另一方面,在服务器不需要先前信息时它应答就很快。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">HTTP是超本文传输协议,顾名思义,这个协议支持超文本的传输。什么是超文本?说白了就是使用HTML编写的页面。通常,我们使用客户端浏览器访问服务器的资源,最常见的URL也是以html为后缀的文件,因此可以说超文本是网络上最主要的资源。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">既然HTTP协议的目的是在于支持超文本的传输,也就是资源的传输,那么客户端浏览器向HTTP服务器发送请求,继而HTTP服务器将相信资源发回给客户端这样一个过程中,无论对于客户端还是服务器,都没有必要记录这个过程,因为每一次请求和响应都是相对独立的,就像我们在自动售货机前投下硬币购买商品一样,没必要记录这个交易过程。一般而言,一个URL对应着一个唯一的超文本,而HTTP服务器也绝对公平公正,无论是谁,都会根据接收到的URL请求返回相同的超文本。正是因为这样的唯一性,使得记录用户的行为状态变得毫无意义,所以,HTTP协议被设计为无状态的连接协议符合它本身的需求。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">HTTP协议这种特性有优点也有缺点,优点在于解放了服务器,每一次请求"点到为止",不会造成不必要的连接占用,缺点在于每次请求都会传输大量的重复信息内容。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">为了解决HTTP传输大量重复信息内容的问题,cookie和session就登场了,它们可以为用户保存状态。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">cookie</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">cookie是通过客户端保持状态的解决方案。从定义上说,cookie就是服务器发送给客户端的特殊信息,而这些信息以文本文件的方式存放在客户端,然后客户端每次向服务器发送请求的时候都会带上这些特殊的信息。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">更具体一点说,当用户使用浏览器访问一个支持cookie的网站的时候,会有如下步骤:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、用户会提供包括用户名在内的个人信息并且提交至服务器</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、服务器在向客户端会传相应的超文本的同时,发回这些个人信息。当然这些信息并不是存放在HTTP响应体(Response Body)中的,而是存放在HTTP响应头(Response Header)中的</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">3、当客户端浏览器收到来自服务器的响应之后,浏览器会将这些信息存放在一个统一的位置</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">4、之后,客户端再向服务器发送请求的时候,都会把相应的cookie再次返回至服务器,而这次,cookie信息则存放在HTTP请求头中了。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\"></span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">session</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">session是相对于cookie的另外一个解决方案,它是通过服务器来保持状态的。session指的是服务器为客户端所开辟的存储空间,在其中保存的信息就是用于保存状态的。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">首先,session是服务器端程序运行的过程中创建的,不同语言实现的应用程序有不同创建session的方法。在创建了session的同时,服务器会为该session生成唯一的sessionId,而这个sessionId被创建了之后,就可以调用session相关的方法往session中增加内容了,<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">而这些内容只会保存在服务器中,发送到客户端的只有sessionId</strong></span>。当客户端再次发送请求时,会将这个sessionId带上,服务器收到请求之后就会根据sessionId找到对应的session,从而再次使用。这样的一个过程,让用户的状态得以保持。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">其次,每个session都有一个sessionId,这个ID存放在哪里?有两种方式:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、通过URL存取,URL会带上一个;jsessionId=xxxxxx等,这样每次重新请求的时候都传了sessionId给服务器</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、通过cookie存取(Tomcat默认如此),这种cookie是session cookie,区别于persistent cookies也就是我们常说的cookie,session cookie要注意的是存储在浏览器内存中(至于浏览器内存在哪里,这是和浏览器相关的,比方说我用的是360浏览器,那就在<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">360se6\\User Data\\Default</strong></span>这个路径下)而不是写到硬盘上。程序一开始执行,服务器就生成一个sessionId并通过cookie携带客户端浏览器的缓存中,当下一次访问的时候,服务器先检测一下是否有这个cookie,如果有就取它的ID,如果没有就再生成一个。这就是为什么关闭浏览器之后,再进去session已经没有了,其实在服务器端session并没有清空,而是sessionId变了。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">再者,浏览器关闭,session没有了的说法是不正确的。如果浏览器关闭,服务器保存的session数据不是立即释放的,此时数据还会存在,只要我们知道那个sessionId,就可以继续通过请求获得此session的信息。session里面的数据都放在服务器端,通过sessionId保证不会访问错误,服务端自动对session进行管理,如果在规定的时间内没有访问,则释放掉这个session。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">最后提两点:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、sessionId通常是看不到的,但是当我们把浏览器的cookie禁止之后,Web服务器会采用URL重写的方式传递sessionId,这样就可以在地址栏看到sessionId了</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、session cookie不可以跨窗口使用</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><br/></p>');
INSERT INTO `title` VALUES ('8', 'GET和POST的区别', '2016-11-25', '325', '原理性上的区别HTTP定义了与服务器交互的不同方法,最基本的方法有4种,分别是GET、POST、PUT、DELETE。URL全称是资源描述符,我们可以这么认为:一个URL地址,它用于描述网络上的一个资源,而HTTP的GET、POST、PUT、DELETE就对应着对这个资源的查、改、增、删4个操作。所... ', '<p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">原理性上的区别</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">HTTP定义了与服务器交互的不同方法,最基本的方法有4种,分别是GET、POST、PUT、DELETE。URL全称是资源描述符,我们可以这么认为:一个URL地址,它用于描述网络上的一个资源,而HTTP的GET、POST、PUT、DELETE就对应着对这个资源的<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">查</strong></span>、<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">改</strong></span>、<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">增</strong></span>、<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">删</strong></span>4个操作。所以GET和POST的第一个区别:GET一般用于<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">获取/查询资源</strong></span>信息,POST一般用于<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">更新</strong></span>资源信息。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、根据HTTP规范,GET用于信息获取,而且应该是安全和幂等的,安全和幂等的意思是:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(1)所谓安全意味着该操作用于获取信息而不是修改信息,换句话说,GET请求一般不应该产生副作用,也就是说,它仅仅是获取资源信息,就像数据库查询一样,不会修改、增加数据,不影响资源的状态</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(2)所谓幂等意味着对同一个URL的多个请求应该返回相同的结果</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">比如一个新闻网站,读者打开一个链接获取新闻应该使用GET实现</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、根据HTTP规范,POST表示可能修改服务器上的资源的请求,比如一个新闻网站,读者对新闻资源发表的评论应该通过POST实现,因为在评论提交之后站点的资源已经不同了,或者说是资源被修改了</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">另外还有很重要的一点,从浏览器发起一次HTTP请求:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、一些静态资源比如.css文件、.js文件是很少发生变化的,让这些文件放在浏览器缓存里面,请求的时候从浏览器缓存里面拿这些资源而不去服务器上拿,可以有效地减轻服务端的压力,加快浏览器的访问速度</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、服务器响应完可能将一些资源放到客户端的浏览器缓存中</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">而<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">只有GET方式才能从缓存中存、取资源</strong></span>,POST方式则不可以。</span></p>');
INSERT INTO `title` VALUES ('9', 'Request中的各种方法', '2016-11-27', '568', '前言Request中方法众多,对于Java Web程序员来说,种种方法都会在工作中常常用到。Request由于不是JDK的一部分,这些方法的用法也没有专门的API可以查,所以在工作中遇到Request中方法的时候,所以常常感到困惑,因为觉得网上写的不清楚,自己又懒得写一个Web测试... ', '<p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">前言</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">Request中方法众多,对于Java Web程序员来说,种种方法都会在工作中常常用到。Request由于不是JDK的一部分,这些方法的用法也没有专门的API可以查,所以在工作中遇到Request中方法的时候,所以常常感到困惑,因为觉得网上写的不清楚,自己又懒得写一个Web测试程序。这篇文章,一次性把Request中的各个方法的返回写在这里并做一个详细的总结,以备以后工作中用到可以随时查看。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">示例</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">为了让后台可以取到queryString(这个专门在get和post的区别的文章中会讲解的),做一个表单,用post方式提交:</span></p><pre class=\"brush:html;toolbar:false\"><body>\r\n <form action="request?a=1&b=2&c=3" method="post">\r\n <input type="submit" value=" 提交 " />\r\n </form>\r\n</body></pre><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);\"><span style=\"font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);\">web.xml就不写了,大家应该都会配置,看下后台doPost方法的写法:</span></span></p><pre class=\"brush:java;toolbar:false\">protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException\r\n{\r\n System.out.println("request.getAuthType():" + request.getAuthType()); // 获取保护servlet的认证方案名(BASIC或SSL),未受保护的servlet返回的就是null\r\n System.out.println("request.getCharacterEncoding():" + request.getCharacterEncoding()); // 获取字符编码\r\n System.out.println("request.getContentLength():" + request.getContentLength()); // 返回请求体内容的长度\r\n System.out.println("request.getContentType():" + request.getContentType()); // 获取内容类型\r\n System.out.println("request.getContextPath():" + request.getContextPath()); // 获取上下文路径,就是"/"+工程名\r\n System.out.println("request.getLocalAddr():" + request.getLocalAddr()); // 获取应用服务器的IP地址\r\n System.out.println("request.getLocalName():" + request.getLocalName()); // 获取应用服务器的主机名\r\n System.out.println("request.getLocalPort():" + request.getLocalPort()); // 获取应用服务器的端口号\r\n}</pre><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\"></span><span style=\"font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);\">getParameter、getAttribute/setAttribute、getSession/setSession等类似方法,大家都比较熟悉,也比较不会搞错,就不列了,列的都是一些相对不常用的request方法。很多方法都已经能看出返回的是什么了,但是有些方法由于我这里是从本地发到本地的,所以看不到效果,不过注释上也给了详细的解释了,两个没写注释的方法查不到是什么意思,也试不出来怎么样才不是null,以后会记得关注,知道了就会更新。</span></p>');
INSERT INTO `title` VALUES ('10', 'HTTP解析', '2016-12-02', '875', '前言 B/S网络架构的核心是HTTP,掌握HTTP对一个从事互联网工作的程序员来说非常重要。要理解HTTP,最重要的是要熟悉HTTP的HTTP Header,HTTP Header控制着互联网上成千上万用户的数据传输。最关键的是,它控制着用户浏览器的渲染行为和服务器的执行逻辑。例如,当服务器没有用户 ', '<p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">前言</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">B/S网络架构的核心是HTTP,掌握HTTP对一个从事互联网工作的程序员来说非常重要。要理解HTTP,最重要的是要熟悉HTTP的HTTP Header,HTTP Header控制着互联网上成千上万用户的数据传输。最关键的是,它控制着用户浏览器的渲染行为和服务器的执行逻辑。例如,当服务器没有用户请求的数据的时候就会返回一个404状态码,告诉浏览器没有要请求的数据,通常浏览器就会展示一个非常不愿意看到的该页面不存在的错误信息。OK,接下来开始对于HTTP的学习。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">HTTP是什么</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">HTTP,英文全称为HyperText Transfer Protocol,即超文本传输协议,是互联网上应用最为广泛的一种网络协议。HTTP是一种属于<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">应用层</strong></span>的面向对象的协议,一次HTTP操作称为一个实物,其简单工作过程如图:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\"><img src=\"http://images2015.cnblogs.com/blog/801753/201510/801753-20151024194928130-1227147148.png\" alt=\"\"/></span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">其工作过程可以分为四步:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、首先客户端与服务器需要建立连接,只需要单击某个超级链接,HTTP的工作开始</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、建立连接后,客户端发送一个请求给服务器(默认请求服务器的80端口),请求方式的格式为:统一资源标识符(URL)+协议版本号+MIME信息包括请求修饰符、客户端信息和可能的内容</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">3、服务器接收到请求后,给予响应的相应信息,其格式为一个状态行,包括信息的协议版本号、一个成功或错误的代码,后面是MIME信息包括服务器信息、实体信息和可能的内容</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">4、客户端接收服务器所返回的信息通过浏览器显示在用户的显示屏上,然后客户端和服务器断开连接</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">以上的过程中任意一步出错,那么产生的错误信息将返回到客户端,由显示屏输出。对于用户来说,这些过程都是HTTP自己完成的,用户只要用鼠标点击,等待信息显示就可以了。HTTP协议的主要特点可以概括如下:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、支持客户端/服务器模式</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、简单快速,客户端向服务器发送请求服务时,只需要传送请求方法和路径。由于HTTP协议简单,使得HTTP服务器的程序规模小,因而通信速度快</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">3、灵活,HTTP允许传输任意类型的数据对象,正在传输的类型由Content-Type加以标记</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">4、无连接,无连接的含义是限制每次连接只处理一个请求,服务器处理完成客户端的请求,并收到客户的应答后,即断开连接。采用这种方式可以节省传输时间</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">5、无状态,HTTP协议是无状态协议,五张太是指协议对于事物处理没有记忆能力,血少状态意味着如果后续处理需要前面的信息,则它必须重传,这样可能导致每次连接传输的数据量增大。另一方面,在服务器不需要先前信息时它的应答就较快</span></p><p><br/></p>');
INSERT INTO `title` VALUES ('11', '两种include方式及filter中的dispatcher解析', '2016-12-05', '576', '两种include方式我自己写了一个original.jsp,另外有一个includedPage.jsp,我想在original.jsp中把includedPage.jsp引进来有两种方式:1、,这是一种include指令2、,这是一种include动作先讲原理再讲区别,所有的jsp页面在后台,会先... ', '<p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">两种include方式</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">我自己写了一个original.jsp,另外有一个includedPage.jsp,我想在original.jsp中把includedPage.jsp引进来有两种方式:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、<%@ include file="includedPage.jsp" %>,这是一种include指令</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、<jsp:include page="includedPage.jsp" />,这是一种include动作</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">先讲原理再讲区别,所有的jsp页面在后台,会先被转换为一个Servlet,就比如这个includedPage.jsp吧:</span></p><pre class=\"brush:java;toolbar:false\">public final class includedPage_jsp extends org.apache.jasper.runtime.HttpJspBase\r\n implements org.apache.jasper.runtime.JspSourceDependent {\r\n\r\n private static final JspFactory _jspxFactory = JspFactory.getDefaultFactory();\r\n\r\n private static java.util.List _jspx_dependants;\r\n\r\n private javax.el.ExpressionFactory _el_expressionfactory;\r\n private org.apache.AnnotationProcessor _jsp_annotationprocessor;\r\n...\r\n}</pre><p><span style=\"font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);\">而这个HttpJspBase:</span></p><pre class=\"brush:java;toolbar:false\">public abstract class HttpJspBase extends HttpServlet\r\n implements HttpJspPage\r\n{\r\n public final void init(ServletConfig config)\r\n throws ServletException\r\n {\r\n super.init(config);\r\n jspInit();\r\n _jspInit();\r\n }\r\n ...\r\n}</pre><p><span style=\"font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; background-color: rgb(255, 255, 255);\">实际应用中,一般都会使用include动作即<jsp:include page="includedPage.jsp" />的方式来嵌入页面,因为include动作虽然在执行效率上稍稍慢于jsp指令,但是在维护性上却远胜。因为我们使用jsp动作的话,被嵌入的页面如果发生了变化,那么所有包含被嵌入页面的Servlet都要重新编译并更新,这是一个很大的代价。</span><span style=\"font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255);\"></span><br/></p>');
INSERT INTO `title` VALUES ('12', '一些常用的Spring Bean扩展接口', '2016-12-07', '663', '前言 Spring是一款非常强大的框架,可以说是几乎所有的企业级Java项目使用了Spring,而Bean又是Spring框架的核心。 Spring框架运用了非常多的设计模式,从整体上看,它的设计严格遵循了OCP 开闭原则,即: 1、保证对修改关闭,即外部无法修改Spring整个运作的流程 2、提供... ', '<p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px; line-height: 1.5;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">前言</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">Spring是一款非常强大的框架,可以说是几乎所有的企业级Java项目使用了Spring,而Bean又是Spring框架的核心。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">Spring框架运用了非常多的设计模式,从整体上看,它的设计严格遵循了OCP----开闭原则,即:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、保证对修改关闭,即外部无法修改Spring整个运作的流程</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、提供对扩展开放,即可以通过继承、实现Spring提供的众多抽象类与接口来改变类加载的行为</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">开卷有益,阅读Spring源码(无需每个类都看得很细,大体流程能梳理出来即可)对于个人水平的提升是帮助非常大的,同时也能在工作中即使发现和解决一些不常见的Spring问题。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">不过,本文的目的不是整理Spring的流程,而是通过介绍一些常用的Spring Bean工具类,来让我们可以更好地使用Spring提供给开发者的多种特性,下面让我们开始吧。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">InitialingBean和DisposableBean</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">InitialingBean是一个接口,提供了一个唯一的方法afterPropertiesSet()。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">DisposableBean也是一个接口,提供了一个唯一的方法destory()。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">这两个接口是一组的,功能类似,因此放在一起:前者顾名思义在Bean属性都设置完毕后调用afterPropertiesSet()方法做一些初始化的工作,后者在Bean生命周期结束前调用destory()方法做一些收尾工作。下面看一下例子,为了能明确地知道afterPropertiesSet()方法的调用时机,加上一个属性,给属性set方法,在set方法中打印一些内容:</span></p><pre class=\"brush:java;toolbar:false\">public class LifecycleBean implements InitializingBean, DisposableBean\r\n{\r\n @SuppressWarnings("unused")\r\n private String lifeCycleBeanName;\r\n \r\n public void setLifeCycleBeanName(String lifeCycleBeanName)\r\n {\r\n System.out.println("Enter LifecycleBean.setLifeCycleBeanName(), lifeCycleBeanName = " + lifeCycleBeanName);\r\n this.lifeCycleBeanName = lifeCycleBeanName;\r\n }\r\n\r\n public void destroy() throws Exception\r\n {\r\n System.out.println("Enter LifecycleBean.destroy()");\r\n }\r\n\r\n public void afterPropertiesSet() throws Exception\r\n {\r\n System.out.println("Enter LifecycleBean.afterPropertiesSet()");\r\n }\r\n \r\n public void beanStart()\r\n {\r\n System.out.println("Enter LifecycleBean.beanStart()");\r\n }\r\n \r\n public void beanEnd()\r\n {\r\n System.out.println("Enter LifecycleBean.beanEnd()");\r\n }\r\n}</pre><p><br/></p>');
INSERT INTO `title` VALUES ('13', 'Linux概述', '2016-12-17', '10', '服务器尤其是大型服务器一般都使用Linux系统,有以下几点原因:\r\n1、成本低,Linux操作系统是免费的\r\n2、安全性好,Linux采取了许多的安全措施,包括对读写 ....', '<p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">为什么服务器尤其大型服务器都使用Linux系统</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">服务器尤其是大型服务器一般都使用Linux系统,有以下几点原因:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、成本低,Linux操作系统是免费的</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、安全性好,Linux采取了许多的安全措施,包括对读写权限控制、带保护的子系统、审计跟踪、核心授权等,为网络多用户环境中的用户提供了必要的安全保障</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">3、网络功能强大,Linux在通信和网络功能方面优于其他操作系统</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">4、开源性,这意味着管理员可以对系统随意进行定制</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"> </p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">Linux用户和组的概念</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、用户</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">用户是能够获取系统资源的权限的集合</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、Linux用户组分类</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(1)管理员root:具有使用系统所有权限的用户,UID为0</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(2)普通用户:即一般用户,其使用系统的权限受限,UID在500-60000之间</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(3)系统用户:保障系统运行的用户,一般不提供密码登录系统,UID在1-499之间</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">3、与用户相关的文件</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(1)/etc/passwd</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">其格式为account:password:UID:GID:GECOS:diretory:shell</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">a)account表示用户名或账号</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">b)password表示用户密码占位符</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">c)UID表示用户ID号</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">d)GID表示用户所在组的ID号</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">e)diretory表示用户所在的家目录</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">f)shell表示用户所在的编程环境</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">我自己家里面装了一个ubuntu12,该文件的内容为:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\"><img src=\"http://images2015.cnblogs.com/blog/801753/201511/801753-20151101181126997-753885014.png\" alt=\"\"/></span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(2)/etc/shadow</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">其格式为account:password:<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">最近更改密码的日期:密码不可更改的天数:密码需要重新更改的天数:密码更改前的告警期限:密码过期的宽限时间:账号失效日期:保留</strong></span></span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">4、用户组分类</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(1)普通用户组:可以加入多个用户</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(2)系统组:一般加入一些系统用户</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(3)私有组:当创建用户时,如果没有为其指明所属组,则为其定义一个私有的用户组,其名称与用户名同名。如果把其他用户加入了该私有组中,那么私有组就变成了普通组</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">同组用户有一样的权限</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">5、与用户组相关的文件</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">/etc/group,其格式为group_name:password:GID:user_list</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(1)group_name表示组名</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(2)password表示组密码</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(3)GID表示组ID号</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(4)user_list表示已group_name为附加组的用户列表</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"> </p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">su和sudo的区别</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、su</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">su就是切换用户的工具。比如以用户A登录,但要添加用户任务,执行useradd,A用户并没有这个权限,而这个权限恰恰root拥有。解决办法无非两个,一个是退出A,以root登录;另一个是通过su切换到root,等任务完成后再退出root。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">注意,"su"和"su -"同样是切换到root用户,二者之间还是有区别的。前者只是切换了root身份,但是Shell环境仍然是普通用户的Shell;后者连用户和Shell环境一起切换成了root身份。只有切换了Shell环境才不会出现PATH环境变量错误,可以通过pwd命令验证。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">su确实给管理带来了方便,通过切换到root下,就能完成所有系统管理,只要把root密码交给任何一个普通用户,他都能切换到root来完成所有的系统管理工作。但通过su切换到root也有不安全的因素,多用户操作时,只要有任何一个人操作失误,都可能造成系统崩溃或数据损失。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、sudo</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">通过sudo,我们能把某些超级权限有针对性地下方,并且不需要普通用户知道root密码,所以sudo相对于权限无限制的su来说,还是比较安全的,所以sudo也称为受限制的su。另外sudo是需要授权许可的,所以它也被称为授权许可的su。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">sudo执行命令的流程是当前用户切换到root(或其它执行切换到的用户),然后以root(或其他执行切换到的用户)身份执行命令,执行完成后,直接退回到当前用户。而这些的前提是要通过sudo配置文件/etc/sudoers来进行授权。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"> </p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">文件权限</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">我截取自己ubuntu下某路径下的文件列表:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\"><img src=\"http://images2015.cnblogs.com/blog/801753/201511/801753-20151101182533747-113587974.png\" alt=\"\"/></span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">详细解释一下:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">1、第一列表示文件/文件夹的种类和权限</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(1)第一个字符表示文件种类,"d"表示目录,"-"表示普通文件</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(2)第二至第四个字符表示文件/文件夹所有者的权限,r表示读权限、w表示写权限、x表示执行权限</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(3)第五至第七个字符表示文件/文件夹所属群组的权限,r表示读权限、w表示写权限、x表示执行权限</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">(4)第八至第十个字符表示文件/文件夹其他用户的权限,r表示读权限、w表示写权限、x表示执行权限</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">2、第二列表示文件/文件夹的连接数</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">3、第三列表示文件/文件夹的拥有者</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">4、第四列表示文件/文件夹所属的组</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">5、第五列表示文件/文件夹大小</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">6、第六列表示文件/文件夹最后修改时间</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">7、第七列表示文件/文件夹名称</span></p>');
INSERT INTO `title` VALUES ('14', '连接查询', '2016-12-27', '10', '内连接inner join\r\n\r\n内连接(inner join)使用比较运算符进行表间某(些)列数据的比较操作,并列出这些表中与连接条件相匹配的数据行,组合成新的记录。换句话说,在内连接查询中,只有满足条件的记录才能出现在结果关系中。 ', '<p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">内连接inner join</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">内连接(inner join)使用比较运算符进行表间某(些)列数据的比较操作,并列出这些表中与连接条件相匹配的数据行,组合成新的记录。换句话说,<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">在内连接查询中,只有满足条件的记录才能出现在结果关系中</strong></span>。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">对base_worker和extra_worker使用内连接:</span></p><pre style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;\">select b.s_id, b.s_name, b.s_age, e.s_nation, e.s_phone from base_worker b, extra_worker e where b.s_id = e.s_id;</pre><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">看一下查询结果:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\"><img src=\"http://images2015.cnblogs.com/blog/801753/201605/801753-20160530230954086-1192157378.png\" alt=\"\"/></span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">看到base_worker和extra_worker中分别有三条记录,但是最终查询出来只有两条记录,因为只有这两条记录可以通过s_id相匹配上。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">另外一个细节点是,<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">s_id这种在两张表中都存在的字段,必须指明读取的是哪张表中的s_id,否则SQL将报错,但是s_name这种只在base_worker表中存在的字段则没有这个限制</strong></span>。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">最后,上面的SQL是内连接最常用的SQL写法,内连接还有另外一种SQL写法,结果也是一样的:</span></p><pre style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;\"> b.s_id, b.s_name, b.s_age, e.s_nation, e.s_phone extra_worker e b.s_id</pre><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">可以自己验证一下,执行效率上也没有什么差别。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><strong style=\"margin: 0px; padding: 0px;\"><span style=\"margin: 0px; padding: 0px; font-size: 15px;\">左外连接left join</span></strong></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">连接查询将查询多个表中相关联的行,内连接时返回查询结果集合中的仅仅是符合查询条件和连接条件的行。但有时候需要包含没有关联的行中的数据,即<span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">返回查询结果集合中的不仅仅包含符合的连接条件的行,而且还包含左表或右表中的所有数据行</strong></span>。外连接分为左外连接和右外连接,这里先看一下左外连接。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\"><span style=\"margin: 0px; padding: 0px; color: rgb(255, 0, 0);\"><strong style=\"margin: 0px; padding: 0px;\">左外连接,返回的是左表中的所有记录以及由表中连接字段相等的记录</strong></span>。</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">看一下SQL:</span></p><pre style=\"margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;\">select b.s_id, b.s_name, b.s_age, e.s_nation, e.s_phone frombase_worker b left outer join extra_worker e on b.s_id = e.s_id;</pre><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">看一下查询结果:</span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\"><img src=\"http://images2015.cnblogs.com/blog/801753/201605/801753-20160530232029242-2001047454.png\" alt=\"\"/></span></p><p style=\"margin: 10px auto; padding: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; white-space: normal; background-color: rgb(255, 255, 255);\"><span style=\"margin: 0px; padding: 0px; font-size: 13px;\">显示了三条纪录,s_id为3的记录在extra_worker表中并没有s_nation与s_phone,所以这两个值为null,但因为base_worker为左表,因此base_worker中的所有数据都会被查出来。</span></p>');