﻿<?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-thinking-最新评论</title><link>http://www.blogjava.net/alinglau36/CommentsRSS.aspx</link><description>one platform thousands thinking</description><language>zh-cn</language><pubDate>Wed, 30 May 2018 10:25:54 GMT</pubDate><lastBuildDate>Wed, 30 May 2018 10:25:54 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: Freemarker操作字符串[未登录]</title><link>http://www.blogjava.net/alinglau36/archive/2015/07/30/344970.html#426509</link><dc:creator>刘</dc:creator><author>刘</author><pubDate>Thu, 30 Jul 2015 03:35:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2015/07/30/344970.html#426509</guid><description><![CDATA[@王力锋<br>挺不错，就是排版有点不好看啊<img src ="http://www.blogjava.net/alinglau36/aggbug/426509.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">刘</a> 2015-07-30 11:35 <a href="http://www.blogjava.net/alinglau36/archive/2015/07/30/344970.html#426509#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Freemarker操作字符串</title><link>http://www.blogjava.net/alinglau36/archive/2014/07/31/344970.html#416410</link><dc:creator>王力锋</dc:creator><author>王力锋</author><pubDate>Thu, 31 Jul 2014 07:38:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2014/07/31/344970.html#416410</guid><description><![CDATA[挺不错的啊！很有帮助的！<img src ="http://www.blogjava.net/alinglau36/aggbug/416410.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">王力锋</a> 2014-07-31 15:38 <a href="http://www.blogjava.net/alinglau36/archive/2014/07/31/344970.html#416410#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>发生大幅杀跌</title><link>http://www.blogjava.net/alinglau36/archive/2013/04/07/344970.html#397463</link><dc:creator>发生大幅</dc:creator><author>发生大幅</author><pubDate>Sun, 07 Apr 2013 07:04:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2013/04/07/344970.html#397463</guid><description><![CDATA[发达省份<img src ="http://www.blogjava.net/alinglau36/aggbug/397463.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">发生大幅</a> 2013-04-07 15:04 <a href="http://www.blogjava.net/alinglau36/archive/2013/04/07/344970.html#397463#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: java模拟并发操作进行压力测试</title><link>http://www.blogjava.net/alinglau36/archive/2012/10/18/322118.html#389791</link><dc:creator>东笑言</dc:creator><author>东笑言</author><pubDate>Thu, 18 Oct 2012 02:20:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2012/10/18/322118.html#389791</guid><description><![CDATA[非常不错，十分感谢你共享的代码。<img src ="http://www.blogjava.net/alinglau36/aggbug/389791.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">东笑言</a> 2012-10-18 10:20 <a href="http://www.blogjava.net/alinglau36/archive/2012/10/18/322118.html#389791#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 语言深入:java中究竟是传值还是传引用</title><link>http://www.blogjava.net/alinglau36/archive/2011/03/07/261747.html#345898</link><dc:creator>lau</dc:creator><author>lau</author><pubDate>Mon, 07 Mar 2011 11:02:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2011/03/07/261747.html#345898</guid><description><![CDATA[这种讲法不够科学，在Nicholas的javascript for web developers中讲得比较科学<img src ="http://www.blogjava.net/alinglau36/aggbug/345898.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">lau</a> 2011-03-07 19:02 <a href="http://www.blogjava.net/alinglau36/archive/2011/03/07/261747.html#345898#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: CSS hack:区分IE6，IE7，firefox</title><link>http://www.blogjava.net/alinglau36/archive/2011/02/12/312528.html#344154</link><dc:creator>lau</dc:creator><author>lau</author><pubDate>Sat, 12 Feb 2011 09:30:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2011/02/12/312528.html#344154</guid><description><![CDATA[{<br><br>   background:orange; /*for all (包括FF)*/<br><br>   background:red\0;  /*for ie8*/<br><br>   *background:green; /*for ie7,ie6*/<br><br>   _background:blue; /*for ie6 ,注意，这个会重写前面*background的样式*/<br><br>}<br><img src ="http://www.blogjava.net/alinglau36/aggbug/344154.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">lau</a> 2011-02-12 17:30 <a href="http://www.blogjava.net/alinglau36/archive/2011/02/12/312528.html#344154#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Web browser hacks, Css hacks - ie, firefox, chrome, safri, Opera</title><link>http://www.blogjava.net/alinglau36/archive/2011/02/12/312518.html#344138</link><dc:creator>lau</dc:creator><author>lau</author><pubDate>Sat, 12 Feb 2011 07:09:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2011/02/12/312518.html#344138</guid><description><![CDATA[<a href="http://shishi11.javaeye.com/blog/840719" target="_new">http://shishi11.javaeye.com/blog/840719</a><img src ="http://www.blogjava.net/alinglau36/aggbug/344138.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">lau</a> 2011-02-12 15:09 <a href="http://www.blogjava.net/alinglau36/archive/2011/02/12/312518.html#344138#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 你不知道的 JavaScript - “this”</title><link>http://www.blogjava.net/alinglau36/archive/2011/02/09/344000.html#344003</link><dc:creator>lau</dc:creator><author>lau</author><pubDate>Wed, 09 Feb 2011 15:46:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2011/02/09/344000.html#344003</guid><description><![CDATA[<a href="http://www.quirksmode.org/js/this.html" target="_new">http://www.quirksmode.org/js/this.html</a><img src ="http://www.blogjava.net/alinglau36/aggbug/344003.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">lau</a> 2011-02-09 23:46 <a href="http://www.blogjava.net/alinglau36/archive/2011/02/09/344000.html#344003#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: YAHOO.util.Dom之寻找节点(转)</title><link>http://www.blogjava.net/alinglau36/archive/2011/02/01/343835.html#343836</link><dc:creator>lau</dc:creator><author>lau</author><pubDate>Tue, 01 Feb 2011 00:56:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2011/02/01/343835.html#343836</guid><description><![CDATA[<a href="http://blog.csdn.net/ilibaba/archive/2009/06/07/4248932.aspx" target="_new">http://blog.csdn.net/ilibaba/archive/2009/06/07/4248932.aspx</a><br><br> JavaScript(YUI)扫盲<img src ="http://www.blogjava.net/alinglau36/aggbug/343836.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">lau</a> 2011-02-01 08:56 <a href="http://www.blogjava.net/alinglau36/archive/2011/02/01/343835.html#343836#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: CSS hack:区分IE6，IE7，firefox</title><link>http://www.blogjava.net/alinglau36/archive/2011/01/31/312528.html#343808</link><dc:creator>lau</dc:creator><author>lau</author><pubDate>Mon, 31 Jan 2011 06:05:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2011/01/31/312528.html#343808</guid><description><![CDATA[*对IE8不起作用<img src ="http://www.blogjava.net/alinglau36/aggbug/343808.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">lau</a> 2011-01-31 14:05 <a href="http://www.blogjava.net/alinglau36/archive/2011/01/31/312528.html#343808#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 如何避免在Java中使用Checked Exception</title><link>http://www.blogjava.net/alinglau36/archive/2010/11/15/255045.html#338123</link><dc:creator>lau</dc:creator><author>lau</author><pubDate>Mon, 15 Nov 2010 10:43:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2010/11/15/255045.html#338123</guid><description><![CDATA[Java里有个很重要的特色是Exception ，也就是说允许程序产生例外状况。而在学Java 的时候，我们也只知道Exception 的写法，却未必真能了解不同种类的Exception 的区别。<br><br>　　首先，您应该知道的是Java 提供了两种Exception 的模式，一种是执行的时候所产生的Exception (Runtime Exception)，另外一种则是受控制的Exception (Checked Exception)。<br><br>　　所有的Checked Exception 均从java.lang.Exception 继承而来，而Runtime Exception 则继承java.lang.RuntimeException 或java.lang.Error (实际上java.lang.RuntimeException 的上一层也是java.lang.Exception)。<br><br>　　当我们撰写程序的时候，我们很可能会对选择某种形式的Exception 感到困扰，到底我应该选择Runtime Exception 还是Checked Exception ？<br><br>　　其实，在运作上，我们可以通过Class 的Method 如何产生某个Exception以及某个程序如何处理这个被产生来的Exception 来了解它们之间的差异。<br>首先我们先建立一个Exception<br><br>public class CException extends Exception<br>{<br>public CException() {}<br>public CException(String message)<br>{<br>super(message);<br>}<br>}<br><br>然后我们撰写一个可能产生 CException 的 Class<br><br>public class testException<br>{<br>public void method1() throws CException<br>{<br>throw new CException(&quot;Test Exception&quot;);<br>}<br><br>public void method2(String msg)<br>{<br>if(msg == null)<br>{<br>throw new NullPointerException(&quot;Message is null&quot;);<br>}<br>}<br><br>public void method3() throws CException<br>{<br>method1();<br>}<br><br>// 以下省略<br>// ...<br>}<br><br>　　在这三个method 中，我们看到了method1 和method2 的程序码内都会产生Exception，但method3 的程序码中(大括号内)，并没产生Exception，但在method3 的定义中，暗示了这个method 可能产生CException。<br><br>呼叫method1() 的程序，必须将method1() 包含在try 与catch 中，如：<br><br>public class runtest<br>{<br>// ....<br>public static void main(String argv[])<br>{<br>testException te = new testException();<br>try<br>{<br>te.method1();<br>}<br>catch(CException ce)<br>{<br>// ....<br>}<br>}<br>// ...<br>}<br><br>　　虽然包含在try 与catch 中，并不表示这段程序码一定会收到CException，但它的用意在于提醒呼叫者，执行这个method 可能产生的意外，而使用者也必须要能针对这个意外做出相对应的处理方式。<br><br>　　当使用者呼叫method2() 时，并不需要使用try 和catch 将程序码包起来，因为method2 的定义中，并没有throws 任何的Exception ，如：<br><br>public class runtest<br>{<br>// ....<br>public static void main(String argv[])<br>{<br><br>testException te = new testException();<br><br>// 不会产生 Exception<br>te.method2(&quot;Hello&quot;);<br><br>// 会产生 Exception<br>te.method2(null);<br>}<br>// ...<br>}<br><br>　　程序在执行的时候，也不见得会真的产生NullPointerException ，这种Exception 叫做runtime exception 也有人称为unchecked exception ，产生Runtime Exception 的method (在这个范例中是method2) 并不需要在宣告method 的时候定义它将会产生哪一种Exception 。<br><br>在testException 的method3() 中，我们看到了另外一种状况，也就是method3里呼叫了method1() ，但却没有将method1 包在try 和catch 之间。相反，在method3() 的定义中，它定义了CException，实际上就是如果method3 收到了CException ，它将不处理这个CException ，而将它往外丢。当然，由于method3 的定义中有throws CException ，因此呼叫method3 的程序码也需要有try catch 才行。<br><br>　　因此从程序的运作机制上看，Runtime Exception与Checked Exception 不一样，然而从逻辑上看，Runtime Exception 与Checked Exception 在使用的目的上也不一样。<br><br>　　一般而言，Checked Exception 表示这个Exception 必须要被处理，也就是说程序设计者应该已经知道可能会收到某个Exception(因为要try catch住) ，所以程序设计者应该能针对这些不同的Checked Exception 做出不同的处理。<br><br>　　而Runtime Exception 通常会暗示着程序上的错误，这种错误会导致程序设计者无法处理，而造成程序无法继续执行下去。<br><br>看看下面的例子：<br><br>String message[] = {&quot;message1&quot;, &quot;message2&quot;,&quot;message3&quot;};<br>System.out.println(message[3]);<br><br>　　这段程序码在Compile 时并没问题，但在执行时则会出现ArrayIndexOutOfBoundException 的例外，在这种状况下，我们亦无法针对这个Runtime Exception 做出有意义的动作，这就像是我们呼叫了testException 中的method2 ，却引发了它的NullPointerException 一样，在这种状况下，我们必须对程序码进行修改，从而避免这个问题。<br><br>　　因此，实际上我们应该也必须要去抓取所有的Checked Exception，同时最好能在这些Checked Exception 发生的时候做出相对应的处理，好让程序能面对不同的状况。<br><br>然而对于Runtime Exception ，有些人建议将它catch 住，然后导向其它地方，让程序继续执行下去，这种作法并非不好，但它会让我们在某些测试工具下认为我们的程序码没有问题，因为我们将Runtime Exception &quot;处理&quot;掉了，事实却不然！譬如很多人的习惯是在程序的进入点后用个大大的try catch 包起来，如：<br><br>public class runtest1<br>{<br>public static void main(String argv[])<br>{<br>try<br>{<br>//...<br>}<br>catch(Exception e)<br>{<br>}<br>}<br>}<br><br>　　在这种情况下，我们很可能会不知道发生了什么Exception 或是从哪一行发出的，因此在面对不同的Checked Exception时，我们可已分别去try catch它。而在测试阶段时，如果碰到Runtime Exception ，我们可以让它就这样发生，接着再去修改我们的程序码，让它避免Runtime Exception，否则，我们就应该仔细追究每一个Exception ，直到我们可以确定它不会有Runtime Exception 为止！<br><br>　　对于Checked Exception 与Runtime Exception ，我想应该有不少人会有不同的观点，无论如何，程序先要能执行，这些Exception 才有机会产生。因此，我们可以把这些Exception 当成是Bug ，也可以当成是不同的状况(Checked Exception)，或当成是帮助我们除错的工具(Runtime Exception)，但前提是我们需要处理这些Exception ，如果不处理，那么问题或状况就会永远留在那里。<img src ="http://www.blogjava.net/alinglau36/aggbug/338123.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">lau</a> 2010-11-15 18:43 <a href="http://www.blogjava.net/alinglau36/archive/2010/11/15/255045.html#338123#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: The project cannot be built until build path errors are resolved</title><link>http://www.blogjava.net/alinglau36/archive/2010/07/13/279259.html#325979</link><dc:creator>Sunday</dc:creator><author>Sunday</author><pubDate>Tue, 13 Jul 2010 09:12:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2010/07/13/279259.html#325979</guid><description><![CDATA[thanks！<img src ="http://www.blogjava.net/alinglau36/aggbug/325979.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">Sunday</a> 2010-07-13 17:12 <a href="http://www.blogjava.net/alinglau36/archive/2010/07/13/279259.html#325979#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 语言深入:java中究竟是传值还是传引用</title><link>http://www.blogjava.net/alinglau36/archive/2010/04/20/261747.html#318831</link><dc:creator>lau</dc:creator><author>lau</author><pubDate>Tue, 20 Apr 2010 03:32:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2010/04/20/261747.html#318831</guid><description><![CDATA[String就相当于是char[]的包装类。包装类的特质之一就是在对其值进行操作时会体现出其对应的基本类型的性质。在参数传递时对这些包装类的值操作实际上都是通过对其对应的基本类型操作而实现的。在参数传递时，包装类采用的是传值的方式，而不是传地址的方式，所以函数中的值改变并不会影响原来的值。<img src ="http://www.blogjava.net/alinglau36/aggbug/318831.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">lau</a> 2010-04-20 11:32 <a href="http://www.blogjava.net/alinglau36/archive/2010/04/20/261747.html#318831#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 语言深入:java中究竟是传值还是传引用</title><link>http://www.blogjava.net/alinglau36/archive/2010/04/20/261747.html#318826</link><dc:creator>lau</dc:creator><author>lau</author><pubDate>Tue, 20 Apr 2010 03:16:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2010/04/20/261747.html#318826</guid><description><![CDATA[基本类型的表面特征就是第一个字母小写。<br>8种byte   char   short   int   long   float   double   boolean<img src ="http://www.blogjava.net/alinglau36/aggbug/318826.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">lau</a> 2010-04-20 11:16 <a href="http://www.blogjava.net/alinglau36/archive/2010/04/20/261747.html#318826#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: Eclipse+Tomcat调试时的一些错误笔记[未登录]</title><link>http://www.blogjava.net/alinglau36/archive/2009/09/30/263123.html#297006</link><dc:creator>111</dc:creator><author>111</author><pubDate>Wed, 30 Sep 2009 05:17:00 GMT</pubDate><guid>http://www.blogjava.net/alinglau36/archive/2009/09/30/263123.html#297006</guid><description><![CDATA[Java应用服务器的编码方式是启动JVM时，JVM参数-Dfile.encoding指定的，建议你使用这个来改变应用的默认编码方式，这样代码更整洁点<br>nohup java -Xms128m -Xmx256m  -Dfile.encoding=GB2312  -cp $CLASSPATH <img src ="http://www.blogjava.net/alinglau36/aggbug/297006.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/alinglau36/" target="_blank">111</a> 2009-09-30 13:17 <a href="http://www.blogjava.net/alinglau36/archive/2009/09/30/263123.html#297006#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>