﻿<?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-东方未名-随笔分类-&lt;img src="http://ss.sysu.edu.cn/bbs/UploadFile/2006-11/2006112914395848909.gif"&gt;&lt;/img&gt;</title><link>http://www.blogjava.net/richardeee/category/17650.html</link><description>&lt;img src="http://services.nexodyne.com/email/icon/WphmJp1ivTWmlg%3D%3D/J8X3iEc%3D/R01haWw%3D/0/image.png
" /&gt;&lt;br/&gt;&lt;img src="http://services.nexodyne.com/email/icon/vFcOyMOJoEGHLQ%3D%3D/ZoYsaEY%3D/SG90bWFpbA%3D%3D/0/image.png
" /&gt;</description><language>zh-cn</language><lastBuildDate>Tue, 25 Dec 2007 18:40:59 GMT</lastBuildDate><pubDate>Tue, 25 Dec 2007 18:40:59 GMT</pubDate><ttl>60</ttl><item><title>[转]java面试笔试题整理 </title><link>http://www.blogjava.net/richardeee/archive/2007/12/25/170202.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Mon, 24 Dec 2007 23:14:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2007/12/25/170202.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/170202.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2007/12/25/170202.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/170202.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/170202.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: JAVA相关基础知识1、面向对象的特征有哪些方面&nbsp;&nbsp; 1.抽象：抽象就是忽略一个主题中与当前目标无关的那些方面，以便更充分地注意与当前目标有关的方面。抽象并不打算了解全部问题，而只是选择其中的一部分，暂时不用部分细节。抽象包括两个方面，一是过程抽象，二是数据抽象。2.继承：继承是一种联结类的层次模型，并且允许和鼓励类的重用，它提供了一种明确表述共性的方法...&nbsp;&nbsp;<a href='http://www.blogjava.net/richardeee/archive/2007/12/25/170202.html'>阅读全文</a><img src ="http://www.blogjava.net/richardeee/aggbug/170202.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2007-12-25 07:14 <a href="http://www.blogjava.net/richardeee/archive/2007/12/25/170202.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用Hessian开发C/S模式的小系统</title><link>http://www.blogjava.net/richardeee/archive/2007/07/28/132940.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Sat, 28 Jul 2007 02:48:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2007/07/28/132940.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/132940.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2007/07/28/132940.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/132940.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/132940.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 使用Hessian开发C/S模式的小系统<br>之所以叫小系统，主要是因为Hessian不支持Hibernate的延迟加载，所以需要在DAO层使用Hibernate的同学请注意了。<br><br>Hessian其实是一种RMI技术，已经被集成在Spring Framework中，这样就很方便了。<br><br>首先看客户端<br><br>第一步：<br>先定义Client与Server交互的接口。&nbsp;&nbsp;<a href='http://www.blogjava.net/richardeee/archive/2007/07/28/132940.html'>阅读全文</a><img src ="http://www.blogjava.net/richardeee/aggbug/132940.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2007-07-28 10:48 <a href="http://www.blogjava.net/richardeee/archive/2007/07/28/132940.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Which Programming Lanuguage Are You?</title><link>http://www.blogjava.net/richardeee/archive/2007/05/07/115678.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Mon, 07 May 2007 04:09:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2007/05/07/115678.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/115678.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2007/05/07/115678.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/115678.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/115678.html</trackback:ping><description><![CDATA[Another Quiz : " Which Programming Language Are You?"<br><br><a href="http://www.bbspot.com/News/2006/08/language_quiz.php">http://www.bbspot.com/News/2006/08/language_quiz.php</a><a href="http://www.bbspot.com/News/2006/08/language_quiz.php"><br><br><img height=90 alt="You are Java.  You are very strong and sturdy, but this makes you a bit sluggish." src="http://www.bbspot.com/Images/News_Features/2006/08/language/java.jpg" width=300 border=0><br></a>
<img src ="http://www.blogjava.net/richardeee/aggbug/115678.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2007-05-07 12:09 <a href="http://www.blogjava.net/richardeee/archive/2007/05/07/115678.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>遗传算法示例程序</title><link>http://www.blogjava.net/richardeee/archive/2007/04/29/114536.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Sun, 29 Apr 2007 04:11:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2007/04/29/114536.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/114536.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2007/04/29/114536.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/114536.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/114536.html</trackback:ping><description><![CDATA[<p>基于求函数f(x,y,z)=xyz*sin(xyz)最大值问题的演示程序：<br><br><br>截图：<br><font style="BACKGROUND-COLOR: #f4f4f4"><img alt="" src="http://ss.sysu.edu.cn/bbs/UploadFile/2007-4/20074291263871952.jpg" border=0><br><br><img alt="" src="http://ss.sysu.edu.cn/bbs/UploadFile/2007-4/20074291264387602.jpg" border=0><br><br><img alt="" src="http://ss.sysu.edu.cn/bbs/UploadFile/2007-4/20074291264848486.jpg" border=0><br><br><br><br></font><img alt="" src="http://ss.sysu.edu.cn/bbs/UploadFile/2007-4/200742916291423361.jpg" border=0>&nbsp;<br><br>压缩包：<br><a href="http://www.blogjava.net/Files/richardeee/genetic_algorithm.part1.rar">genetic_algorithm.part1.rar</a><br><a href="http://www.blogjava.net/Files/richardeee/genetic_algorithm.part2.rar">genetic_algorithm.part2.rar</a><br><a href="http://www.blogjava.net/Files/richardeee/genetic_algorithm.part3.rar">genetic_algorithm.part3.rar</a><br><a href="http://www.blogjava.net/Files/richardeee/genetic_algorithm.part4.rar">genetic_algorithm.part4.rar</a><br><br>运行方法：<br>解压后在命令行输入：java -jar genetic_algorithm.jar</p>
<img src ="http://www.blogjava.net/richardeee/aggbug/114536.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2007-04-29 12:11 <a href="http://www.blogjava.net/richardeee/archive/2007/04/29/114536.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用遗传算法求解函数 xyz*sin(xyz)的最大值</title><link>http://www.blogjava.net/richardeee/archive/2007/04/26/113912.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Thu, 26 Apr 2007 13:41:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2007/04/26/113912.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/113912.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2007/04/26/113912.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/113912.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/113912.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 最近学习遗传算法，写了这么一个小程序来计算函数 f(x,y,z) = xyz*sin(xyz)的最大值，这段程序经过小小改变就可以适应其他的函数最大值求解问题首先介绍一下遗传算法，遗传算法就是模拟自然界中物竞天择，适者生存的法则，通过对解空间进行进化从而求得最优方案的方法，遗传算法的好处在于，即使算法中的某些参数不起作用了，整个算法还是可以正常地工作，也就是说，整体种群的走向是越来越好的遗传算法的...&nbsp;&nbsp;<a href='http://www.blogjava.net/richardeee/archive/2007/04/26/113912.html'>阅读全文</a><img src ="http://www.blogjava.net/richardeee/aggbug/113912.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2007-04-26 21:41 <a href="http://www.blogjava.net/richardeee/archive/2007/04/26/113912.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>利用JNI调用C/C++方法实现从控制台输入密码</title><link>http://www.blogjava.net/richardeee/archive/2007/02/24/100484.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Sat, 24 Feb 2007 14:06:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2007/02/24/100484.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/100484.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2007/02/24/100484.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/100484.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/100484.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 用Java从控制台输入密码<br><br>本来以为是很简单的问题，查了一下发现Java居然没提供这样一个方法。目前实现的方式有2个，一个是利用JNI来调用C/C++方法，另一个是使用多线程。<br>本文使用JNI调用C/C++的方法实现&nbsp;&nbsp;<a href='http://www.blogjava.net/richardeee/archive/2007/02/24/100484.html'>阅读全文</a><img src ="http://www.blogjava.net/richardeee/aggbug/100484.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2007-02-24 22:06 <a href="http://www.blogjava.net/richardeee/archive/2007/02/24/100484.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]JDK1.6.0新特性详解与代码示例</title><link>http://www.blogjava.net/richardeee/archive/2007/02/09/98968.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Fri, 09 Feb 2007 04:00:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2007/02/09/98968.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/98968.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2007/02/09/98968.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/98968.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/98968.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: JDK6.0发布有段时间了，新的JDK也有不少新的特性，我去网上搜集了一下，列在下面和大家一起学习．１．Desktop和SystemTray. 在JDK6中 ,AWT新增加了两个类:Desktop和SystemTray,前者可以用来打开系统默认浏览器浏览指定的URL,打开系统默认邮件客户端给指定的邮箱发邮件,用默认应用程序打开或编辑文件(比如,用记事本打开以txt为后缀名的文件),用系统默认的打印...&nbsp;&nbsp;<a href='http://www.blogjava.net/richardeee/archive/2007/02/09/98968.html'>阅读全文</a><img src ="http://www.blogjava.net/richardeee/aggbug/98968.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2007-02-09 12:00 <a href="http://www.blogjava.net/richardeee/archive/2007/02/09/98968.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ContextLoaderListener 出错解决办法</title><link>http://www.blogjava.net/richardeee/archive/2007/02/03/97703.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Sat, 03 Feb 2007 01:33:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2007/02/03/97703.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/97703.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2007/02/03/97703.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/97703.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/97703.html</trackback:ping><description><![CDATA[
		<p>这几天突然遇到了一个问题：Tomcat跑不起来了！提示错误信息：<br />Error Listener Start<br />org.springframework.web.context.ContextLoaderListener<br />Error Listener Start<br />....<br />就这么2行，让人一头雾水。昨天检查了一个下午也没发现问题。今天突然在查看错误日志时发现：<br />Context initialization failed</p>
		<p>org.springframework.beans.factory.BeanDefinitionStoreException: Line 14 in XML document from ServletContext resource [/WEB-INF/springctx-datareport.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Element type "bean" must be followed by either attribute specifications, "&gt;" or "/&gt;".<br /><br />仔细查看了一下配置文件，原来是同组的组员在写配置文件的时候在class="...."后面多了一个引号！<br />这个Listener Start的问题太隐蔽，如果没有做错误日志估计一直很难发现了<br />不过这次有了教训，以后也有方向了</p>
<img src ="http://www.blogjava.net/richardeee/aggbug/97703.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2007-02-03 09:33 <a href="http://www.blogjava.net/richardeee/archive/2007/02/03/97703.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Javascript噩梦－Ajax实现输入提示的调整与配置</title><link>http://www.blogjava.net/richardeee/archive/2007/02/01/97380.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Thu, 01 Feb 2007 14:39:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2007/02/01/97380.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/97380.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2007/02/01/97380.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/97380.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/97380.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 根据Ajax in Action书进行调整，修改了原书上的错误，调试通过。<br>可重用的Ajax输入提示类，功能类似Google的输入提示&nbsp;&nbsp;<a href='http://www.blogjava.net/richardeee/archive/2007/02/01/97380.html'>阅读全文</a><img src ="http://www.blogjava.net/richardeee/aggbug/97380.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2007-02-01 22:39 <a href="http://www.blogjava.net/richardeee/archive/2007/02/01/97380.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>又谈乱码问题解决</title><link>http://www.blogjava.net/richardeee/archive/2007/01/23/Chinese_encoding_problem_for_all.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Tue, 23 Jan 2007 13:12:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2007/01/23/Chinese_encoding_problem_for_all.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/95604.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2007/01/23/Chinese_encoding_problem_for_all.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/95604.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/95604.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: JSP与Tomcat乱码解决方法&nbsp;&nbsp;<a href='http://www.blogjava.net/richardeee/archive/2007/01/23/Chinese_encoding_problem_for_all.html'>阅读全文</a><img src ="http://www.blogjava.net/richardeee/aggbug/95604.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2007-01-23 21:12 <a href="http://www.blogjava.net/richardeee/archive/2007/01/23/Chinese_encoding_problem_for_all.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转帖]struts,ajax乱码解决方案 </title><link>http://www.blogjava.net/richardeee/archive/2006/12/11/86831.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Mon, 11 Dec 2006 03:04:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2006/12/11/86831.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/86831.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2006/12/11/86831.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/86831.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/86831.html</trackback:ping><description><![CDATA[
		<p>
				<font size="2">原帖地址:<br /><a href="/errorfun/archive/2006/12/09/86584.html?Pending=true#Post">http://www.blogjava.net/errorfun/archive/2006/12/09/86584.html</a><br />乱码问题好像跟我们中国程序员特别有缘，一直困扰着我们，从开始的<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">JSP</span><span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana"><font face="宋体">乱码问题，</font></span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">STRUTS</span><span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana"><font face="宋体">乱码问题，到现在的</font></span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">AJAX</span><span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana"><font face="宋体">乱码问题，无一不是搞得许多程序员焦头烂额的，整天骂</font></span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">XXX</span><span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana"><font face="宋体">产品对中文支持不了，UTF-8无法使用中文啊什么的，其实这里面被骂的产品中其实</font></span><span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">99</span><span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana"><font face="宋体">％以上是对中文支持非常好的，而出现乱码的原因只是因为自身对国际化支持以及文件编码等信息的认识不知造成的。要知道一个产品那么流行，怎么可能对中文支持不了呢，下面就开始一一帮大家解决这些问题。</font></span></font>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
						<br />
						<br />1</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">、编码</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
						<br />      －－</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">想要解决好中文问题，对编码肯定是不能一概不懂了，编码是解决中文乱码问题的根本。</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
						<br />      </span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">编码比较常用的有：</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">UTF-8</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">，</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">GBK</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">，</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">GB2312</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">，</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">ISO-8859-1</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">，除了</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">iso-8859-1</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">之外的其它三个编码都能很好的支持中文，但它们都兼容</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">ISO-8859-1</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">的编码（就是说无论编码怎么改变，只要是</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">ISO-8859-1</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">中的字符，永远不会出现乱码）。</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
						<br />      </span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">这四种编码中，</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">GB2312</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">是中国规定的汉字编码，也可以说是简体中文的字符集编码</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">;</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">GBK </span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">是</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">GB2312</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">的扩展</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">,</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">除了兼容</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">GB2312</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">外，它还能显示繁体中文，还有日文的假名</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">;</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">而</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">UTF-8</span>
				<font face="宋体">
						<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">虽然也支持中文，但却</span>
						<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">与</span>
				</font>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">GB</span>
				<font face="宋体">
						<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">码不兼容（编码值不同）</span>
						<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">。</span>
				</font>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">UTF-8</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">使用的是可变长的</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">UNICODE</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">编码，编码可能是</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">1</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">位</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">16</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">进制（即</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">ISO-8859-1</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">中的字符，其编码也是相同的）也有可能是</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">2</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">位或</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">3</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">位的</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">16</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana">
						<font face="宋体">进制。</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">UTF-8</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">的优点是：</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">1</span>
				<font face="宋体">
						<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">、</span>
						<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">与</span>
				</font>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">CPU</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">字节顺序无关</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">, </span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">可以在不同平台之间交流。</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">2</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">、容错能力高</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">, </span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">任何一个字节损坏后</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">, </span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">最多只会导致一个编码码位损失</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">, </span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">不会链锁错误</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">(</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">如</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">GB</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">码错一个字节就会整行乱码</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">)</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">，所以在国际化处理中基本都是建议使用</font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">UTF-8</span>
				<span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'">
						<font face="宋体">作为编码。<br /></font>
				</span>
				<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana">
						<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?>
						<o:p>
								<br />2、文件的编码<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><br />      －－虽然说只要设置了正确的编码就可以使字符正确显示了，但如果忽略了文件保存时的编码的话，那可是会让你走进迷雾中的。<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><br />      文件编码最常使用的有两种：ANSI和UTF-8，光看名字估计你都可以猜到了，ANSI就是我们保存文件时使用的默认编码，而UTF-8则需自己设置。对于编码的改变，我使用的工具是NOTEPAD和ECLIPSE，NOTEPAD使用最简单，只要打开文件后在另存为中选择相应的编码就行了，而且它对编码的支持非常好;而在ECLIPSE中，只要稍微设置一下就行了，打开首选项，然后选择：常规-&gt;内容类型(ContentType)，在右边选中你想改变保存编码的文件类型，然后在下方的缺省编码中改变其值，最后点击更新（UPDATE）按钮即可。<br /></span></span></o:p>
				</span>
		</p>
		<p align="center">
				<img src="http://errorfun.bokee.com/inc/eclipse.png" />
		</p>
		<p align="left">
				<br />
				<br />而在其它的编辑器中，默认保存的内容都是GB2312或者GBK（NOTEPAD中对应ANSI）.而根据前面所说的UTF-8和GBK,GB2312等的编码值是不同的这一点，可以知道，如果文件使用了UTF-8，那么字符编码就必须使用UTF-8，否则编码值的不同就可能造成乱码。而这也就是为什么那么多的人使用了UTF-8编码后还会产生乱码的根本原因。（JS和JSP都是这个道理）<br /><br />3、JSP,STRUTS等的中文乱码解决方案<span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana"><br />     其实解决的方法只有一个：</span><span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana"><font face="宋体"></font></span></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #000000"> request.setCharacterEncoding(encoding);</span>
		</div>
		<p align="left">   方法只有一种，但处理方式就多种多样了，初学者会在JSP页面上直接使用，而有经验的程序员会使用过滤器。而现在所要说的方法也是过滤器。这里以统一使用UTF-8作为编码作为例子说明。具体过程就不多说了，网上有很多教程。偷懒一点的，到TOMCAT中复制就行了。在TOMCAT的目录下的\webapps\jsp-examples\WEB-INF\classes\filters\找到SetCharacterEncodingFilter.java 这个类，放到你的程序中并配置好映射路径。配置好后基本上你的乱码问题就解决了。但要映射路径中需要注意的就是不能使用 '*'</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #000000">  </span>
				<span style="COLOR: #0000ff">&lt;</span>
				<span style="COLOR: #800000">filter-mapping</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span>
				<span style="COLOR: #0000ff">&lt;</span>
				<span style="COLOR: #800000">filter-name</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">Set Character Encoding</span>
				<span style="COLOR: #0000ff">&lt;/</span>
				<span style="COLOR: #800000">filter-name</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    </span>
				<span style="COLOR: #0000ff">&lt;</span>
				<span style="COLOR: #800000">servlet-name</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">*</span>
				<span style="COLOR: #0000ff">&lt;/</span>
				<span style="COLOR: #800000">servlet-name</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />  </span>
				<span style="COLOR: #0000ff">&lt;/</span>
				<span style="COLOR: #800000">filter-mapping</span>
				<span style="COLOR: #0000ff">&gt;</span>
		</div>
		<p align="left">像上面这样配置的话(可能也是网上大多教程的做法，想当年也是害苦了我)，可能你只有JSP的乱码解决了，要解决STRUTS的乱码需要映射 *.do 或者 servletActionName。然后在初始化参数中设置encoding的值就行了。</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #0000ff">&lt;</span>
				<span style="COLOR: #800000">init-param</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span>
				<span style="COLOR: #0000ff">&lt;</span>
				<span style="COLOR: #800000">param-name</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">encoding</span>
				<span style="COLOR: #0000ff">&lt;/</span>
				<span style="COLOR: #800000">param-name</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />      </span>
				<span style="COLOR: #0000ff">&lt;</span>
				<span style="COLOR: #800000">param-value</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">UTF-8</span>
				<span style="COLOR: #0000ff">&lt;/</span>
				<span style="COLOR: #800000">param-value</span>
				<span style="COLOR: #0000ff">&gt;</span>
				<span style="COLOR: #000000">
						<br />
						<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				</span>
				<span style="COLOR: #0000ff">&lt;/</span>
				<span style="COLOR: #800000">init-param</span>
				<span style="COLOR: #0000ff">&gt;</span>
		</div>
		<p align="left">当然，最重要的是要记得根据前面所说的方法，改变你所使用的编辑器保存文件的编码要与使用的字符编码一致。<br />而在JSP内容中，还是使用如网上教程所说的那种技俩，在所有页面的页首加入：</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #808080">&lt;%</span>
				<span style="COLOR: #000000">@ page language</span>
				<span style="COLOR: #808080">=</span>
				<span style="COLOR: #000000">"java" contentType</span>
				<span style="COLOR: #808080">=</span>
				<span style="COLOR: #000000">"</span>
				<span style="FONT-WEIGHT: bold; COLOR: #000000">text</span>
				<span style="COLOR: #808080">/</span>
				<span style="COLOR: #000000">html; charset</span>
				<span style="COLOR: #808080">=</span>
				<span style="COLOR: #000000">UTF</span>
				<span style="COLOR: #808080">-</span>
				<span style="FONT-WEIGHT: bold; COLOR: #800000">8</span>
				<span style="COLOR: #000000">"<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />    pageEncoding</span>
				<span style="COLOR: #808080">=</span>
				<span style="COLOR: #000000">"UTF</span>
				<span style="COLOR: #808080">-</span>
				<span style="FONT-WEIGHT: bold; COLOR: #800000">8</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #808080">%&gt;</span>
		</div>
		<br />至此，相信JSP,ACTION都不太可能出现乱码了。<br /><br />4、资源文件的乱码解决方案<br />      资源文件谁都知道是国际化支持不可或缺的一部分，如果资源文件都出现乱码了那还了得？其实资源文件的乱码是很好解决的，其原因也是因为使用了UTF-8做为JSP编码后，没有相应地改变资源文件的文件编码造成的，所以只要对资源文件保存的编码进行更正后，乱码问题也就解决了。当然，你的中文要使用 native2ascii 命令进行正确的转换。<br /><br />5、调用JS时，JS内容乱码的解决方案。<br />     其实JS的乱码还是跟文件的编码有关系的，如果JS中有中文的话，那JS文件保存的编码就必须跟调用此JS的页面编码相同，否则，你的所有中文都要从JSP页面传给JS才会显示正常。可以看出对于调用JS出现的乱码是最容易解决的（也是建立在前面的辛苦之下的）。<br /><br />6、AJAX提交数据乱码，返回数据乱码的解决方案<br />     随着AJAX的流行，乱码问题也开始困扰着许多刚开始使用它的程序员，幸好我之前对JSP乱码有过一点研究，在遇到AJAX后，并没有给我带来多大的困扰，在此将我的一些心得共享给大家。<br />     万变不离其宗，AJAX的乱码问题自然跟编码有关了，其实很多人跟我一样想到了对文件编码进行设置，并且在接数据时设置了requet的编码，在返回的数据时设置了response的编码一切都以为会很顺利，可是这一切都是徒劳无功的，讨厌的乱码再一次出现在你眼前。在你试了N多种方法，包括JS自身的escape,unescape方法后，你发现乱码仍然猖狂地出现在屏幕上。<br />    其实在试过这N多方法后，很多人都没发现，解决的方法其实很简单，而且其答案就在我们之前处理的JSP乱码之中。让我们先看一下AJAX的经典请求代码<br /><span style="FONT-SIZE: 10pt; mso-ascii-font-family: Verdana; mso-hansi-font-family: Verdana"><font face="宋体"><p></p><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><font size="2"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">xmlhttp.open( </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">post</span><span style="COLOR: #000000">"</span></font><font size="2"><span style="COLOR: #000000">, url, async );<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />xmlhttp.setRequestHeader( </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Content-Type</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">text/html</span><span style="COLOR: #000000">"</span></font><span style="COLOR: #000000"><font size="2"> );<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />xmlhttp.send( params );</font></span></div><br />通过前面的说明，不知道你现在看出端倪了没有。不知道是受了网上教程的影响还是其它方面影响，setRequestHeader并是万年不变的，也没人想过去改它，而问题就正好出在这个地方。回想一个JSP页面内容的编码设置，其中有这么一节： 
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><font size="2"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">contentType</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">text/html; charset=UTF-8</span><span style="COLOR: #000000">"</span></font></div><br />现在知道问题了吧，所以我们要把第二句代码改为： 
<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><font size="2"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">xmlhttp.setRequestHeader( </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Content-Type</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">, </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">text/html;charset=UTF-8</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> );<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span></font></div></font></span><font size="2"><br /><font face="Verdana">最后别忘了在返回数据时也设置上： </font><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><font face="Verdana"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></font><span style="COLOR: #000000">response.setContentType( </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">text/xml</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> );<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />response.setCharacterEncoding( </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">UTF-8</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> );</span></div><br />是不是很简单，一点都不麻烦呢？<br />如果要问为什么的话，其实我们可以把xmlhttp看成是一个临时页面，它由浏览器动态生成，主要作用是在后台获得请求的数据（可以看成是一个高级的iframe）。所以对于普通页面设置的编码，对它也要同样设置。而在servlet中返回数据为什么要设置contentType和encoding其道理也是一样的。众所周知，jsp的最后形态就是servlet，而jsp页首设置的那个内容其实也就是让生成的servlet中生成这么两句话：<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">response.setContentType( </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">text/html</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> );<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />response.setCharacterEncoding( </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">UTF-8</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000"> );</span></div><br />而pageEncoding则是跟jvm说明了这个页面的内容要使用什么编码保存（这跟之后生成的CLASS有关系）。所以在servlet设置response的编码也是理所当然的了。<br /><br />一口气把自己一年以来遇到的乱码问题和解决的方案写出来了，希望对你有所帮助。</font><img src ="http://www.blogjava.net/richardeee/aggbug/86831.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2006-12-11 11:04 <a href="http://www.blogjava.net/richardeee/archive/2006/12/11/86831.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]解析Java对象引用与JVM自动内存管理</title><link>http://www.blogjava.net/richardeee/archive/2006/11/29/84340.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Wed, 29 Nov 2006 06:08:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2006/11/29/84340.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/84340.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2006/11/29/84340.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/84340.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/84340.html</trackback:ping><description><![CDATA[
		<p>Java基础知识,打好基础才能更好地学习!<br />原帖地址:http://www.linuxmine.com/44702.html<br /><font color="#333333">对象引用应用程序设计接口是JDKTM1.2中新定义的。该应用程序设计接口允许应用程序以对象引用的方式与JVM的内存管理器进行交互。当应用程序需管理大量内存对象或者在新的Java对象创建之前需删除原有对象时，Java对象引用应用程序设计接口具有相当大的用途，例如： <br />　　<br />　　● 基于Web的应用程序常常要求显示大量图片，当用户离开某一Web页时，往往不能确定是否能够顺利的返回。在这种程序中，应用Java对象引用API可以创建这样一个环境，即当堆内存以最小程度运行时，内存管理器创建对象。当用户返回时，应用程序就会重新载入已经创建的图片。 <br />　　<br />　　● 应用对象引用队列可以创建这样一个环境，当通过对象引用获得某一对象时，应用程序得到通知。然后，应用程序就可以对相关对象进行清除操作，同时使这些对象在内存管理器中合法化。 <br />　　<br />　　内存管理器的工作机制<br />　　<br />　　下面将首先介绍未嵌入引用对象时内存管理器的工作机制，然后讨论引用对象加入之后Java堆发生的变化。 <br />　　<br />　　内存管理器的作用就是识别程序中不再使用的对象，并且回收其内存。 <br />　　<br />　　一个Java应用程序由一系列线程组成，每个线程执行一系列方法，而每个方法通过参数或局部变量来引用对象。这些引用属于引用集合中的一部分，直接进入应用程序。另外，引用集合中还包括类库中定义的静态引用变量，以及通过Java本地接口（JNI）API获得的引用。引用集合中的所有引用对象都可以被当前应用程序获取，而不必被回收。同样地，这些对象可能包含对其它对象的引用，也可以被应用程序获取，依此类推。Java堆中的其它对象视为不可获取的，而所有这些不可获取的对象在内存管理中也是合法的。如果一个不可获取的对象使用finalize()方法，任务就交给了对象所调用的收尾器（finalizer）。在内存回收期间，不具有收尾器的不可获取对象和已经调用收尾器的对象被简单回收。 <br />　　<br />　　内存回收的算法是不断变化的，共性的方面是从引用集合中识别可获取的对象以及回收被其它对象占据的内存空间。 <br />　　<br />　　加入引用对象之后的引用与常规引用的区别在于，引用对象中的引用专门由内存管理器来处理。引用对象封装了其它一些对象的引用，我们称之为指示对象。在引用对象创建的同时，也就定义了该引用对象的指示对象。 <br />　　<br />　　Java对象引用<br />　　<br />　　图１所示为对象引用应用程序设计接口中定义的类层次。其中SoftReference类、WeakReference类和PhantomReference类中分别定义了三种引用对象以及相应的三种获取对象的能力。因此按照由强到弱，对象可获取程度可划分为如下五种类型：强获取（strongly reachable）、次获取（softly reachable）、弱获取（weakly reachable）、虚获取（phantomly reachable）和不可获取（unreachable）。 <br />　　　<img src="http://www.linuxmine.com/imgfiles/2002.11.25.17.9.24.1.gif" /><br />　　图1 对象应用类层次<br />　　<br />　　根据应用程序要求，对象可以是强引用（strong references）、次引用（soft references）、弱引用（weak references）、虚引用（phantom references）的任意组合。为了确定对象的可获取程度，JVM内存管理器从引用集合出发遍寻堆中所有到对象的路径。当到达某对象的任意路径都不含有引用对象时，则称该对象具有强获取能力；当路径中含有一个或几个引用对象时，根据内存管理器所查询的引用对象的类型分别归为次获取、弱获取、虚获取。 <br />　　<br />　　另外，对象引用API中还定义了引用对象队列（java.lang.ref.ReferenceQueue），这是内存管理器对引用对象进行管理的一种简单数据结构。值得注意的是，在进行引用对象定义时，要求phantom reference对象必须产生于一个引用对象队列，而soft reference和weak reference对象则无此限制，如： <br />　　<br />　　</font></p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #000000">ReferenceQueue queue </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">new</span>
				<span style="COLOR: #000000"> ReferenceQueue();<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />　　PhantomReference pr </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">new</span>
				<span style="COLOR: #000000"> PhantomReference(object, queue);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span>
		</div>
		<p>　　Soft References 应用实例<br />　　<br />　　下面以在基于web的应用程序中使用soft references为例，来说明Java对象引用与JVM的内存管理器进行交互的原理。 <br />　　<br />　　当用户打开某一web页时，applet代码获得图片并且得到显示。如果在代码中同时创建了该图片对象的soft references，那么当用户离开该web页时，内存管理器对图片所分配的内存是否回收做出选择。当用户返回该web页时，在applet代码中使用SoftReference.get方法就会得到图片才内存中是否仍存在的消息。如果在内存管理器中未创建该图片，在web页上会很快得到显示；否则，applet代码就会重新获取。 <br />　　<br />　　下面是Example.java的完整源代码。 <br />　　<br />　　</p>
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />
				<span style="COLOR: #0000ff">import</span>
				<span style="COLOR: #000000"> java.awt.Graphics;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />　　</span>
				<span style="COLOR: #0000ff">import</span>
				<span style="COLOR: #000000"> java.awt.Image;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />　　</span>
				<span style="COLOR: #0000ff">import</span>
				<span style="COLOR: #000000"> java.applet.Applet;<br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />　　</span>
				<span style="COLOR: #0000ff">import</span>
				<span style="COLOR: #000000"> java.lang.ref.SoftReference;<br /><img id="Codehighlighter1_156_850_Open_Image" onclick="this.style.display='none'; Codehighlighter1_156_850_Open_Text.style.display='none'; Codehighlighter1_156_850_Closed_Image.style.display='inline'; Codehighlighter1_156_850_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_156_850_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_156_850_Closed_Text.style.display='none'; Codehighlighter1_156_850_Open_Image.style.display='inline'; Codehighlighter1_156_850_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" />　　</span>
				<span style="COLOR: #0000ff">public</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #0000ff">class</span>
				<span style="COLOR: #000000"> Example </span>
				<span style="COLOR: #0000ff">extends</span>
				<span style="COLOR: #000000"> Applet </span>
				<span id="Codehighlighter1_156_850_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
						<img src="http://www.blogjava.net/images/dot.gif" />
				</span>
				<span id="Codehighlighter1_156_850_Open_Text">
						<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　SoftReference sr </span>
						<span style="COLOR: #000000">=</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">null</span>
						<span style="COLOR: #000000">;<br /><img id="Codehighlighter1_210_258_Open_Image" onclick="this.style.display='none'; Codehighlighter1_210_258_Open_Text.style.display='none'; Codehighlighter1_210_258_Closed_Image.style.display='inline'; Codehighlighter1_210_258_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_210_258_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_210_258_Closed_Text.style.display='none'; Codehighlighter1_210_258_Open_Image.style.display='inline'; Codehighlighter1_210_258_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />　　　　</span>
						<span style="COLOR: #0000ff">public</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">void</span>
						<span style="COLOR: #000000"> init() </span>
						<span id="Codehighlighter1_210_258_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
								<img src="http://www.blogjava.net/images/dot.gif" />
						</span>
						<span id="Codehighlighter1_210_258_Open_Text">
								<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　　System.out.println(</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">Initializing</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />　　　　}</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img id="Codehighlighter1_294_701_Open_Image" onclick="this.style.display='none'; Codehighlighter1_294_701_Open_Text.style.display='none'; Codehighlighter1_294_701_Closed_Image.style.display='inline'; Codehighlighter1_294_701_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" />
								<img id="Codehighlighter1_294_701_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_294_701_Closed_Text.style.display='none'; Codehighlighter1_294_701_Open_Image.style.display='inline'; Codehighlighter1_294_701_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />　　　　</span>
						<span style="COLOR: #0000ff">public</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">void</span>
						<span style="COLOR: #000000"> paint(Graphics g) </span>
						<span id="Codehighlighter1_294_701_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
								<img src="http://www.blogjava.net/images/dot.gif" />
						</span>
						<span id="Codehighlighter1_294_701_Open_Text">
								<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　　Image im </span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000"> (sr </span>
								<span style="COLOR: #000000">==</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">null</span>
								<span style="COLOR: #000000">) </span>
								<span style="COLOR: #000000">?</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">null</span>
								<span style="COLOR: #000000"> : (Image)(sr.get());<br /><img id="Codehighlighter1_376_518_Open_Image" onclick="this.style.display='none'; Codehighlighter1_376_518_Open_Text.style.display='none'; Codehighlighter1_376_518_Closed_Image.style.display='inline'; Codehighlighter1_376_518_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_376_518_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_376_518_Closed_Text.style.display='none'; Codehighlighter1_376_518_Open_Image.style.display='inline'; Codehighlighter1_376_518_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />　　　　　　</span>
								<span style="COLOR: #0000ff">if</span>
								<span style="COLOR: #000000"> (im </span>
								<span style="COLOR: #000000">==</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">null</span>
								<span style="COLOR: #000000">) </span>
								<span id="Codehighlighter1_376_518_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
										<img src="http://www.blogjava.net/images/dot.gif" />
								</span>
								<span id="Codehighlighter1_376_518_Open_Text">
										<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　　　　System.out.println(</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">Fetching image</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　　　　im </span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000"> getImage(getCodeBase(),</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">yundong.gif</span>
										<span style="COLOR: #000000">"</span>
										<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　　　　sr </span>
										<span style="COLOR: #000000">=</span>
										<span style="COLOR: #000000"> </span>
										<span style="COLOR: #0000ff">new</span>
										<span style="COLOR: #000000"> SoftReference(im);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />　　　　　 }</span>
								</span>
								<span style="COLOR: #000000">
										<br />
										<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　 System.out.println(</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">Painting</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　 g.drawImage(im, </span>
								<span style="COLOR: #000000">25</span>
								<span style="COLOR: #000000">, </span>
								<span style="COLOR: #000000">25</span>
								<span style="COLOR: #000000">, </span>
								<span style="COLOR: #0000ff">this</span>
								<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　 g.drawString(</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">运动之美</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">,</span>
								<span style="COLOR: #000000">20</span>
								<span style="COLOR: #000000">,</span>
								<span style="COLOR: #000000">20</span>
								<span style="COLOR: #000000">); <br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　im </span>
								<span style="COLOR: #000000">=</span>
								<span style="COLOR: #000000"> </span>
								<span style="COLOR: #0000ff">null</span>
								<span style="COLOR: #000000">;　<br /><img id="Codehighlighter1_651_695_Open_Image" onclick="this.style.display='none'; Codehighlighter1_651_695_Open_Text.style.display='none'; Codehighlighter1_651_695_Closed_Image.style.display='inline'; Codehighlighter1_651_695_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_651_695_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_651_695_Closed_Text.style.display='none'; Codehighlighter1_651_695_Open_Image.style.display='inline'; Codehighlighter1_651_695_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />　　　　</span>
								<span id="Codehighlighter1_651_695_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span>
								<span id="Codehighlighter1_651_695_Open_Text">
										<span style="COLOR: #008000">/*</span>
										<span style="COLOR: #008000"> Clear the strong reference to the image </span>
										<span style="COLOR: #008000">*/</span>
								</span>
								<span style="COLOR: #000000">
										<br />
										<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />　　　　}</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　<br /><img id="Codehighlighter1_730_774_Open_Image" onclick="this.style.display='none'; Codehighlighter1_730_774_Open_Text.style.display='none'; Codehighlighter1_730_774_Closed_Image.style.display='inline'; Codehighlighter1_730_774_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_730_774_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_730_774_Closed_Text.style.display='none'; Codehighlighter1_730_774_Open_Image.style.display='inline'; Codehighlighter1_730_774_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />　　　　</span>
						<span style="COLOR: #0000ff">public</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">void</span>
						<span style="COLOR: #000000"> start() </span>
						<span id="Codehighlighter1_730_774_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
								<img src="http://www.blogjava.net/images/dot.gif" />
						</span>
						<span id="Codehighlighter1_730_774_Open_Text">
								<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　　System.out.println(</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">Starting</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />　　　　}</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　<br /><img id="Codehighlighter1_802_846_Open_Image" onclick="this.style.display='none'; Codehighlighter1_802_846_Open_Text.style.display='none'; Codehighlighter1_802_846_Closed_Image.style.display='inline'; Codehighlighter1_802_846_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_802_846_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_802_846_Closed_Text.style.display='none'; Codehighlighter1_802_846_Open_Image.style.display='inline'; Codehighlighter1_802_846_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />　　　　</span>
						<span style="COLOR: #0000ff">public</span>
						<span style="COLOR: #000000"> </span>
						<span style="COLOR: #0000ff">void</span>
						<span style="COLOR: #000000"> stop() </span>
						<span id="Codehighlighter1_802_846_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">
								<img src="http://www.blogjava.net/images/dot.gif" />
						</span>
						<span id="Codehighlighter1_802_846_Open_Text">
								<span style="COLOR: #000000">{<br /><img src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align="top" />　　　　　　System.out.println(</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">Stopping</span>
								<span style="COLOR: #000000">"</span>
								<span style="COLOR: #000000">);<br /><img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />　　　　}</span>
						</span>
						<span style="COLOR: #000000">
								<br />
								<img src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />　　}</span>
				</span>
		</div>
		<p>
				<br />　　 <br />　　在上面的代码中，对象image是一个图片对象，传递给一个SoftReference对象sr。其中image对象是sr的指示对象，sr中的引用域是从次引用（soft reference）到 image。 <br />　　<br />　　Weak References分析<br />　　<br />　　对于一个稳定的对象，比如说线程类对象，当需要获取外部数据时，在程序中应用weak references是非常理想的。如果利用引用队列创建了某一线程的weak reference，那么当线程不再具有强获取能力时，应用程序得到通知，根据此通知，应用程序才能执行相关数据对象的清除工作。 <br />　　<br />　　当内存管理器未发现strong references 和 soft references 时，我们称对象具有弱获取能力，即在到达该对象的路径中至少包含一个weak reference。程序中weak references被清除一段时间后，弱获取对象被收尾器收集。由此也可以看出，soft reference和weak reference之间的区别在于，应用soft reference时，内存管理器利用算法决定是否创建弱获取对象，而应用weak reference时，内存管理器必须创建次获取对象。 <br />　　<br />　　引用对象链<br />　　<br />　　当到达某一对象的路径中含有多个引用对象时，就构成了引用对象链。内存管理器按照由强到弱的顺序处理引用对象，具体处理步骤包括：Soft references、 Weak references、Finalization、Phantom references和创建对象五个部分。 <br />　　<br />　　当内存管理器未发现前三种对象引用时，我们称对象具有虚获取能力，即在到达该对象的路径中至少包含一个phantom reference。虚引用对象直接被收尾器收集，而不被重新创建。当内存管理器发现只有phantom references时，对象就将处于等候phantom reference状态，应用程序向引用队列发出通知，然后对虚引用对象调用clear()方法，将其引用域设置为null，最后对不可获取对象执行收集清除处理任务。 <br />　　<br />　　通常，对象所具有的获取能力与引用对象集合直接路径中的最弱连接者相同。据此可以看出： <br />　　<br />　　图2（a）中，虚引用对象具有强获取能力，其它对象均具虚获取能力； <br />　　<br />　　（b）中虚引用对象和弱引用对象均具强获取能力，故次引用对象和对象集合具有若获取能力； <br />　　<br />　　（c）中虚引用对象、弱引用对象和次引用对象均具强获取能力，那么对象集合则具次获取能力。<br />　　<img src="http://www.linuxmine.com/imgfiles/2002.11.25.17.9.39.2.gif" />　<br />　　图2 引用对象链<br />　　小结<br />　　● 引用对象API是Java2平台中的特色之一。 <br />　　<br />　　● 在程序中使用引用对象API不但可以在一定程度上控制内存管理器，实现内存自动管理，还可以提高程序的稳定性和安全性。 <br />　　<br />　　● 引用对象链中各个对象的获取能力与整个链相关。</p>
<img src ="http://www.blogjava.net/richardeee/aggbug/84340.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2006-11-29 14:08 <a href="http://www.blogjava.net/richardeee/archive/2006/11/29/84340.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Spring 与Hibernate的延迟加载和Dao模式 [翻译]</title><link>http://www.blogjava.net/richardeee/archive/2006/11/27/83870.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Mon, 27 Nov 2006 12:03:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2006/11/27/83870.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/83870.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2006/11/27/83870.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/83870.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/83870.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Lazy Initialization and the DAO pattern with Hibernate and Spring的翻译,照顾些不喜欢读英文的朋友,请指导&nbsp;&nbsp;<a href='http://www.blogjava.net/richardeee/archive/2006/11/27/83870.html'>阅读全文</a><img src ="http://www.blogjava.net/richardeee/aggbug/83870.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2006-11-27 20:03 <a href="http://www.blogjava.net/richardeee/archive/2006/11/27/83870.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用AOP实现类型安全的泛型DAO</title><link>http://www.blogjava.net/richardeee/archive/2006/11/26/83664.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Sun, 26 Nov 2006 13:08:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2006/11/26/83664.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/83664.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2006/11/26/83664.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/83664.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/83664.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 由于要求在项目中使用泛型的DAO，所以上网Google了一下，找到了IBM的一篇文章。文章讲得不错，但是有些地方不清楚，如果完全按照那篇文章可能还会遇到一些困难。所以写了这篇文章，解释如何在项目中加入泛型的DAO实现。 		首先是总的类关系的UML图:然后是在配置文件中的关系图：  其中，IStaffDao是我们自己定义的接口，这个接口类似：														publ...&nbsp;&nbsp;<a href='http://www.blogjava.net/richardeee/archive/2006/11/26/83664.html'>阅读全文</a><img src ="http://www.blogjava.net/richardeee/aggbug/83664.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2006-11-26 21:08 <a href="http://www.blogjava.net/richardeee/archive/2006/11/26/83664.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>第3篇,尝试使用JDOM</title><link>http://www.blogjava.net/richardeee/archive/2006/11/24/83365.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Fri, 24 Nov 2006 13:10:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2006/11/24/83365.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/83365.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2006/11/24/83365.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/83365.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/83365.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 尝试使用JDOM&nbsp;&nbsp;<a href='http://www.blogjava.net/richardeee/archive/2006/11/24/83365.html'>阅读全文</a><img src ="http://www.blogjava.net/richardeee/aggbug/83365.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2006-11-24 21:10 <a href="http://www.blogjava.net/richardeee/archive/2006/11/24/83365.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>第2篇,Rico</title><link>http://www.blogjava.net/richardeee/archive/2006/11/24/83295.html</link><dc:creator>Zou Ang</dc:creator><author>Zou Ang</author><pubDate>Fri, 24 Nov 2006 08:17:00 GMT</pubDate><guid>http://www.blogjava.net/richardeee/archive/2006/11/24/83295.html</guid><wfw:comment>http://www.blogjava.net/richardeee/comments/83295.html</wfw:comment><comments>http://www.blogjava.net/richardeee/archive/2006/11/24/83295.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/richardeee/comments/commentRss/83295.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/richardeee/services/trackbacks/83295.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 下午尝试使用Rico,实现了渐变和拖拽.主要是比较在意它的效果功能..没太多了解对Ajax的支持.下面是渐变的代码<br>Open Rico:OpenRico.org&nbsp;&nbsp;<a href='http://www.blogjava.net/richardeee/archive/2006/11/24/83295.html'>阅读全文</a><img src ="http://www.blogjava.net/richardeee/aggbug/83295.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/richardeee/" target="_blank">Zou Ang</a> 2006-11-24 16:17 <a href="http://www.blogjava.net/richardeee/archive/2006/11/24/83295.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>