﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-tinguo002</title><link>http://www.blogjava.net/tinguo002/</link><description /><language>zh-cn</language><lastBuildDate>Wed, 29 Apr 2026 16:52:36 GMT</lastBuildDate><pubDate>Wed, 29 Apr 2026 16:52:36 GMT</pubDate><ttl>60</ttl><item><title>开发任务执行准则</title><link>http://www.blogjava.net/tinguo002/archive/2015/03/25/423834.html</link><dc:creator>一堣而安</dc:creator><author>一堣而安</author><pubDate>Wed, 25 Mar 2015 11:44:00 GMT</pubDate><guid>http://www.blogjava.net/tinguo002/archive/2015/03/25/423834.html</guid><wfw:comment>http://www.blogjava.net/tinguo002/comments/423834.html</wfw:comment><comments>http://www.blogjava.net/tinguo002/archive/2015/03/25/423834.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/tinguo002/comments/commentRss/423834.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/tinguo002/services/trackbacks/423834.html</trackback:ping><description><![CDATA[<div>开发了一段时间，挺有感触了，记一些下来，慢慢完善补充，比如补充一些好用的模板，好用的方法，技巧进来。<br />==================================================================<br />原始需求：</div><div><span style="white-space:pre">	</span>判定，此需求是否可由我单独接收、确认</div><div><span style="white-space:pre">	</span>确认是否我该做的</div><div><span style="white-space:pre">	</span>确认需求带来的好处（错误修改类、无错优化类）</div><div><span style="white-space:pre">	</span>考虑好处是否可以扩大化（把这&#8220;个&#8221;错误修正，变成这&#8220;类&#8221;错误修正；把这个页面的优化，变成这类页面的优化）</div><div><span style="white-space:pre">	</span>注：需求的确认通常都需要时间，有不确定地方，刚不要当场否定或接收。</div><div><span style="white-space:pre">	</span></div><div>开发完成效果描述：</div><div><span style="white-space:pre">	</span>显示要素要齐全</div><div><span style="white-space:pre">	</span>操作步骤要齐全</div><div><span style="white-space:pre">	</span>生成可被查看，可被操作的东西</div><div><span style="white-space:pre">	</span></div><div>开发完成效果可行性验证：</div><div><span style="white-space:pre">	</span>验证效果是否满足原始需求</div><div><span style="white-space:pre">	</span>验证效果是否可能无法完成</div><div><span style="white-space:pre">	</span>验证效果是否最优方案（同类案例对比）</div><div><span style="white-space:pre">	</span>确定最终效果，三方确认（原始需求提出人-甲方，开发人-乙方技术人员，项目负责人-乙方非技术人员）</div><div><span style="white-space:pre">	</span></div><div>开发完成效果实现：</div><div><span style="white-space:pre">	</span>设计</div><div><span style="white-space:pre">		</span>可复用性</div><div><span style="white-space:pre">		</span>命名规范化<span style="white-space: pre;">		</span><br /><span style="white-space:pre">		</span>一个功能一个方法，同一类方法放到一个类中<br /><div><span style="white-space:pre">		</span>类名、方法名、出参入参名要确定</div></div><div><span style="white-space:pre">		</span>有文档，可拿来交流，可拿来追溯</div><div><span style="white-space:pre">	</span>审核</div><div><span style="white-space:pre">		</span>让参与人员或技术主管审核</div><div><span style="white-space:pre">	</span>测试要素设定</div><div><span style="white-space:pre">		</span>顺序操作步骤场景设定</div><div><span style="white-space:pre">		</span>强制插入步骤场景设定</div><div><span style="white-space:pre">	</span>开发</div><div><span style="white-space:pre">	</span>测试</div><img src ="http://www.blogjava.net/tinguo002/aggbug/423834.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/tinguo002/" target="_blank">一堣而安</a> 2015-03-25 19:44 <a href="http://www.blogjava.net/tinguo002/archive/2015/03/25/423834.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>WIN7实现多用户远程桌面</title><link>http://www.blogjava.net/tinguo002/archive/2014/10/08/418521.html</link><dc:creator>一堣而安</dc:creator><author>一堣而安</author><pubDate>Wed, 08 Oct 2014 09:18:00 GMT</pubDate><guid>http://www.blogjava.net/tinguo002/archive/2014/10/08/418521.html</guid><wfw:comment>http://www.blogjava.net/tinguo002/comments/418521.html</wfw:comment><comments>http://www.blogjava.net/tinguo002/archive/2014/10/08/418521.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/tinguo002/comments/commentRss/418521.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/tinguo002/services/trackbacks/418521.html</trackback:ping><description><![CDATA[<a href="http://www.360doc.com/content/14/0317/14/7669533_361282824.shtml">http://www.360doc.com/content/14/0317/14/7669533_361282824.shtml</a><br /><br /><p>日常工作中我们可能对服务器配置远程桌面连接居多，有第三方工具也有微软自带，比如在server2008上实现多用户的远程连接。</p><p>但是也可能碰到在WIN 7上实现多用户远程访问的情况，我们可以大概了解下如何设置（针对入门级别）：</p><p>一、基础配置</p><p>右击计算机--属性--高级系统设置<a href="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_1.png" target="_blank"><img width="650" title="高级系统设置.png" alt="085003551.png" src="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_1.png" /></a></p><p>选择远程选项卡：</p><p><a href="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_2.png" target="_blank"><img title="远程.png" alt="085433848.png" src="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_2.png" /></a></p><p>因为工作环境中有XP访问，所以<strong>不能选择</strong></p><p>仅允许运行使用网络级别身份验证的远程桌面的计算机连接（更安全）(N)</p><p><br /></p><p>(二)新建与选择用户</p><p>新建用户，右击计算机--管理--本地用户和组--新用户（此处以PC1为例）</p><p><a href="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_3.png" target="_blank"><img width="650" title="新建用户.png" alt="090339253.png" src="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_3.png" /></a></p><p>给用户赋权远程桌面，可以在刚刚远程选项卡下点击选择用户--添加</p><p><a href="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_4.png" target="_blank"><img title="添加.png" alt="090728676.png" src="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_4.png" /></a></p><p>（三）多用户访问实现</p><p>添加完成之后，我们默认只能有一个用户一个连接数来访问，如果我们需要多用户访问或者单用户多连接数访问</p><p>我们需要修改组策略，开始--运行（WIN+R），输入gpedit.msc回车，配置如下：</p><p><br /></p><p>1、计算机配置--管理模板--Windows组件--远程桌面服务--远程桌面会话主机--</p><p>修改限制连接的数量</p><p><a href="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_5.png" target="_blank"><img width="650" title="连接数修改.png" alt="090911367.png" src="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_5.png" /></a></p><p>2、修改将远程桌面服务用户限制到单独的远程桌面服务会话，改为禁用，允许单用户多会话：</p><p><a href="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_6.png" target="_blank"><img width="650" title="限制单用户.png" alt="091419254.png" src="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_6.png" /></a></p><p><br /></p><p>（四）修改WIN7 默认远程桌面连接数配置（WIN7默认连接数为1，服务器有单独修改RD数目的管理工具，所以我们利用第三方工具）</p><p><a href="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_7.png" target="_blank"><img title="修改.png" alt="091819751.png" src="http://image71.360doc.com/DownloadImg/2014/03/1714/39968337_7.png" /></a></p><p><br /></p><p>如上修改步骤结束后，我们已经能实现多用户多会话访问远程桌面了</p><p><br /></p><p>修改默认连接数工具见附件</p><img src ="http://www.blogjava.net/tinguo002/aggbug/418521.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/tinguo002/" target="_blank">一堣而安</a> 2014-10-08 17:18 <a href="http://www.blogjava.net/tinguo002/archive/2014/10/08/418521.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JDK部署 - Linux</title><link>http://www.blogjava.net/tinguo002/archive/2014/08/25/417318.html</link><dc:creator>一堣而安</dc:creator><author>一堣而安</author><pubDate>Mon, 25 Aug 2014 14:16:00 GMT</pubDate><guid>http://www.blogjava.net/tinguo002/archive/2014/08/25/417318.html</guid><wfw:comment>http://www.blogjava.net/tinguo002/comments/417318.html</wfw:comment><comments>http://www.blogjava.net/tinguo002/archive/2014/08/25/417318.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/tinguo002/comments/commentRss/417318.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/tinguo002/services/trackbacks/417318.html</trackback:ping><description><![CDATA[<br /><div><ul style="color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><li><strong>查看JDK版本</strong></li></ul><blockquote style="margin: 0px 0px 0px 40px; padding: 0px; border: currentColor; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"></blockquote><blockquote style="margin: 0px 0px 0px 40px; padding: 0px; border: currentColor; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">whereis java<br /><br />which java （java执行路径）<br /><br />echo $JAVA_HOME</blockquote><blockquote style="margin: 0px 0px 0px 40px; padding: 0px; border: currentColor; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"></blockquote><ul style="color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><li><strong>解压文件</strong></li></ul><span style="color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; float: none; display: inline !important; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tar -zxvf jdk-7u65-linux-x64.tar.gz</span><br style="color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" /><ul style="color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><li><strong>修改环境变量</strong></li></ul><blockquote style="margin: 0px 0px 0px 40px; padding: 0px; border: currentColor; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">1.所有用户的shell都有权使用这些环境变量<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; 用文本编辑器打开/etc/profile，在profile文件末尾加入：<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; JAVA_HOME=/usr/share/jdk1.5.0_05<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; PATH=$JAVA_HOME/bin:$PATH<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; export JAVA_HOME<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; export PATHexport CLASSPATH<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; 重新登录。<br /><br />2.某个用户有权使用这些环境变量<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; 用文本编辑器打开用户目录下的.bashrc文件，在.bashrc文件末尾加入：<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; JAVA_HOME=/usr/share/jdk1.5.0_05<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; PATH=$JAVA_HOME/bin:$PATH<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; export JAVA_HOME<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; export PATHexport CLASSPATH<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; 重新登录。</blockquote><ul style="color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><li><strong>给bin目录下的文件添加执行权限</strong></li></ul><blockquote style="margin: 0px 0px 0px 40px; padding: 0px; border: currentColor; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">&nbsp;&nbsp;&nbsp;&nbsp; 进入到bin目录下执行<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; chmod +x *.sh<br /></blockquote><ul style="color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><li><strong>查看java版本</strong></li></ul><blockquote style="margin: 0px 0px 0px 40px; padding: 0px; border: currentColor; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">&nbsp;&nbsp;&nbsp;&nbsp; java -version</blockquote><ul style="color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><li><strong>注意：</strong></li></ul><blockquote style="margin: 0px 0px 0px 40px; padding: 0px; border: currentColor; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">&nbsp;&nbsp;&nbsp;&nbsp; 1.要将 /usr/share/jdk1.5.0_05jdk 改为jdk安装目录<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; 2. linux下用冒号&#8221;:&#8221;来分隔路径<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; 3. $PATH / $CLASSPATH / $JAVA_HOME 是用来引用原来的环境变量的值在设置环境变量时特别要注意不能把原来的值给覆盖掉了。<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; 4. CLASSPATH中当前目录&#8221;.&#8221;不能丢掉。<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; 5. export是把这三个变量导出为全局变量。<br /><br />&nbsp;&nbsp;&nbsp;&nbsp; 6. 大小写必须严格区分。</blockquote></div><br /><br /><img src ="http://www.blogjava.net/tinguo002/aggbug/417318.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/tinguo002/" target="_blank">一堣而安</a> 2014-08-25 22:16 <a href="http://www.blogjava.net/tinguo002/archive/2014/08/25/417318.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux 下配置 JDK 环境变量</title><link>http://www.blogjava.net/tinguo002/archive/2014/08/25/417314.html</link><dc:creator>一堣而安</dc:creator><author>一堣而安</author><pubDate>Mon, 25 Aug 2014 13:38:00 GMT</pubDate><guid>http://www.blogjava.net/tinguo002/archive/2014/08/25/417314.html</guid><wfw:comment>http://www.blogjava.net/tinguo002/comments/417314.html</wfw:comment><comments>http://www.blogjava.net/tinguo002/archive/2014/08/25/417314.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/tinguo002/comments/commentRss/417314.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/tinguo002/services/trackbacks/417314.html</trackback:ping><description><![CDATA[纯java开发的软件在linux下面也可以应用自如。那么首先就需要配置好linux下的java环境，具体说来，就是配置jdk环境变量。<br />介绍在linux下配置jdk环境变量的几种常用方法。<br /><br />首先在linux下安装jdk，如果出现提示权限不够(且root下也提示权限不够)，可用#ls -l filename命令查看一下，如果显示类似如：<br /><br />-rw-rw-rw- 1 root root &#8230;.<br /><br />则表示任何用户都没有可执行权限（即使是root用户）。<br /><br />解决方法：<br /><br />#chmod a+x filename<br /><br />这样，安装好后，就可以接下来进行环境变量的配置了。这里给出三种可选方法：<br /><br />一、修改/etc/profile文件<br /><br />当本机仅仅作为开发使用时推荐使用这种方法，因为此种配置时所有用户的shell都有权使用这些环境变量，可能会给系统带来安全性问题。<br /><br />用文本编辑器打开/etc/profile，在profile文件末尾加入：<br /><br />JAVA_HOME=/usr/share/jdk1.5.0_05<br />PATH=$JAVA_HOME/bin:$PATH<br />CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar<br />export JAVA_HOME<br />export PATH<br />export CLASSPATH<img class="selectsearch-hide" id="selectsearch-icon" alt="搜索" src="http://img.baidu.com/img/iknow/qb/select-search.png" /><br /><br />重新登录即可。<br /><br />二、修改.bashrc文件<br /><br />这种方法更为安全，它可以把使用这些环境变量的权限控制到用户级别，如果需要给某个用户权限使用这些环境变量，只需要修改其个人用户主目录下的.bashrc文件就可以了。<br /><br />用文本编辑器打开用户目录下的.bashrc文件，在.bashrc文件末尾加入：<br /><br />set JAVA_HOME=/usr/share/jdk1.5.0_05<br />export JAVA_HOME<br />set PATH=$JAVA_HOME/bin:$PATH<br />export PATH<br />set CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar<br />export CLASSPATH<br /><br />重新登录。<br /><br />三、直接在shell下设置变量<br /><br />不推荐使用这种方法，因为换个shell，该设置就无效了。这种方法仅仅是临时使用，以后要使用的时候又要重新设置，比较麻烦。<br /><br />只需在shell终端执行下列命令：<br /><br />export JAVA_HOME=/usr/share/jdk1.5.0_05<br />export PATH=$JAVA_HOME/bin:$PATH<br />export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar<br /><br />注意：<br /><br />1.要将 /usr/share/jdk1.5.0_05jdk 改为jdk安装目录<br />2. linux下用冒号&#8221;:&#8221;来分隔路径<br />3. $PATH / $CLASSPATH / $JAVA_HOME 是用来引用原来的环境变量的值在设置环境变量时特别要注意不能把原来的值给覆盖掉了。<br />4. CLASSPATH中当前目录&#8221;.&#8221;不能丢掉。<br />5. export是把这三个变量导出为全局变量。<br />6. 大小写必须严格区分。<img src ="http://www.blogjava.net/tinguo002/aggbug/417314.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/tinguo002/" target="_blank">一堣而安</a> 2014-08-25 21:38 <a href="http://www.blogjava.net/tinguo002/archive/2014/08/25/417314.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>javascript 代码 - 金额格式化，每三位加个,</title><link>http://www.blogjava.net/tinguo002/archive/2014/08/18/417078.html</link><dc:creator>一堣而安</dc:creator><author>一堣而安</author><pubDate>Mon, 18 Aug 2014 08:58:00 GMT</pubDate><guid>http://www.blogjava.net/tinguo002/archive/2014/08/18/417078.html</guid><wfw:comment>http://www.blogjava.net/tinguo002/comments/417078.html</wfw:comment><comments>http://www.blogjava.net/tinguo002/archive/2014/08/18/417078.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/tinguo002/comments/commentRss/417078.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/tinguo002/services/trackbacks/417078.html</trackback:ping><description><![CDATA[<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; width: 98%; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; background-color: #eeeeee"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img onclick="this.style.display='none'; Codehighlighter1_0_16_Open_Text.style.display='none'; Codehighlighter1_0_16_Closed_Image.style.display='inline'; Codehighlighter1_0_16_Closed_Text.style.display='inline';" id="Codehighlighter1_0_16_Open_Image" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img onclick="this.style.display='none'; Codehighlighter1_0_16_Closed_Text.style.display='none'; Codehighlighter1_0_16_Open_Image.style.display='inline'; Codehighlighter1_0_16_Open_Text.style.display='inline';" id="Codehighlighter1_0_16_Closed_Image" style="display: none" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"><span id="Codehighlighter1_0_16_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff">/**/</span><span id="Codehighlighter1_0_16_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">*<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;*&nbsp;金额格式化，每三位加个,<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />&nbsp;</span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /><img onclick="this.style.display='none'; Codehighlighter1_46_524_Open_Text.style.display='none'; Codehighlighter1_46_524_Closed_Image.style.display='inline'; Codehighlighter1_46_524_Closed_Text.style.display='inline';" id="Codehighlighter1_46_524_Open_Image" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top"><img onclick="this.style.display='none'; Codehighlighter1_46_524_Closed_Text.style.display='none'; Codehighlighter1_46_524_Open_Image.style.display='inline'; Codehighlighter1_46_524_Open_Text.style.display='inline';" id="Codehighlighter1_46_524_Closed_Image" style="display: none" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top"></span><span style="color: #0000ff">function</span><span style="color: #000000">&nbsp;formatMoney1(money)</span><span id="Codehighlighter1_46_524_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_46_524_Open_Text"><span style="color: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;str&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;money&nbsp;</span><span style="color: #000000">+</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">""</span><span style="color: #000000">;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;result&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">""</span><span style="color: #000000">;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;index&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;str.indexOf(</span><span style="color: #000000">"</span><span style="color: #000000">.</span><span style="color: #000000">"</span><span style="color: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;endStr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">""</span><span style="color: #000000">;<br /><img onclick="this.style.display='none'; Codehighlighter1_151_279_Open_Text.style.display='none'; Codehighlighter1_151_279_Closed_Image.style.display='inline'; Codehighlighter1_151_279_Closed_Text.style.display='inline';" id="Codehighlighter1_151_279_Open_Image" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img onclick="this.style.display='none'; Codehighlighter1_151_279_Closed_Text.style.display='none'; Codehighlighter1_151_279_Open_Image.style.display='inline'; Codehighlighter1_151_279_Open_Text.style.display='inline';" id="Codehighlighter1_151_279_Closed_Image" style="display: none" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(index</span><span style="color: #000000">&gt;-</span><span style="color: #000000">1</span><span style="color: #000000">)</span><span id="Codehighlighter1_151_279_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_151_279_Open_Text"><span style="color: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;endStr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;str.substring(index,&nbsp;str.length);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;endStr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;endStr.length</span><span style="color: #000000">==</span><span style="color: #000000">3</span><span style="color: #000000">?</span><span style="color: #000000">endStr:endStr</span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000">0</span><span style="color: #000000">"</span><span style="color: #000000">;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;str&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;str.substring(</span><span style="color: #000000">0</span><span style="color: #000000">,&nbsp;index);<br /><img onclick="this.style.display='none'; Codehighlighter1_284_305_Open_Text.style.display='none'; Codehighlighter1_284_305_Closed_Image.style.display='inline'; Codehighlighter1_284_305_Closed_Text.style.display='inline';" id="Codehighlighter1_284_305_Open_Image" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img onclick="this.style.display='none'; Codehighlighter1_284_305_Closed_Text.style.display='none'; Codehighlighter1_284_305_Open_Image.style.display='inline'; Codehighlighter1_284_305_Open_Text.style.display='inline';" id="Codehighlighter1_284_305_Closed_Image" style="display: none" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #0000ff">else</span><span id="Codehighlighter1_284_305_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_284_305_Open_Text"><span style="color: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;endStr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">.00</span><span style="color: #000000">"</span><span style="color: #000000">;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;i&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">var</span><span style="color: #000000">&nbsp;len&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;str.length;<br /><img onclick="this.style.display='none'; Codehighlighter1_359_499_Open_Text.style.display='none'; Codehighlighter1_359_499_Closed_Image.style.display='inline'; Codehighlighter1_359_499_Closed_Text.style.display='inline';" id="Codehighlighter1_359_499_Open_Image" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img onclick="this.style.display='none'; Codehighlighter1_359_499_Closed_Text.style.display='none'; Codehighlighter1_359_499_Open_Image.style.display='inline'; Codehighlighter1_359_499_Open_Text.style.display='inline';" id="Codehighlighter1_359_499_Closed_Image" style="display: none" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(i;i</span><span style="color: #000000">&lt;</span><span style="color: #000000">len;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_359_499_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_359_499_Open_Text"><span style="color: #000000">{<br /><img onclick="this.style.display='none'; Codehighlighter1_415_456_Open_Text.style.display='none'; Codehighlighter1_415_456_Closed_Image.style.display='inline'; Codehighlighter1_415_456_Closed_Text.style.display='inline';" id="Codehighlighter1_415_456_Open_Image" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img onclick="this.style.display='none'; Codehighlighter1_415_456_Closed_Text.style.display='none'; Codehighlighter1_415_456_Open_Image.style.display='inline'; Codehighlighter1_415_456_Open_Text.style.display='inline';" id="Codehighlighter1_415_456_Closed_Image" style="display: none" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">((len&nbsp;</span><span style="color: #000000">-</span><span style="color: #000000">&nbsp;(</span><span style="color: #000000">4</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">+</span><span style="color: #000000">&nbsp;i))&nbsp;</span><span style="color: #000000">%</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">3</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">==</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">&amp;&amp;</span><span style="color: #000000">&nbsp;(len&nbsp;</span><span style="color: #000000">-</span><span style="color: #000000">&nbsp;(</span><span style="color: #000000">4</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">+</span><span style="color: #000000">&nbsp;i))&nbsp;</span><span style="color: #000000">&gt;=</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">)</span><span id="Codehighlighter1_415_456_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_415_456_Open_Text"><span style="color: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result&nbsp;</span><span style="color: #000000">+=</span><span style="color: #000000">&nbsp;str.substr(i,&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">)&nbsp;</span><span style="color: #000000">+</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">,</span><span style="color: #000000">"</span><span style="color: #000000">;<br /><img onclick="this.style.display='none'; Codehighlighter1_461_496_Open_Text.style.display='none'; Codehighlighter1_461_496_Closed_Image.style.display='inline'; Codehighlighter1_461_496_Closed_Text.style.display='inline';" id="Codehighlighter1_461_496_Open_Image" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top"><img onclick="this.style.display='none'; Codehighlighter1_461_496_Closed_Text.style.display='none'; Codehighlighter1_461_496_Open_Image.style.display='inline'; Codehighlighter1_461_496_Open_Text.style.display='inline';" id="Codehighlighter1_461_496_Closed_Image" style="display: none" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #0000ff">else</span><span id="Codehighlighter1_461_496_Closed_Text" style="border-top: #808080 1px solid; border-right: #808080 1px solid; border-bottom: #808080 1px solid; border-left: #808080 1px solid; display: none; background-color: #ffffff"><img src="http://www.blogjava.net/Images/dot.gif"  alt="" /></span><span id="Codehighlighter1_461_496_Open_Text"><span style="color: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;result&nbsp;</span><span style="color: #000000">+=</span><span style="color: #000000">&nbsp;str.substr(i,&nbsp;</span><span style="color: #000000">1</span><span style="color: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top"  alt="" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;result</span><span style="color: #000000">+</span><span style="color: #000000">endStr;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top"  alt="" />}</span></span></div><img src ="http://www.blogjava.net/tinguo002/aggbug/417078.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/tinguo002/" target="_blank">一堣而安</a> 2014-08-18 16:58 <a href="http://www.blogjava.net/tinguo002/archive/2014/08/18/417078.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>图片转字符串 </title><link>http://www.blogjava.net/tinguo002/archive/2014/08/05/416579.html</link><dc:creator>一堣而安</dc:creator><author>一堣而安</author><pubDate>Tue, 05 Aug 2014 03:30:00 GMT</pubDate><guid>http://www.blogjava.net/tinguo002/archive/2014/08/05/416579.html</guid><wfw:comment>http://www.blogjava.net/tinguo002/comments/416579.html</wfw:comment><comments>http://www.blogjava.net/tinguo002/archive/2014/08/05/416579.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/tinguo002/comments/commentRss/416579.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/tinguo002/services/trackbacks/416579.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 事例1：Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package&nbsp;com.apexsoft.mobile.utils;import&nbsp;java.io.FileInputStream;import&nbsp;java.io.Fil...&nbsp;&nbsp;<a href='http://www.blogjava.net/tinguo002/archive/2014/08/05/416579.html'>阅读全文</a><img src ="http://www.blogjava.net/tinguo002/aggbug/416579.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/tinguo002/" target="_blank">一堣而安</a> 2014-08-05 11:30 <a href="http://www.blogjava.net/tinguo002/archive/2014/08/05/416579.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java中InputStream转化为byte[]数组 </title><link>http://www.blogjava.net/tinguo002/archive/2014/08/04/416551.html</link><dc:creator>一堣而安</dc:creator><author>一堣而安</author><pubDate>Mon, 04 Aug 2014 13:12:00 GMT</pubDate><guid>http://www.blogjava.net/tinguo002/archive/2014/08/04/416551.html</guid><wfw:comment>http://www.blogjava.net/tinguo002/comments/416551.html</wfw:comment><comments>http://www.blogjava.net/tinguo002/archive/2014/08/04/416551.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/tinguo002/comments/commentRss/416551.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/tinguo002/services/trackbacks/416551.html</trackback:ping><description><![CDATA[
<span style='font-family: "Comic Sans MS"; font-size: 16px;'>在commons-io包中org.apache.commons.io.IOUtils类的toByteArray(InputStream input)已经有实现了,我们可以参考下思路,完成我们的方法,我们可以用类似下面的代码实现inputStream转化为byte[]数组</span><pre style="padding: 5px; width: auto; text-align: left; line-height: 19px; margin-top: 0px; margin-bottom: 10px; -ms-overflow-x: auto; -ms-overflow-y: auto; background-color: rgb(255, 255, 255);"><span style='font-family: "Comic Sans MS"; font-size: 16px;'>public static byte[] toByteArray(InputStream input) throws IOException {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    byte[] buffer = new byte[4096];
    int n = 0;
    while (-1 != (n = input.read(buffer))) {
        output.write(buffer, 0, n);
    }
    return output.toByteArray();
}
</span></pre><p style="margin: 20px auto 0px; text-align: left; line-height: 25px; padding-top: 0px; padding-bottom: 0px;"><span style='font-family: "Comic Sans MS"; font-size: 16px;'>下面是IOUtils中摘录出与toByteArray相关的方法</span></p><pre style="padding: 5px; width: auto; text-align: left; line-height: 19px; margin-top: 0px; margin-bottom: 10px; -ms-overflow-x: auto; -ms-overflow-y: auto; background-color: rgb(255, 255, 255);"><span style='font-family: "Comic Sans MS"; font-size: 16px;'>org.apache.commons.io.IOUtils.toByteArray

方法如下:
public static byte[] toByteArray(InputStream input)
  throws IOException
{
  ByteArrayOutputStream output = new ByteArrayOutputStream();
  copy(input, output);
  return output.toByteArray();
}

public static int copy(InputStream input, OutputStream output)
  throws IOException
{
  long count = copyLarge(input, output);
  if (count &gt; 2147483647L) {
    return -1;
  }
  return (int)count;
}

public static long copyLarge(InputStream input, OutputStream output)
  throws IOException
{
  byte[] buffer = new byte[4096];
  long count = 0L;
  int n = 0;
  while (-1 != (n = input.read(buffer))) {
    output.write(buffer, 0, n);
    count += n;
  }
  return count;
}<br /><br />文章详细出处：<a href="http://blog.csdn.net/zdwzzu2006/article/details/7745827">http://blog.csdn.net/zdwzzu2006/article/details/7745827</a></span></pre> 
<img src ="http://www.blogjava.net/tinguo002/aggbug/416551.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/tinguo002/" target="_blank">一堣而安</a> 2014-08-04 21:12 <a href="http://www.blogjava.net/tinguo002/archive/2014/08/04/416551.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>tomcat虚拟目录配置 </title><link>http://www.blogjava.net/tinguo002/archive/2014/08/04/416549.html</link><dc:creator>一堣而安</dc:creator><author>一堣而安</author><pubDate>Mon, 04 Aug 2014 12:57:00 GMT</pubDate><guid>http://www.blogjava.net/tinguo002/archive/2014/08/04/416549.html</guid><wfw:comment>http://www.blogjava.net/tinguo002/comments/416549.html</wfw:comment><comments>http://www.blogjava.net/tinguo002/archive/2014/08/04/416549.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/tinguo002/comments/commentRss/416549.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/tinguo002/services/trackbacks/416549.html</trackback:ping><description><![CDATA[<p><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Tomcat6.0</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">虚拟目录配置</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>[</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">转</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>] <br /></span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">设虚拟目录</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> "site"</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">，通过</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> <a href="http://localhost:8080/site">http://localhost:8080/site</a> </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">访问物理路径</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> D:"site </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件夹里面的内容。设置过程如下：</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> <br />1.</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">复制</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> Tomcat6.0"webapps"ROOT </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">目录下的</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> WEB-INF </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件夹到</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> D:"site </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">目录下。</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> <br />2.</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">打开</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> D:"site"WEB-INF </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">目录下的</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> web.xml </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>,</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">在</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> &lt;/description&gt; </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">之后加入：</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> <br />&lt;!--JSPC servlet mappings start --&gt; <br />&lt;!--JSPC servlet mappings end --&gt; <br />3.</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">打开</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> Tomcat6.0"conf"server.xml </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件，在</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> &lt;Host&gt; </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">和</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> &lt;/Host&gt; </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">之间加入：</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> <br />&lt;Context path="/site" docBase="d:"site"&gt;&lt;/Context&gt; <br />path="/site" </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">就是虚拟目录的名称</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> <br />docBase="d:"site"&gt; </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">为物理路径</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> <br />4.</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">打开</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> Tomcat6.0"conf"web.xml </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件，找到</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>: <br />&lt;init-param&gt; <br />&lt;param-name&gt;listings&lt;/param-name&gt; <br />&lt;param-value&gt;false&lt;/param-value&gt; <br />&lt;/init-param&gt; <br /></span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">把</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>false</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">设成</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>true</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">保存，重启</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Tomcat</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">，现在就可以应用</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> <a href="http://localhost:8080/site">http://localhost:8080/site</a> </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">虚拟目录了。</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'></span></p>
<p style="line-height: 200%"><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Tomcat6</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">设置虚拟目录的方法</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>, </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">不修改</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>server.xml </span></p>
<p style="line-height: 200%"><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'><br /></span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">在</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>tomcat</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件夹的</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>conf"catalina"localhost(</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">对于</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Tomcat6</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">版本及其以上，需要自己创建</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>catalina</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">和</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>localhost</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">这两个文件夹</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>) </span></p>
<p style="line-height: 200%"><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">增加</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>project .xml</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件（该文件名的</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>project</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">要和下面的</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>&#8220;path=&#8220;/xxx"&#8221;</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">的</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>xxx</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">相同）</span></p>
<p style="line-height: 200%"><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件内容</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>: </span></p>
<p style="line-height: 200%"><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>&lt;Context path="/project" reloadable="true" docBase="E:"javastudio"oob" workDir="E:"javastudio"oob"work" /&gt;</span></p>
<p style="line-height: 200%"><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'><br />docBase</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">是项目文件夹的</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>web-inf</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件夹的上一层目录</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> <br />workDir</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">是指</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Tomcat</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">解析</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Jsp</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">转换为</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Java</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件，并编译为</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>class</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">存放的文件夹，设置在项目文件夹里面，可以避免移植到其他地方首次读取</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>jsp</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件需要重新解析</span> <span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">。一般格式：项目文件夹</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>"work <br />reloadable</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">是指可以重新加载，一般设置为</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>true</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">，方便使用，不需要经常重启</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Tomcat</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">。</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> <br />&nbsp;</span></p>
<p style="line-height: 200%"><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">以后启动</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Tomcat</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">，在浏览器输入</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'><a href="http://localhost:8080/project">http://localhost:8080/project</a></span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">就能访问</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'><br /></span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">该项目的</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>welcome</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件。</span></p>
<p style="line-height: 200%"><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">转：</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>TomCat 6.0</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">虚拟目录配置！</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>2008</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">年</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>03</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">月</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>09</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">日</span> <span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">星期日</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> 13:51</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">之前在</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>5.0</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">下配置虚拟目录，我一般是采用在</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>conf"server.xml</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">中增加</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>&lt;Context .../&gt;</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">的方法，可是此法在</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>6.0</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">中失效</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>(</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">后经验证有效，可能是之前实验过程中有误</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>)</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">。按照</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>tomcat 6.0</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">启动之后的相关文档的说明</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'><a href="http://localhost:8080/docs/config/context.html">http://localhost:8080/docs/config/context.html</a></span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">，尝试了一些方法：</span></p>
<p style="line-height: 200%"><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>-----------------------------tomcat6.0</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文档中关于</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Context</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">的说明</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>-------------------<br />You may define as many Context elements as you wish. Each such Context MUST have a unique context path. In addition, a Context must be present with a context path equal to a zero-length string. This Context becomes the default web application for this virtual host, and is used to process all requests that do not match any other Context's context path.</span></p>
<p style="line-height: 200%"><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>For Tomcat 6, unlike Tomcat 4.x, it is NOT recommended to place &lt;Context&gt; elements directly in the server.xml file. This is because it makes modifing the Context configuration more invasive since the main conf/server.xml file cannot be reloaded without restarting Tomcat.</span></p>
<p style="line-height: 200%"><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'><br />Context elements may be explicitly defined:</span></p>
<p style="line-height: 200%"><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>in the $CATALINA_HOME/conf/context.xml file: the Context element information will be loaded by all webapps <br />in the $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default file: the Context element information will be loaded by all webapps of that host <br />in individual files (with a ".xml" extension) in the $CATALINA_HOME/conf/[enginename]/[hostname]/ directory. The name of the file (less the .xml) extension will be used as the context path. Multi-level context paths may be defined using #, e.g. context#path.xml. The default web application may be defined by using a file called ROOT.xml. <br />if the previous file was not found for this application, in an individual file at /META-INF/context.xml inside the application files <br />inside a Host element in the main conf/server.xml <br />-------------------------------------------------------------------------------</span></p>
<p style="line-height: 200%"><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">逐一验证，方法</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>1</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">，</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>2</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">均无效，成功的有以下</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>2</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">种：</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>(</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">下文用</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>%tomcat%</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">表示</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Tomcat6.0</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">的安装目录，希望在浏览器中通过</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'><a href="http://localhost:8080/abc/default.jsp">http://localhost:8080/abc/default.jsp</a> </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">来访问</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>d:"myJsp"default.jsp)</span></p>
<p style="line-height: 200%"><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">方法一：</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>(</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文档中说不建议使用</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>)</span></p>
<p style="line-height: 200%"><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">找到</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>%tomcat%"conf"server.xml</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">，在</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>&lt;/Host&gt;</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">之前加入：</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'><br />&lt;Context docBase="d:"myJsp" path="/abc" /&gt;<br /></span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">保存文件之后，重启</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Tomcat</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">即可。注意：大小写不能错</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>! </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">斜杆</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>"/"</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">或</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>"""</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">的方向别搞错。</span></p>
<p style="line-height: 200%"><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">方法二：该方法推荐使用，比较简单。</span></p>
<p style="line-height: 200%"><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">在</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>%tomcat%"conf"Catalina"locahost(</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">该目录可能需要手工创建</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>)</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">下新建一个文件</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>abc.xml</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">，注意文件名中的</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>abc</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">就表示虚拟目录的名称，所以不可随意命名，该文件的内容为</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>: <br />&lt;Context docBase="d:"myJsp" /&gt;<br /></span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">重启</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>Tomcat</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">即可。</span></p>
<p style="line-height: 200%"><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>-------------------------------------------------------------------------------------------<br /></span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">其它设置：当</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>url</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">中未明确指定文件名时，是否列出相关目录下所有文件的开关设置：</span></p>
<p style="line-height: 200%"><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">打开</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'> %tomcat%"conf"web.xml </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件，找到</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>: <br />&lt;init-param&gt; <br />&lt;param-name&gt;listings&lt;/param-name&gt; <br />&lt;param-value&gt;false&lt;/param-value&gt; <br />&lt;/init-param&gt; <br /></span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">把</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>false</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">改成</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>true</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">即可。</span></p>
<p style="line-height: 200%"><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>-------------------------------------------------------------------------------------------<br /></span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">其他人的同类经验：</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'><a href="http://fengzhiyu-sh.javaeye.com/blog/153506">http://fengzhiyu-sh.javaeye.com/blog/153506</a> </span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">经验证无需设置文中的</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>web application</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">下的</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'>web.xml</span><span style="font-size: 9pt; font-family: 新宋体; line-height: 200%">文件。</span><span style='font-size: 9pt; font-family: "Times New Roman"; line-height: 200%'><br /></span></p><br />文章详细参考：<a href="http://www.cnblogs.com/bingoidea/archive/2009/06/06/1497787.html">http://www.cnblogs.com/bingoidea/archive/2009/06/06/1497787.html</a><img src ="http://www.blogjava.net/tinguo002/aggbug/416549.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/tinguo002/" target="_blank">一堣而安</a> 2014-08-04 20:57 <a href="http://www.blogjava.net/tinguo002/archive/2014/08/04/416549.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Tomcat的窗口名称修改</title><link>http://www.blogjava.net/tinguo002/archive/2014/08/04/416548.html</link><dc:creator>一堣而安</dc:creator><author>一堣而安</author><pubDate>Mon, 04 Aug 2014 12:56:00 GMT</pubDate><guid>http://www.blogjava.net/tinguo002/archive/2014/08/04/416548.html</guid><wfw:comment>http://www.blogjava.net/tinguo002/comments/416548.html</wfw:comment><comments>http://www.blogjava.net/tinguo002/archive/2014/08/04/416548.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/tinguo002/comments/commentRss/416548.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/tinguo002/services/trackbacks/416548.html</trackback:ping><description><![CDATA[修改 <br />catalina.bat <br /><br />找到下面的东东： <br /><br /><br />:doStart <br />shift <br />if not "%OS%" == "Windows_NT" goto noTitle <br />set _EXECJAVA=start "<span style="color: red">Tomcat</span>" %_RUNJAVA% <br />goto gotTitle <br /><br />修改红色部分<img src ="http://www.blogjava.net/tinguo002/aggbug/416548.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/tinguo002/" target="_blank">一堣而安</a> 2014-08-04 20:56 <a href="http://www.blogjava.net/tinguo002/archive/2014/08/04/416548.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java下载网页内容和网络图片 </title><link>http://www.blogjava.net/tinguo002/archive/2014/08/04/416542.html</link><dc:creator>一堣而安</dc:creator><author>一堣而安</author><pubDate>Mon, 04 Aug 2014 10:38:00 GMT</pubDate><guid>http://www.blogjava.net/tinguo002/archive/2014/08/04/416542.html</guid><wfw:comment>http://www.blogjava.net/tinguo002/comments/416542.html</wfw:comment><comments>http://www.blogjava.net/tinguo002/archive/2014/08/04/416542.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/tinguo002/comments/commentRss/416542.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/tinguo002/services/trackbacks/416542.html</trackback:ping><description><![CDATA[
<div style="padding: 4px 5px 4px 4px; border: 1px solid rgb(204, 204, 204); width: 98%; font-size: 13px; -ms-word-break: break-all; background-color: rgb(238, 238, 238);"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">&nbsp;java.io.BufferedReader;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">&nbsp;java.io.ByteArrayOutputStream;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">&nbsp;java.io.File;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">&nbsp;java.io.FileOutputStream;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">&nbsp;java.io.InputStream;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">&nbsp;java.io.InputStreamReader;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">&nbsp;java.net.HttpURLConnection;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">&nbsp;java.net.URL;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /><br /><img align="top" id="Codehighlighter1_267_2137_Open_Image" onclick="this.style.display='none'; Codehighlighter1_267_2137_Open_Text.style.display='none'; Codehighlighter1_267_2137_Closed_Image.style.display='inline'; Codehighlighter1_267_2137_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif"><img align="top" id="Codehighlighter1_267_2137_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_267_2137_Closed_Text.style.display='none'; Codehighlighter1_267_2137_Open_Image.style.display='inline'; Codehighlighter1_267_2137_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif"></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">&nbsp;UrlResource&nbsp;</span><span id="Codehighlighter1_267_2137_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_267_2137_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" /><br /><img align="top" id="Codehighlighter1_309_530_Open_Image" onclick="this.style.display='none'; Codehighlighter1_309_530_Open_Text.style.display='none'; Codehighlighter1_309_530_Closed_Image.style.display='inline'; Codehighlighter1_309_530_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img align="top" id="Codehighlighter1_309_530_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_309_530_Closed_Text.style.display='none'; Codehighlighter1_309_530_Open_Image.style.display='inline'; Codehighlighter1_309_530_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;main(String[]&nbsp;args)</span><span id="Codehighlighter1_309_530_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_309_530_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" id="Codehighlighter1_317_477_Open_Image" onclick="this.style.display='none'; Codehighlighter1_317_477_Open_Text.style.display='none'; Codehighlighter1_317_477_Closed_Image.style.display='inline'; Codehighlighter1_317_477_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img align="top" id="Codehighlighter1_317_477_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_317_477_Closed_Text.style.display='none'; Codehighlighter1_317_477_Open_Image.style.display='inline'; Codehighlighter1_317_477_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span id="Codehighlighter1_317_477_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_317_477_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(UrlResource.getUrlDetail(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">http://www.baidu.com</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">));<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;saveUrlFile(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">http://www.baidu.com/img/baidu_jgylogo3.gif</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,&nbsp;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">D:\\1.gif</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br /><img align="top" id="Codehighlighter1_499_527_Open_Image" onclick="this.style.display='none'; Codehighlighter1_499_527_Open_Text.style.display='none'; Codehighlighter1_499_527_Closed_Image.style.display='inline'; Codehighlighter1_499_527_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img align="top" id="Codehighlighter1_499_527_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_499_527_Closed_Text.style.display='none'; Codehighlighter1_499_527_Open_Image.style.display='inline'; Codehighlighter1_499_527_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);">&nbsp;(Exception&nbsp;e)&nbsp;</span><span id="Codehighlighter1_499_527_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_499_527_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">获取网络文件，转存到fileDes中，fileDes需要带文件后缀名</span><span style="color: rgb(0, 128, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" /></span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">&nbsp;saveUrlFile(String&nbsp;fileUrl,String&nbsp;fileDes)&nbsp;</span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);">&nbsp;Exception<br /><img align="top" id="Codehighlighter1_653_934_Open_Image" onclick="this.style.display='none'; Codehighlighter1_653_934_Open_Text.style.display='none'; Codehighlighter1_653_934_Closed_Image.style.display='inline'; Codehighlighter1_653_934_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img align="top" id="Codehighlighter1_653_934_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_653_934_Closed_Text.style.display='none'; Codehighlighter1_653_934_Open_Image.style.display='inline'; Codehighlighter1_653_934_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_653_934_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_653_934_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;File&nbsp;toFile&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;File(fileDes);<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;(toFile.exists())<br /><img align="top" id="Codehighlighter1_715_770_Open_Image" onclick="this.style.display='none'; Codehighlighter1_715_770_Open_Text.style.display='none'; Codehighlighter1_715_770_Closed_Image.style.display='inline'; Codehighlighter1_715_770_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img align="top" id="Codehighlighter1_715_770_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_715_770_Closed_Text.style.display='none'; Codehighlighter1_715_770_Open_Image.style.display='inline'; Codehighlighter1_715_770_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_715_770_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_715_770_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" /></span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;Exception("file&nbsp;exist");</span><span style="color: rgb(0, 128, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" /></span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;toFile.createNewFile();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FileOutputStream&nbsp;outImgStream&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;FileOutputStream(toFile);<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;outImgStream.write(getUrlFileData(fileUrl));<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;outImgStream.close();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">获取链接地址文件的byte数据</span><span style="color: rgb(0, 128, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" /></span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[]&nbsp;getUrlFileData(String&nbsp;fileUrl)&nbsp;</span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);">&nbsp;Exception<br /><img align="top" id="Codehighlighter1_1028_1500_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1028_1500_Open_Text.style.display='none'; Codehighlighter1_1028_1500_Closed_Image.style.display='inline'; Codehighlighter1_1028_1500_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img align="top" id="Codehighlighter1_1028_1500_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1028_1500_Closed_Text.style.display='none'; Codehighlighter1_1028_1500_Open_Image.style.display='inline'; Codehighlighter1_1028_1500_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1028_1500_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_1028_1500_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URL&nbsp;url&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;URL(fileUrl);<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HttpURLConnection&nbsp;httpConn&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;(HttpURLConnection)&nbsp;url.openConnection();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;httpConn.connect();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InputStream&nbsp;cin&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;httpConn.getInputStream();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ByteArrayOutputStream&nbsp;outStream&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;ByteArrayOutputStream();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[]&nbsp;buffer&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 0);">1024</span><span style="color: rgb(0, 0, 0);">];<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);">&nbsp;len&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br /><img align="top" id="Codehighlighter1_1357_1397_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1357_1397_Open_Text.style.display='none'; Codehighlighter1_1357_1397_Closed_Image.style.display='inline'; Codehighlighter1_1357_1397_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img align="top" id="Codehighlighter1_1357_1397_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1357_1397_Closed_Text.style.display='none'; Codehighlighter1_1357_1397_Open_Image.style.display='inline'; Codehighlighter1_1357_1397_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);">&nbsp;((len&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;cin.read(buffer))&nbsp;</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">)&nbsp;</span><span id="Codehighlighter1_1357_1397_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_1357_1397_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;outStream.write(buffer,&nbsp;</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,&nbsp;len);<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cin.close();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[]&nbsp;fileData&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;outStream.toByteArray();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;outStream.close();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;fileData;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">获取链接地址的字符数据，wichSep是否换行标记</span><span style="color: rgb(0, 128, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" /></span><span style="color: rgb(0, 0, 0);">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);">&nbsp;String&nbsp;getUrlDetail(String&nbsp;urlStr,</span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);">&nbsp;withSep)&nbsp;</span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);">&nbsp;Exception<br /><img align="top" id="Codehighlighter1_1617_2133_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1617_2133_Open_Text.style.display='none'; Codehighlighter1_1617_2133_Closed_Image.style.display='inline'; Codehighlighter1_1617_2133_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img align="top" id="Codehighlighter1_1617_2133_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1617_2133_Closed_Text.style.display='none'; Codehighlighter1_1617_2133_Open_Image.style.display='inline'; Codehighlighter1_1617_2133_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1617_2133_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_1617_2133_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;URL&nbsp;url&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;URL(urlStr);<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HttpURLConnection&nbsp;httpConn&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;(HttpURLConnection)url.openConnection();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;httpConn.connect();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InputStream&nbsp;cin&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;httpConn.getInputStream();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BufferedReader&nbsp;reader&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;BufferedReader(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;InputStreamReader(cin,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">UTF-8</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;StringBuffer&nbsp;sb&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">&nbsp;StringBuffer();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;rl&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);">((rl&nbsp;</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">&nbsp;reader.readLine())&nbsp;</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 0);">&nbsp;</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">)<br /><img align="top" id="Codehighlighter1_1975_2106_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1975_2106_Open_Text.style.display='none'; Codehighlighter1_1975_2106_Closed_Image.style.display='inline'; Codehighlighter1_1975_2106_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img align="top" id="Codehighlighter1_1975_2106_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1975_2106_Closed_Text.style.display='none'; Codehighlighter1_1975_2106_Open_Image.style.display='inline'; Codehighlighter1_1975_2106_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1975_2106_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_1975_2106_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">&nbsp;(withSep)<br /><img align="top" id="Codehighlighter1_1996_2065_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1996_2065_Open_Text.style.display='none'; Codehighlighter1_1996_2065_Closed_Image.style.display='inline'; Codehighlighter1_1996_2065_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img align="top" id="Codehighlighter1_1996_2065_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_1996_2065_Closed_Text.style.display='none'; Codehighlighter1_1996_2065_Open_Image.style.display='inline'; Codehighlighter1_1996_2065_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_1996_2065_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_1996_2065_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.append(rl).append(System.getProperty(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">line.separator</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br /><img align="top" id="Codehighlighter1_2078_2102_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2078_2102_Open_Text.style.display='none'; Codehighlighter1_2078_2102_Closed_Image.style.display='inline'; Codehighlighter1_2078_2102_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img align="top" id="Codehighlighter1_2078_2102_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_2078_2102_Closed_Text.style.display='none'; Codehighlighter1_2078_2102_Open_Image.style.display='inline'; Codehighlighter1_2078_2102_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span id="Codehighlighter1_2078_2102_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_2078_2102_Open_Text"><span style="color: rgb(0, 0, 0);">{<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sb.append(rl);<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">&nbsp;sb.toString();<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: rgb(0, 0, 0);"><br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;<br /><img align="top" alt="" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span></div><br />// 禁止图像缓存<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; response.setHeader("Pragma", "no-cache");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; response.setHeader("Cache-Control", "no-cache");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; response.setDateHeader("Expires", 0);<br /><br /><br />文章详细参考：<a href="http://blog.csdn.net/pandakong/article/details/7430844">http://blog.csdn.net/pandakong/article/details/7430844</a><br /> 
<img src ="http://www.blogjava.net/tinguo002/aggbug/416542.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/tinguo002/" target="_blank">一堣而安</a> 2014-08-04 18:38 <a href="http://www.blogjava.net/tinguo002/archive/2014/08/04/416542.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>