??xml version="1.0" encoding="utf-8" standalone="yes"?>国产自产自拍视频在线观看,久久亚洲影视婷婷,麻豆影院在线观看http://www.aygfsteel.com/jlin/zh-cnSat, 17 May 2025 15:56:25 GMTSat, 17 May 2025 15:56:25 GMT60excel中如何将旉戌{换ؓ日期格式http://www.aygfsteel.com/jlin/archive/2019/03/08/433666.htmlflyflyFri, 08 Mar 2019 05:58:00 GMThttp://www.aygfsteel.com/jlin/archive/2019/03/08/433666.htmlhttp://www.aygfsteel.com/jlin/comments/433666.htmlhttp://www.aygfsteel.com/jlin/archive/2019/03/08/433666.html#Feedback0http://www.aygfsteel.com/jlin/comments/commentRss/433666.htmlhttp://www.aygfsteel.com/jlin/services/trackbacks/433666.html从linuxpȝ中获取的旉戳信息通常为msQ将其{换的公式为:

=TEXT((C4/1000+8*3600)/86400+70*365+19,"yyyy-mm-dd hh:mm:ss")

其中C4单元格所存的数据为ms因此需要除?000

转换后的l果如下Q?/p>



fly 2019-03-08 13:58 发表评论
]]>
java.lang.ClassCastException 两个一LcM能强?/title><link>http://www.aygfsteel.com/jlin/archive/2019/01/30/433626.html</link><dc:creator>fly</dc:creator><author>fly</author><pubDate>Wed, 30 Jan 2019 03:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/jlin/archive/2019/01/30/433626.html</guid><wfw:comment>http://www.aygfsteel.com/jlin/comments/433626.html</wfw:comment><comments>http://www.aygfsteel.com/jlin/archive/2019/01/30/433626.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jlin/comments/commentRss/433626.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jlin/services/trackbacks/433626.html</trackback:ping><description><![CDATA[<div>pȝ报错Q?java.lang.ClassCastException: com.entity.Job cannot be cast to com.entity.Job<br /><br />spring boot 目引入?spring的devtools l常会生这个问?nbsp; Q当把这个引入取消就不会出现?/div><div></div><div> <span style="white-space:pre"> </span><dependency></div><div>            <groupId>org.springframework.boot</groupId></div><div>            <artifactId>spring-boot-devtools</artifactId></div><div>        </dependency> </div><div></div><div></div><img src ="http://www.aygfsteel.com/jlin/aggbug/433626.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jlin/" target="_blank">fly</a> 2019-01-30 11:30 <a href="http://www.aygfsteel.com/jlin/archive/2019/01/30/433626.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>记录一ơkafka-manager1.3.3.18 Consumers is not display with kafka2.1.0 versionhttp://www.aygfsteel.com/jlin/archive/2018/12/13/433545.htmlflyflyThu, 13 Dec 2018 07:36:00 GMThttp://www.aygfsteel.com/jlin/archive/2018/12/13/433545.htmlhttp://www.aygfsteel.com/jlin/comments/433545.htmlhttp://www.aygfsteel.com/jlin/archive/2018/12/13/433545.html#Feedback0http://www.aygfsteel.com/jlin/comments/commentRss/433545.htmlhttp://www.aygfsteel.com/jlin/services/trackbacks/433545.html阅读全文

fly 2018-12-13 15:36 发表评论
]]>
centos7:安装node和npmhttp://www.aygfsteel.com/jlin/archive/2018/12/12/433544.htmlflyflyWed, 12 Dec 2018 02:29:00 GMThttp://www.aygfsteel.com/jlin/archive/2018/12/12/433544.htmlhttp://www.aygfsteel.com/jlin/comments/433544.htmlhttp://www.aygfsteel.com/jlin/archive/2018/12/12/433544.html#Feedback0http://www.aygfsteel.com/jlin/comments/commentRss/433544.htmlhttp://www.aygfsteel.com/jlin/services/trackbacks/433544.html通过安装包安装,可以使用

先下载安装包?/usr/local路径?br />
wget https://npm.taobao.org/mirrors/node/v8.0.0/node-v8.0.0-linux-x64.tar.xz

下蝲完成后解?br />tar -xvf  node-v8.0.0-linux-x64.tar.xz
重命名ؓnode
mv node-v8.1.4-linux-x64 node

配置环境变量
vim /etc/profile
在文件的最后添?br />#set for nodejs  
export NODE_HOME=/usr/local/node  
export PATH=$NODE_HOME/bin:$PATH
保存退出后执行更新命o
source /etc/profile
如果不生效,重启pȝ可?br />node和npm是否安装成功
node -v
npm -v

fly 2018-12-12 10:29 发表评论
]]>
在java中写出完的单例模式Q{Q?/title><link>http://www.aygfsteel.com/jlin/archive/2018/11/27/433525.html</link><dc:creator>fly</dc:creator><author>fly</author><pubDate>Tue, 27 Nov 2018 14:51:00 GMT</pubDate><guid>http://www.aygfsteel.com/jlin/archive/2018/11/27/433525.html</guid><wfw:comment>http://www.aygfsteel.com/jlin/comments/433525.html</wfw:comment><comments>http://www.aygfsteel.com/jlin/archive/2018/11/27/433525.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jlin/comments/commentRss/433525.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jlin/services/trackbacks/433525.html</trackback:ping><description><![CDATA[<div class="wmqeeuq" id="cnblogs_post_body" style="margin-bottom: 20px; word-break: break-word;"><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">1. 前言</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">单例(Singleton)应该是开发者们最熟悉的设计模式了Qƈ且好像也是最Ҏ实现?#8212;—基本上每个开发者都能够随手写出——但是Q真的是q样吗?</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">作ؓ一个Java开发者,也许你觉得自己对单例模式的了解已l够多了。我q不惛_a耸听说一定还有你不知道的——毕竟我自q了解也的有限,但究竟你自己了解的程度到底怎样呢?往下看Q我们一h聊聊看~</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">2. 什么是单例Q?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">单例对象的类必须保证只有一个实例存?#8212;—q是l基癄上对单例的定义,q也可以作ؓҎ囑֮现单例模式的代码q行验的标准?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">对单例的实现可以分ؓ两大c?#8212;—懒汉式和饿汉式,他们的区别在于:</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><ul style="list-style: none; margin: 0px 0px 10px 30px; padding-left: 0px; font-size: 12px;"><li style="list-style-type: disc;"><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">懒汉式:指全局的单例实例在W一ơ被使用时构建?/p></li><li style="list-style-type: disc;"><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">饿汉式:指全局的单例实例在c装载时构徏?/p></li></ul><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">从它们的区别也能看出来,日常我们使用的较多的应该是懒汉式的单例,毕竟按需加蝲才能做到资源的最大化利用嘛~</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">3. 懒汉式单?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">先来看一下懒汉式单例的实现方式?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">3.1 单版?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">看最单的写法Version 1Q?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;"><span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> Version 1</span> <span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">class</span><span style="line-height: 1.5 !important;"> Single1 { </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span><span style="line-height: 1.5 !important;"> Single1 instance; </span><span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span><span style="line-height: 1.5 !important;"> Single1 getInstance() { </span><span style="color: #0000ff; line-height: 1.5 !important;">if</span> (instance == <span style="color: #0000ff; line-height: 1.5 !important;">null</span><span style="line-height: 1.5 !important;">) { instance </span>= <span style="color: #0000ff; line-height: 1.5 !important;">new</span><span style="line-height: 1.5 !important;"> Single1(); } </span><span style="color: #0000ff; line-height: 1.5 !important;">return</span><span style="line-height: 1.5 !important;"> instance; } }</span></pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div></div><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">或者再q一步,把构造器改ؓU有的,q样能够防止被外部的c调用?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;"><span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> Version 1.1</span> <span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">class</span><span style="line-height: 1.5 !important;"> Single1 { </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span><span style="line-height: 1.5 !important;"> Single1 instance; </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span><span style="line-height: 1.5 !important;"> Single1() {} </span><span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span><span style="line-height: 1.5 !important;"> Single1 getInstance() { </span><span style="color: #0000ff; line-height: 1.5 !important;">if</span> (instance == <span style="color: #0000ff; line-height: 1.5 !important;">null</span><span style="line-height: 1.5 !important;">) { instance </span>= <span style="color: #0000ff; line-height: 1.5 !important;">new</span><span style="line-height: 1.5 !important;"> Single1(); } </span><span style="color: #0000ff; line-height: 1.5 !important;">return</span><span style="line-height: 1.5 !important;"> instance; } }</span></pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div></div><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">我仿佛记得当初学校的教科书就是这么教的?—— 每次获取instance之前先进行判断,如果instance为空new一个出来,否则q接返回已存在的instance?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">q种写法在大多数的时候也是没问题的。问题在于,当多U程工作的时候,如果有多个线E同时运行到if (instance == null)Q都判断为nullQ那么两个线E就各自会创Z个实?#8212;—q样一来,׃是单例了?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">3.2 synchronized版本</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">那既然可能会因ؓ多线E导致问题,那么加上一个同步锁吧!</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">修改后的代码如下Q相对于Version1.1Q只是在Ҏ{֐上多加了一个synchronizedQ?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;"><span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> Version 2 </span> <span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">class</span><span style="line-height: 1.5 !important;"> Single2 { </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span><span style="line-height: 1.5 !important;"> Single2 instance; </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span><span style="line-height: 1.5 !important;"> Single2() {} </span><span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span> <span style="color: #0000ff; line-height: 1.5 !important;">synchronized</span><span style="line-height: 1.5 !important;"> Single2 getInstance() { </span><span style="color: #0000ff; line-height: 1.5 !important;">if</span> (instance == <span style="color: #0000ff; line-height: 1.5 !important;">null</span><span style="line-height: 1.5 !important;">) { instance </span>= <span style="color: #0000ff; line-height: 1.5 !important;">new</span><span style="line-height: 1.5 !important;"> Single2(); } </span><span style="color: #0000ff; line-height: 1.5 !important;">return</span><span style="line-height: 1.5 !important;"> instance; } }</span></pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div></div><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">OKQ加上synchronized关键字之后,getInstanceҎ׃锁上了。如果有两个U程QT1、T2Q同时执行到q个ҎӞ会有其中一个线ET1获得同步锁,得以l箋执行Q而另一个线ET2则需要等待,当第T1执行完毕getInstance之后Q完成了null判断、对象创建、获得返回g后)QT2U程才会执行执行?#8212;—所以这端代码也避免了Version1中,可能出现因ؓ多线E导致多个实例的情况?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">但是Q这U写法也有一个问题:lgitInstanceҎ加锁Q虽然会避免了可能会出现的多个实例问题,但是会强刉T1之外的所有线E等待,实际上会对程序的执行效率造成负面影响?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">3.3 双重查(Double-CheckQ版?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">Version2代码相对于Version1d代码的效率问题,其实是ؓ了解?%几率的问题,而用了一?00%出现的防护盾。那有一个优化的思\Q就是把100%出现的防护盾Q也改ؓ1%的几率出玎ͼ使之只出现在可能会导致多个实例出现的地方?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">——有没有这LҎ呢?当然是有的,改进后的代码Vsersion3如下Q?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;"><span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> Version 3 </span> <span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">class</span><span style="line-height: 1.5 !important;"> Single3 { </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span><span style="line-height: 1.5 !important;"> Single3 instance; </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span><span style="line-height: 1.5 !important;"> Single3() {} </span><span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span><span style="line-height: 1.5 !important;"> Single3 getInstance() { </span><span style="color: #0000ff; line-height: 1.5 !important;">if</span> (instance == <span style="color: #0000ff; line-height: 1.5 !important;">null</span><span style="line-height: 1.5 !important;">) { </span><span style="color: #0000ff; line-height: 1.5 !important;">synchronized</span> (Single3.<span style="color: #0000ff; line-height: 1.5 !important;">class</span><span style="line-height: 1.5 !important;">) { </span><span style="color: #0000ff; line-height: 1.5 !important;">if</span> (instance == <span style="color: #0000ff; line-height: 1.5 !important;">null</span><span style="line-height: 1.5 !important;">) { instance </span>= <span style="color: #0000ff; line-height: 1.5 !important;">new</span><span style="line-height: 1.5 !important;"> Single3(); } } } </span><span style="color: #0000ff; line-height: 1.5 !important;">return</span><span style="line-height: 1.5 !important;"> instance; } }</span></pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div></div><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">q个版本的代码看h有点复杂Q注意其中有两次if (instance == null)的判断,q个叫做『双重检?Double-Check』?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><ul style="list-style: none; margin: 0px 0px 10px 30px; padding-left: 0px; font-size: 12px;"><li style="list-style-type: disc;"><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">W一个if (instance == null)Q其实是Z解决Version2中的效率问题Q只有instance为null的时候,才进入synchronized的代码段——大大减少了几率?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p></li><li style="list-style-type: disc;"><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">W二个if (instance == null)Q则是跟Version2一P是ؓ了防止可能出现多个实例的情况?/p></li></ul><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">—— q段代码看v来已l完无瑕了?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">……</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">……</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">……</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">—— 当然Q只是『看h』,q是有小概率出现问题的?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">q弄清楚Z么这里可能出现问题,首先Q我们需要弄清楚几个概念Q原子操作、指令重排?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">知识点:什么是原子操作Q?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">单来_原子操作QatomicQ就是不可分割的操作Q在计算ZQ就是指不会因ؓU程调度被打断的操作?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">比如Q简单的赋值是一个原子操作:</p><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;">m = 6; <span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> q是个原子操?/span></pre></div><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">假如m原先的gؓ0Q那么对于这个操作,要么执行成功m变成?Q要么是没执行mq是0Q而不会出现诸如m=3q种中间?#8212;—即是在q发的线E中?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">而,声明q赋值就不是一个原子操作:</p><div style="margin: 5px 0px; font-size: 12px !important;"><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;"><span style="color: #0000ff; line-height: 1.5 !important;">int</span> n = 6; <span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> q不是一个原子操?/span></pre></div><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">对于q个语句Q至有两个操作Q?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">①声明一个变量n</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">②ln赋gؓ6</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">——q样׃有一个中间状态:变量n已经被声明了但是q没有被赋值的状态?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">——q样Q在多线E中Q由于线E执行顺序的不确定性,如果两个U程都用mQ就可能会导致不E_的结果出现?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">知识点:什么是指o重排Q?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">单来_是计算Zؓ了提高执行效率,会做的一些优化,在不影响最l结果的情况下,可能会对一些语句的执行序q行调整?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">比如Q这一D代码:</p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;"><span style="color: #0000ff; line-height: 1.5 !important;">int</span> a ; <span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> 语句1 </span> <span style="line-height: 1.5 !important;"> a </span>= 8 ; <span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> 语句2</span> <span style="color: #0000ff; line-height: 1.5 !important;">int</span> b = 9 ; <span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> 语句3</span> <span style="color: #0000ff; line-height: 1.5 !important;">int</span> c = a + b ; <span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> 语句4</span></pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div></div><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">正常来说Q对于顺序结构,执行的顺序是自上CQ也?234?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">但是Q由于指令重排的原因Q因Z影响最l的l果Q所以,实际执行的顺序可能会变成3124或?324?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">׃语句3?没有原子性的问题Q语?和语?也可能会拆分成原子操作,再重排?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">——也就是说Q对于非原子性的操作Q在不媄响最l结果的情况下,其拆分成的原子操作可能会被重新排列执行顺序?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">OKQ了解了原子操作和指令重排的概念之后Q我们再l箋看Version3代码的问题?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">下面q段话直接从陈皓的文?深入出单实例SINGLETON设计模式)中复制而来Q?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">主要在于singleton = new Singleton()q句Q这q是一个原子操作,事实上在 JVM 中这句话大概做了下面 3 件事情?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">1. l?singleton 分配内存</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">2. 调用 Singleton 的构造函数来初始化成员变量,形成实例</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">3. singleton对象指向分配的内存空_执行完这?singleton才是?null 了)</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">但是?JVM 的即时编译器中存在指令重排序的优化。也是说上面的W二步和W三步的序是不能保证的Q最l的执行序可能?1-2-3 也可能是 1-3-2。如果是后者,则在 3 执行完毕? 未执行之前,被线E二抢占了,q时 instance 已经是非 null 了(但却没有初始化)Q所以线E二会直接返?instanceQ然后用,然后理成章地报错?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">再稍微解释一下,是_׃有一个『instance已经不ؓnull但是仍没有完成初始化』的中间状态,而这个时候,如果有其他线E刚好运行到W一层if (instance == null)q里Q这里读取到的instance已经不ؓnull了,所以就直接把这个中间状态的instance拿去用了Q就会生问题?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">q里的关键在?#8212;—U程T1对instance的写操作没有完成Q线ET2执行了L作?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">3.4 l极版本Qvolatile</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">对于Version3中可能出现的问题Q当然这U概率已l非常小了,但毕竟还是有的嘛~Q,解决Ҏ是:只需要给instance的声明加上volatile关键字即可,Version4版本Q?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;"><span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> Version 4 </span> <span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">class</span><span style="line-height: 1.5 !important;"> Single4 { </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span> <span style="color: #0000ff; line-height: 1.5 !important;">volatile</span><span style="line-height: 1.5 !important;"> Single4 instance; </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span><span style="line-height: 1.5 !important;"> Single4() {} </span><span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span><span style="line-height: 1.5 !important;"> Single4 getInstance() { </span><span style="color: #0000ff; line-height: 1.5 !important;">if</span> (instance == <span style="color: #0000ff; line-height: 1.5 !important;">null</span><span style="line-height: 1.5 !important;">) { </span><span style="color: #0000ff; line-height: 1.5 !important;">synchronized</span> (Single4.<span style="color: #0000ff; line-height: 1.5 !important;">class</span><span style="line-height: 1.5 !important;">) { </span><span style="color: #0000ff; line-height: 1.5 !important;">if</span> (instance == <span style="color: #0000ff; line-height: 1.5 !important;">null</span><span style="line-height: 1.5 !important;">) { instance </span>= <span style="color: #0000ff; line-height: 1.5 !important;">new</span><span style="line-height: 1.5 !important;"> Single4(); } } } </span><span style="color: #0000ff; line-height: 1.5 !important;">return</span><span style="line-height: 1.5 !important;"> instance; } }</span></pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div></div><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">volatile关键字的一个作用是止指o重排Q把instance声明为volatile之后Q对它的写操作就会有一个内存屏障(什么是内存屏障Q)Q这P在它的赋值完成之前,׃用会调用L作?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">注意QvolatileL的不singleton = new Singleton()q句话内部[1-2-3]的指令重排,而是保证了在一个写操作Q[1-2-3]Q完成之前,不会调用L作(if (instance == null)Q?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">——也就d防止了Version3中的问题发生?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">——好了Q现在彻底没什么问题了吧?</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">……</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">……</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">……</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">好了Q别紧张Q的没问题了。大名鼎鼎的EventBus中,其入口方法EventBus.getDefault()是用这U方法来实现的?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">……</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">……</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">……</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">不过Q非要挑点刺的话q是能挑出来的,是q个写法有些复杂了,不够优雅、简z?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">4. 饿汉式单?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">下面再聊了解一下饿汉式的单例?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">如上所_饿汉式单例是指:指全局的单例实例在c装载时构徏的实现方式?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">׃c装载的q程是由cd载器QClassLoaderQ来执行的,q个q程也是由JVM来保证同步的Q所以这U方式先天就有一个优?#8212;—能够免疫许多由多U程引v的问题?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">4.1 饿汉式单例的实现方式</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">饿汉式单例的实现如下Q?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;"><span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;">饿汉式实?/span> <span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">class</span><span style="line-height: 1.5 !important;"> SingleB { </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span> <span style="color: #0000ff; line-height: 1.5 !important;">final</span> SingleB INSTANCE = <span style="color: #0000ff; line-height: 1.5 !important;">new</span><span style="line-height: 1.5 !important;"> SingleB(); </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span><span style="line-height: 1.5 !important;"> SingleB() {} </span><span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span><span style="line-height: 1.5 !important;"> SingleB getInstance() { </span><span style="color: #0000ff; line-height: 1.5 !important;">return</span><span style="line-height: 1.5 !important;"> INSTANCE; } }</span></pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div></div><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">对于一个饿汉式单例的写法来_它基本上是完的了?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">所以它的缺点也只是饿汉式单例本n的缺Ҏ在了——׃INSTANCE的初始化是在cd载时q行的,而类的加载是由ClassLoader来做的,所以开发者本来对于它初始化的时机很隑֎准确把握Q?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><ol style="padding-left: 40px;"><li style="list-style-type: decimal;"><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">可能׃初始化的太早Q造成资源的浪?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p></li><li style="list-style-type: decimal;"><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">如果初始化本w依赖于一些其他数据,那么也就很难保证其他数据会在它初始化之前准备好?/p></li></ol><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">当然Q如果所需的单例占用的资源很少Qƈ且也不依赖于其他数据Q那么这U实现方式也是很好的?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">知识点:什么时候是c装载时Q?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">前面提到了单例在c装载时被实例化Q那I竟什么时候才是『类装蝲时』呢Q?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">不严格的_大致有这么几个条件会触发一个类被加载:</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">1. new一个对象时</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">2. 使用反射创徏它的实例?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">3. 子类被加载时Q如果父c还没被加蝲Q就先加载父c?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">4. jvm启动时执行的ȝ会首先被加蝲</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">5. 一些其他的实现方式</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">5.1 Effective Java 1 —— 静态内部类</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">《Effective Java》一书的W一版中推荐了一个中写法Q?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;"><span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> Effective Java W一版推荐写?/span> <span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">class</span><span style="line-height: 1.5 !important;"> Singleton { </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span> <span style="color: #0000ff; line-height: 1.5 !important;">class</span><span style="line-height: 1.5 !important;"> SingletonHolder { </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span> <span style="color: #0000ff; line-height: 1.5 !important;">final</span> Singleton INSTANCE = <span style="color: #0000ff; line-height: 1.5 !important;">new</span><span style="line-height: 1.5 !important;"> Singleton(); } </span><span style="color: #0000ff; line-height: 1.5 !important;">private</span><span style="line-height: 1.5 !important;"> Singleton (){} </span><span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">static</span> <span style="color: #0000ff; line-height: 1.5 !important;">final</span><span style="line-height: 1.5 !important;"> Singleton getInstance() { </span><span style="color: #0000ff; line-height: 1.5 !important;">return</span><span style="line-height: 1.5 !important;"> SingletonHolder.INSTANCE; } }</span></pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div></div><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">q种写法非常巧妙Q?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><ul style="list-style: none; margin: 0px 0px 10px 30px; padding-left: 0px; font-size: 12px;"><li style="list-style-type: disc;"><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">对于内部cSingletonHolderQ它是一个饿汉式的单例实玎ͼ在SingletonHolder初始化的时候会由ClassLoader来保证同步,使INSTANCE是一个真·单例?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p></li><li style="list-style-type: disc;"><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">同时Q由于SingletonHolder是一个内部类Q只在外部类的Singleton的getInstance()中被使用Q所以它被加载的时机也就是在getInstance()ҎW一ơ被调用的时候?/p></li></ul><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">——它利用了ClassLoader来保证了同步Q同时又能让开发者控制类加蝲的时机。从内部看是一个饿汉式的单例,但是从外部看来,又的是懒汉式的实现?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">直是乎其技?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">5.2 Effective Java 2 —— 枚D</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">你以为到q就完了?不,q没有,因ؓ厉害的大又发现了其他的Ҏ?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">《Effective Java》的作者在q本书的W二版又推荐了另外一U方法,来直接看代码Q?/p><div style="margin: 5px 0px; font-size: 12px !important;"><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div><pre style="margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: "Courier New" !important;"><span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> Effective Java W二版推荐写?/span> <span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">enum</span><span style="line-height: 1.5 !important;"> SingleInstance { INSTANCE; </span><span style="color: #0000ff; line-height: 1.5 !important;">public</span> <span style="color: #0000ff; line-height: 1.5 !important;">void</span><span style="line-height: 1.5 !important;"> fun1() { </span><span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> do something</span> <span style="line-height: 1.5 !important;"> } } </span><span style="color: #008000; line-height: 1.5 !important;">//</span><span style="color: #008000; line-height: 1.5 !important;"> 使用</span> <span style="line-height: 1.5 !important;"> SingleInstance.INSTANCE.fun1();</span></pre><div style="margin-top: 5px;"><span style="padding-right: 5px; line-height: 1.5 !important;"><a title="复制代码" style="color: #1a8bc8; border: none !important;"><img src="https://common.cnblogs.com/images/copycode.gif" alt="复制代码" style="max-width: 900px; height: auto; border: none !important;" /></a></span></div></div><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">看到了么Q这是一个枚丄?#8230;…qclass都不用了Q极?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">׃创徏枚D实例的过E是U程安全的,所以这U写法也没有同步的问题?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">作者对q个Ҏ的评P</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">q种写法在功能上与共有域Ҏ相近Q但是它更简z,无偿地提供了序列化机Ӟl对防止Ҏ实例化,即是在面对复杂的序列化或者反攻ȝ时候。虽然这中方法还没有q泛采用Q但是单元素的枚丄型已l成为实现Singleton的最x法?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">枚D单例q种Ҏ问世一些,许多分析文章都称它是实现单例的最完美Ҏ——写法񔽎单,而且又能解决大部分的问题?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">不过我个U方法虽然很优秀Q但是它仍然不是完美?#8212;—比如Q在需要承的场景Q它׃适用了?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">6. ȝ</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">OKQ看到这里,你还会觉得单例模式是最单的设计模式了么Q再回头看一下你之前代码中的单例实现Q觉得是无懈可击的么Q?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">可能我们在实际的开发中Q对单例的实现ƈ没有那么严格的要求。比如,我如果能保证所有的getInstance都是在一个线E的话,那其实第一U最单的教科书方式就够用了。再比如Q有时候,我的单例变成了多例也可能对程序没什么太大媄?#8230;…</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">但是Q如果我们能了解更多其中的细节,那么如果哪天E序Z些问题,我们L能多一个排查问题的炏V早点解决问题,p早点回家吃饭……</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">—— q有Q完的Ҏ是不存在QQ何方式都会有一个『度』的问题。比如,你的觉得代码已经无懈可击了,但是因ؓ你用的是JAVA语言Q可能ClassLoader有些BUG?#8230;…你的代码谁运行在JVM上的Q可能JVM本n有BUG?#8230;…你的代码q行在手ZQ可能手机系l有问题?#8230;…你生zdq个宇宙里,可能宇宙本n有些BUG?#8230;…</p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">所以,力做到能做到的最好就行了?/p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;"> </p><p style="line-height: 1.5; margin-top: 10px; margin-bottom: 10px;">—— 感谢你花费了不少旉看到q里Q但愿你没有觉得虚度?/p></div><div style="clear: both;"></div><div class="wmqeeuq" id="blog_post_info_block" style="margin-top: 20px;"><div class="wmqeeuq" id="BlogPostCategory" style="margin-bottom: 10px; color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #ffffff;"></div><div class="wmqeeuq" id="EntryTag" style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #ffffff; margin-top: 0px !important;"></div><div class="wmqeeuq" id="blog_post_info" style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; background-color: #ffffff;"></div></div><img src ="http://www.aygfsteel.com/jlin/aggbug/433525.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jlin/" target="_blank">fly</a> 2018-11-27 22:51 <a href="http://www.aygfsteel.com/jlin/archive/2018/11/27/433525.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>@RequestParam与@PathVariable的区别(转)http://www.aygfsteel.com/jlin/archive/2018/08/22/433344.htmlflyflyWed, 22 Aug 2018 03:05:00 GMThttp://www.aygfsteel.com/jlin/archive/2018/08/22/433344.htmlhttp://www.aygfsteel.com/jlin/comments/433344.htmlhttp://www.aygfsteel.com/jlin/archive/2018/08/22/433344.html#Feedback0http://www.aygfsteel.com/jlin/comments/commentRss/433344.htmlhttp://www.aygfsteel.com/jlin/services/trackbacks/433344.html?a title="Java EE知识? target="_blank" style="margin: 0px; padding: 0px; color: #000000;">spring MVC中,两者的作用都是request里的参数的值绑定到contorl里的Ҏ参数里的Q区别在于,URL写法不同?/p>

使用@RequestParamӞURL是这LQhttp://host:port/path?参数?参数?br style="margin: 0px; padding: 0px;" />

使用@PathVariableӞURL是这LQhttp://host:port/path/参数?br style="margin: 0px; padding: 0px;" />

例如Q?/p>

 

[java] view plain copy
 
  1. @RequestMapping(value="/user",method = RequestMethod.GET)  
  2.    public @ResponseBody  
  3.    User printUser(@RequestParam(value = "id", required = false, defaultValue = "0")  
  4.    int id) {  
  5.     User user = new User();  
  6.        user = userService.getUserById(id);  
  7.        return user;  
  8.    }  
  9.      
  10.    @RequestMapping(value="/user/{id}",method = RequestMethod.GET)  
  11.    public @ResponseBody  
  12.    User printUser2(@PathVariable int id) {  
  13.        User user = new User();  
  14.        user = userService.getUserById(id);  
  15.        return user;  
  16.    }  


 

 

上面两个ҎQ访问\径分别如下:

 




fly 2018-08-22 11:05 发表评论
]]>
SVN命o学习http://www.aygfsteel.com/jlin/archive/2018/05/25/433235.htmlflyflyFri, 25 May 2018 05:46:00 GMThttp://www.aygfsteel.com/jlin/archive/2018/05/25/433235.htmlhttp://www.aygfsteel.com/jlin/comments/433235.htmlhttp://www.aygfsteel.com/jlin/archive/2018/05/25/433235.html#Feedback0http://www.aygfsteel.com/jlin/comments/commentRss/433235.htmlhttp://www.aygfsteel.com/jlin/services/trackbacks/433235.htmlsvn add 文g?目录
svn ci  文g?目录 -m “提交备注信息文本“
svn查本地文件是否有改动Qƈ昄文g名:
svn diff --diff-cmd "diff" -x "-q" . | grep Index | cut -d " " -f 2
查本地目录改动及提交SVN:
svn diff --diff-cmd "diff" -x "-q" . | grep Index | cut -d " " -f 2 | svn ci -m "test"
提交同一个目录下的多个文Ӟ svn ci -m "" 目录
提交多个文gQ用空格来间隔q多个文Ӟ svn ci  file1 file2 … filen -m “”
同一目录下的未加入版本库d: svn add * 
——————————————————————————————————————————————————————————————————
查看一个文件每一行最后更改的详情Q版本、作业)
svn blame filename
查看一个文件所有更改历史详?/div>
svn log --diff filename


fly 2018-05-25 13:46 发表评论
]]>使用java8的lambdalist转ؓmapQ{Q?/title><link>http://www.aygfsteel.com/jlin/archive/2018/03/31/433138.html</link><dc:creator>fly</dc:creator><author>fly</author><pubDate>Sat, 31 Mar 2018 12:22:00 GMT</pubDate><guid>http://www.aygfsteel.com/jlin/archive/2018/03/31/433138.html</guid><wfw:comment>http://www.aygfsteel.com/jlin/comments/433138.html</wfw:comment><comments>http://www.aygfsteel.com/jlin/archive/2018/03/31/433138.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jlin/comments/commentRss/433138.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jlin/services/trackbacks/433138.html</trackback:ping><description><![CDATA[<div style="margin: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; background-color: #fefef2;"><h3>常用方式</h3><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;">代码如下Q?/p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<Long, String> getIdNameMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getId, Account::getUsername)); } </code></pre><h3>攉成实体本wmap</h3><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;">代码如下Q?/p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<Long, Account> getIdAccountMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getId, account -> account)); } </code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;"><strong style="margin: 0px; padding: 0px;">account -> account</strong>是一个返回本w的lambda表达式,其实q可以用Function接口中的一个默认方法代替,使整个方法更z优雅:</p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<Long, Account> getIdAccountMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getId, Function.identity())); } </code></pre><h3>重复key的情?/h3><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;">代码如下Q?/p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<String, Account> getNameAccountMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getUsername, Function.identity())); } </code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;">q个Ҏ可能报错Q?strong style="margin: 0px; padding: 0px;">java.lang.IllegalStateException: Duplicate key</strong>Q,因ؓname是有可能重复的?strong style="margin: 0px; padding: 0px;">toMap</strong>有个重蝲ҎQ可以传入一个合q的函数来解决key冲突问题Q?/p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<String, Account> getNameAccountMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getUsername, Function.identity(), (key1, key2) -> key2)); } </code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;">q里只是单的使用后者覆盖前者来解决key重复问题?/p><h3>指定具体攉的map</h3><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;"><strong style="margin: 0px; padding: 0px;">toMap</strong>q有另一个重载方法,可以指定一个Map的具体实玎ͼ来收集数据:</p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<String, Account> getNameAccountMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getUsername, Function.identity(), (key1, key2) -> key2, LinkedHashMap::new)); } </code></pre></div><div style="margin: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; background-color: #fefef2;"> </div><div style="margin: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; background-color: #fefef2;"><div style="margin: 0px;">转自Qhttps://zacard.net/2016/03/17/java8-list-to-map/</div></div><img src ="http://www.aygfsteel.com/jlin/aggbug/433138.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jlin/" target="_blank">fly</a> 2018-03-31 20:22 <a href="http://www.aygfsteel.com/jlin/archive/2018/03/31/433138.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用java8的lambdalist转ؓmapQ{Q?/title><link>http://www.aygfsteel.com/jlin/archive/2018/03/31/433137.html</link><dc:creator>fly</dc:creator><author>fly</author><pubDate>Sat, 31 Mar 2018 12:21:00 GMT</pubDate><guid>http://www.aygfsteel.com/jlin/archive/2018/03/31/433137.html</guid><wfw:comment>http://www.aygfsteel.com/jlin/comments/433137.html</wfw:comment><comments>http://www.aygfsteel.com/jlin/archive/2018/03/31/433137.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jlin/comments/commentRss/433137.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jlin/services/trackbacks/433137.html</trackback:ping><description><![CDATA[<div style="margin: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; background-color: #fefef2;"><h3>常用方式</h3><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;">代码如下Q?/p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<Long, String> getIdNameMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getId, Account::getUsername)); } </code></pre><h3>攉成实体本wmap</h3><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;">代码如下Q?/p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<Long, Account> getIdAccountMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getId, account -> account)); } </code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;"><strong style="margin: 0px; padding: 0px;">account -> account</strong>是一个返回本w的lambda表达式,其实q可以用Function接口中的一个默认方法代替,使整个方法更z优雅:</p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<Long, Account> getIdAccountMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getId, Function.identity())); } </code></pre><h3>重复key的情?/h3><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;">代码如下Q?/p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<String, Account> getNameAccountMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getUsername, Function.identity())); } </code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;">q个Ҏ可能报错Q?strong style="margin: 0px; padding: 0px;">java.lang.IllegalStateException: Duplicate key</strong>Q,因ؓname是有可能重复的?strong style="margin: 0px; padding: 0px;">toMap</strong>有个重蝲ҎQ可以传入一个合q的函数来解决key冲突问题Q?/p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<String, Account> getNameAccountMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getUsername, Function.identity(), (key1, key2) -> key2)); } </code></pre><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;">q里只是单的使用后者覆盖前者来解决key重复问题?/p><h3>指定具体攉的map</h3><p style="margin-top: 10px; margin-bottom: 10px; padding: 0px; line-height: 1.5;"><strong style="margin: 0px; padding: 0px;">toMap</strong>q有另一个重载方法,可以指定一个Map的具体实玎ͼ来收集数据:</p><pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word;"><code style="margin: 0px; padding: 0px;">public Map<String, Account> getNameAccountMap(List<Account> accounts) { return accounts.stream().collect(Collectors.toMap(Account::getUsername, Function.identity(), (key1, key2) -> key2, LinkedHashMap::new)); } </code></pre></div><div style="margin: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; background-color: #fefef2;"> </div><div style="margin: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19.5px; background-color: #fefef2;"><div style="margin: 0px;">转自Qhttps://zacard.net/2016/03/17/java8-list-to-map/</div></div><img src ="http://www.aygfsteel.com/jlin/aggbug/433137.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jlin/" target="_blank">fly</a> 2018-03-31 20:21 <a href="http://www.aygfsteel.com/jlin/archive/2018/03/31/433137.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Spring3中js/css/jpg/gif{静态资源无法找刎ͼNo mapping found for HTTP request with URIQ问?/title><link>http://www.aygfsteel.com/jlin/archive/2018/01/30/433031.html</link><dc:creator>fly</dc:creator><author>fly</author><pubDate>Tue, 30 Jan 2018 08:16:00 GMT</pubDate><guid>http://www.aygfsteel.com/jlin/archive/2018/01/30/433031.html</guid><wfw:comment>http://www.aygfsteel.com/jlin/comments/433031.html</wfw:comment><comments>http://www.aygfsteel.com/jlin/archive/2018/01/30/433031.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/jlin/comments/commentRss/433031.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/jlin/services/trackbacks/433031.html</trackback:ping><description><![CDATA[<p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;">我们在用spring3的时候,如果使用了注解的话,我们会发玎ͼ有时候我们界面的js/css/jpg/gif{文件会出现找不到的情况Q然而检查引用\径,发现无论是绝对\径还是相对\径,都没错。这下我们就U结了,到底是什么问题呢Q?/span></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;">g我也是苦思良久,不经意间看到了后台的日志Q才发现是spring搞的鬹{?/span></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><br style="box-sizing: border-box;" /></span></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;">报错信息Q?span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #ff0000;"><No mapping found for HTTP request with URI [/sandDemo001/images/1.jpg] in DispatcherServlet with name 'spring'></span></span></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #ff0000;"><br style="box-sizing: border-box;" /></span></span></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #330033;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #ff0000; font-size: 18px;"><strong style="box-sizing: border-box;">解决Ҏ1</strong></span>Q?span style="box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;"><strong style="box-sizing: border-box;">在spring的配|修?/strong></span></span><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #330033;">web.xml<span style="box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;"><strong style="box-sizing: border-box;">下对</strong></span>spring<span style="box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;"><strong style="box-sizing: border-box;">?/strong></span>DispatcherServlet<span style="box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;"><strong style="box-sizing: border-box;">h</strong></span>url<span style="box-sizing: border-box; margin: 0px; padding: 0px; font-size: 14px;"><strong style="box-sizing: border-box;">映射的配|,先来看看原配|?/strong></span>Q?/span><br style="box-sizing: border-box;" /></span></span></span></p><div bg_html"="" style="box-sizing: border-box; position: relative; overflow-y: hidden; width: 851.391px; color: #454545;"><div style="box-sizing: border-box; margin: 0px;"><div style="box-sizing: border-box; margin: 0px; border-right: 1px solid #e7e5dc;"><strong style="box-sizing: border-box;">[html]</strong> <a title="view plain" style="box-sizing: border-box; background-image: url("../images/ico_plain.gif"); background-position: left top; background-repeat: no-repeat; padding: 1px; outline: 0px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px;">view plain</a><span data-mod="popu_168" style="box-sizing: border-box; margin: 0px; padding: 0px;"> <a title="copy" style="box-sizing: border-box; background-image: url("../images/ico_copy.gif"); background-position: left top; background-repeat: no-repeat; padding: 1px; outline: 0px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px;">copy</a><div style="box-sizing: border-box; margin: 0px; position: absolute; left: 259px; top: 453px; width: 16px; height: 16px; z-index: 99;"></div></span></div></div><ol start="1" style="box-sizing: border-box; border-right: 1px solid #e7e5dc;"><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">    <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">spring</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">    <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-class</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">org.springframework.web.servlet.DispatcherServlet</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-class</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">    <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">load-on-startup</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">1</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">load-on-startup</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">        <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">spring</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">        <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">/</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li></ol></div><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #330033;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><servlet-mapping></span><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;">?/span><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><url-pattern>/</url-pattern></span></span><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #330033;">把所有的h都交lspringd理了Q而所有available的请求url都是在Constroller里用类似@RequestMapping(value = "/login/{user}", method = RequestMethod.GET)q样的注解配|的Q这L话对js/css/jpg/gif{静态资源的讉K׃得不到。所以,?span style="box-sizing: border-box; margin: 0px; padding: 0px;">web.xml里添加如下的配置可以解册问题了?/span></span></span></span><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"></p><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial;"><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #330033;"></span></span></span></span></span></span></p><div bg_html"="" style="box-sizing: border-box; position: relative; overflow-y: hidden; width: 851.391px; color: #454545;"><div style="box-sizing: border-box; margin: 0px;"><div style="box-sizing: border-box; margin: 0px; border-right: 1px solid #e7e5dc;"><strong style="box-sizing: border-box;">[html]</strong> <a title="view plain" style="box-sizing: border-box; background-image: url("../images/ico_plain.gif"); background-position: left top; background-repeat: no-repeat; padding: 1px; outline: 0px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px;">view plain</a><span data-mod="popu_168" style="box-sizing: border-box; margin: 0px; padding: 0px;"> <a title="copy" style="box-sizing: border-box; background-image: url("../images/ico_copy.gif"); background-position: left top; background-repeat: no-repeat; padding: 1px; outline: 0px; display: inline-block; width: 16px; height: 16px; text-indent: -2000px;">copy</a><div style="box-sizing: border-box; margin: 0px; position: absolute; left: 259px; top: 754px; width: 16px; height: 16px; z-index: 99;"></div></span></div></div><ol start="1" style="box-sizing: border-box; border-right: 1px solid #e7e5dc;"><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">default</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">*.css</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">   </span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"><span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">    <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">default</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">    <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">*.gif</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">  </span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">      </span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">default</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">*.jpg</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">      </span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">default</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-name</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;">     <span style="box-sizing: border-box; font-weight: 700; color: #993300;"><</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">*.js</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">url-pattern</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li><li style="box-sizing: border-box; line-height: 18px;"><span style="box-sizing: border-box;"> <span style="box-sizing: border-box; font-weight: 700; color: #993300;"></</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">servlet-mapping</span><span style="box-sizing: border-box; font-weight: 700; color: #993300;">></span><span style="box-sizing: border-box;">  </span></span></li></ol></div><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"></p><p style="box-sizing: border-box; margin: 10px 0px; padding: 0px; color: #454545; background-color: #ffffff; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px;"><strong style="box-sizing: border-box;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-weight: 400; font-family: Arial; color: #ff0000; font-size: 18px;">解决Ҏ2Q?span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #000000; font-size: 14px;">在spring的配|文件中d如下一行:</span></span></strong></strong></p><p style="box-sizing: border-box; margin: 10px 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><strong style="box-sizing: border-box;"></strong><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #660000; font-size: 14px;"><strong style="box-sizing: border-box;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-weight: 400; color: #006699;"><mvc:default-servlet-handler/></span></strong></span></p><p style="box-sizing: border-box; margin: 10px 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #660000; font-size: 14px;">注意Q需要是spring3.0.5以上版本</span></p><br style="box-sizing: border-box; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;" /><span style="box-sizing: border-box; margin: 0px; padding: 0px; background-color: #ffffff; color: #ff0000; font-family: Arial; font-size: 18px;"><strong style="box-sizing: border-box;">解决Ҏ3Q?/strong></span><span style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; background-color: #ffffff; font-family: Arial;"><strong style="box-sizing: border-box;">在spring的配|文件中d如下一行:</strong></span><br style="box-sizing: border-box; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;" /><p style="box-sizing: border-box; margin: 0px; padding: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff;"><span style="box-sizing: border-box; margin: 0px; padding: 0px; font-family: Arial; color: #330033;"></span></p><div style="box-sizing: border-box; margin: 0px; color: #454545; font-family: "PingFang SC", "Microsoft YaHei", SimHei, Arial, SimSun; font-size: 16px; background-color: #ffffff; overflow: hidden;"><!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory --><br style="box-sizing: border-box;" /> <br style="box-sizing: border-box;" /> <mvc:resources mapping="/resources/**" location="/resources/" /> <br style="box-sizing: border-box;" />  <br style="box-sizing: border-box;" />q个配置告诉spring 静态资源的处理方式<br /><br />转: <span style="font-family: verdana, "courier new"; font-size: 14px;">http://blog.csdn.net/miss_kun/article/details/52047381</span></div><div></div><img src ="http://www.aygfsteel.com/jlin/aggbug/433031.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/jlin/" target="_blank">fly</a> 2018-01-30 16:16 <a href="http://www.aygfsteel.com/jlin/archive/2018/01/30/433031.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank">IJ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ӣ</a>| <a href="http://" target="_blank">ױ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽ</a>| <a href="http://" target="_blank">Ĵʡ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɽʡ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank">̳</a>| <a href="http://" target="_blank">Ĭ</a>| <a href="http://" target="_blank">鱦</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˳</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">üɽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ʲ</a>| <a href="http://" target="_blank">Ͻ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">Ͽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͤ</a>| <a href="http://" target="_blank">ϳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">綫</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¡</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>