<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>拈花微笑 &#187; tips</title>
	<atom:link href="http://www.jayxu.com/tags/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jayxu.com</link>
	<description>晶 · 彦</description>
	<lastBuildDate>Thu, 02 Feb 2012 09:24:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<image>
<link>http://www.jayxu.com</link>
<url>http://www.jayxu.com/wp-content/cbnet-favicon/1289928181_Black_Cat.png</url>
<title>拈花微笑</title>
</image>
		<item>
		<title>vim 指令图解</title>
		<link>http://www.jayxu.com/2011/07/08/10667/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=vim-%25e6%258c%2587%25e4%25bb%25a4%25e5%259b%25be%25e8%25a7%25a3</link>
		<comments>http://www.jayxu.com/2011/07/08/10667/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 16:05:13 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=10667</guid>
		<description><![CDATA[原创内容，转载请注明： 转载自拈花微笑 本文链接地址: vim 指令图解<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F08%2F11701%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Learn Vim Progressively</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim键盘布局，中英高清带字幕</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Linux下设置ntp服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关使用asadmin启动Glassfish的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><a class="hoverZoomLink" href="http://www.jayxu.com/log/wp-content/uploads/2011/07/vim-cheat-sheet-full.png"><img alt="" class="alignnone size-medium wp-image-10670 hoverZoomLink" height="235" src="http://www.jayxu.com/log/wp-content/uploads/2011/07/vim-cheat-sheet-full-400x235.png" title="vim-cheat-sheet-full" width="400" /></a></p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2011/07/08/10667/">vim 指令图解</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&title=vim+%E6%8C%87%E4%BB%A4%E5%9B%BE%E8%A7%A3" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F08%2F11701%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Learn Vim Progressively</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim键盘布局，中英高清带字幕</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Linux下设置ntp服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关使用asadmin启动Glassfish的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2011/07/08/10667/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>About DB2 Catalog</title>
		<link>http://www.jayxu.com/2011/07/04/10658/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=about-db2-catalog</link>
		<comments>http://www.jayxu.com/2011/07/04/10658/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 05:59:52 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[db2]]></category>
		<category><![CDATA[ibm]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=10658</guid>
		<description><![CDATA[Catalog node/database node: catalog tcpip node &#60;node_name&#62; remote &#60;hostname&#62; server &#60;port_number&#62; databse: catalog database &#60;database_name&#62; as &#60;database_alias&#62; at node &#60;node_name&#62; Uncatalog node/database node: uncatalog node &#60;node_name&#62; databse: uncatalog database &#60;database_alias&#62; 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: About DB2 Catalog<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F06%2F07%2F10597%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F04%2F10658%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IBM沃森背后的AI技术 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F10%2F28%2F12947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F04%2F10658%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How do I connect my android phone to the IBM Wireless network?</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F06%2F16%2F10609%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F04%2F10658%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IBM i Is Modern. Windows and UNIX Are Legacy.</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F04%2F10658%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F05%2F11592%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F04%2F10658%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">About “IBM Rational XML ODBC Driver could not be loaded due to system error 126″ when Integrating ClearQuest with Insight</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<h3>Catalog node/database</h3>
<p>node:</p>
<pre>catalog tcpip node &lt;node_name&gt; remote &lt;hostname&gt; server &lt;port_number&gt;</pre>
<p>databse:</p>
<pre>catalog database &lt;database_name&gt; as &lt;database_alias&gt; at node &lt;node_name&gt;</pre>
<h3></h3>
<h3>Uncatalog node/database</h3>
<p>node:</p>
<pre>uncatalog node &lt;node_name&gt;</pre>
<p>databse:</p>
<pre>uncatalog database &lt;database_alias&gt;</pre>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2011/07/04/10658/">About DB2 Catalog</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F04%2F10658%2F&title=About+DB2+Catalog" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F06%2F07%2F10597%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F04%2F10658%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IBM沃森背后的AI技术 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F10%2F28%2F12947%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F04%2F10658%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How do I connect my android phone to the IBM Wireless network?</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F06%2F16%2F10609%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F04%2F10658%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IBM i Is Modern. Windows and UNIX Are Legacy.</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F04%2F10658%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F08%2F05%2F11592%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F04%2F10658%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">About “IBM Rational XML ODBC Driver could not be loaded due to system error 126″ when Integrating ClearQuest with Insight</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2011/07/04/10658/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何在JDialog上注册全局ESC键事件</title>
		<link>http://www.jayxu.com/2011/01/25/10466/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e5%259c%25a8jdialog%25e4%25b8%258a%25e6%25b3%25a8%25e5%2586%258cesc%25e9%2594%25ae%25e4%25ba%258b%25e4%25bb%25b6</link>
		<comments>http://www.jayxu.com/2011/01/25/10466/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 05:53:11 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=10466</guid>
		<description><![CDATA[大多数用户可能会有这么一个习惯：对于富客户端弹出的Dialog，习惯使用ESC将其关闭，而不是“叉掉它”。在Swing中，弹出窗口一般继承自JDialog类，但默认没有对ESC键事件做响应，下面这段代码可以完成这个功能： private static final KeyStroke escapeStroke = KeyStroke.getKeyStroke&#40;KeyEvent.VK_ESCAPE, 0&#41;; public static final String dispatchWindowClosingActionMapKey = &#34;com.jayxu:WINDOW_CLOSING&#34;; // any key string you like &#160; public static void installEscapeCloseOperation&#40;final JDialog dialog&#41; &#123; // any method name you like     Action dispatchClosing = new AbstractAction&#40;&#41; &#123;         public void actionPerformed&#40;ActionEvent event&#41; &#123;     <a href="http://www.jayxu.com/2011/01/25/10466/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Linux下设置ntp服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim 指令图解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">怎么把Eclipse的perspective dock放到右上角？</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>大多数用户可能会有这么一个习惯：对于富客户端弹出的Dialog，习惯使用ESC将其关闭，而不是“叉掉它”。在Swing中，弹出窗口一般继承自JDialog类，但默认没有对ESC键事件做响应，下面这段代码可以完成这个功能：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">private</span> <span class="kw1">static</span> <span class="kw1">final</span> <span class="kw3">KeyStroke</span> escapeStroke <span class="sy0">=</span> <span class="kw3">KeyStroke</span>.<span class="me1">getKeyStroke</span><span class="br0">&#40;</span><span class="kw3">KeyEvent</span>.<span class="me1">VK_ESCAPE</span>, <span class="nu0">0</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="kw1">public</span> <span class="kw1">static</span> <span class="kw1">final</span> <span class="kw3">String</span> dispatchWindowClosingActionMapKey <span class="sy0">=</span> <span class="st0">&quot;com.jayxu:WINDOW_CLOSING&quot;</span><span class="sy0">;</span> <span class="co1">// any key string you like</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2"><span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> installEscapeCloseOperation<span class="br0">&#40;</span><span class="kw1">final</span> <span class="kw3">JDialog</span> dialog<span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="co1">// any method name you like</span></div></li>
<li class="li1"><div class="de1">    <span class="kw3">Action</span> dispatchClosing <span class="sy0">=</span> <span class="kw1">new</span> <span class="kw3">AbstractAction</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">        <span class="kw1">public</span> <span class="kw4">void</span> actionPerformed<span class="br0">&#40;</span><span class="kw3">ActionEvent</span> event<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">            dialog.<span class="me1">dispatchEvent</span><span class="br0">&#40;</span><span class="kw1">new</span> <span class="kw3">WindowEvent</span><span class="br0">&#40;</span>dialog, <span class="kw3">WindowEvent</span>.<span class="me1">WINDOW_CLOSING</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">        <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1">    <span class="br0">&#125;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1">    <span class="kw3">JRootPane</span> root <span class="sy0">=</span> dialog.<span class="me1">getRootPane</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">    root.<span class="me1">getInputMap</span><span class="br0">&#40;</span><span class="kw3">JComponent</span>.<span class="me1">WHEN_IN_FOCUSED_WINDOW</span><span class="br0">&#41;</span>.<span class="me1">put</span><span class="br0">&#40;</span>escapeStroke, dispatchWindowClosingActionMapKey<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">    root.<span class="me1">getActionMap</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">put</span><span class="br0">&#40;</span> dispatchWindowClosingActionMapKey, dispatchClosing<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">private static final KeyStroke escapeStroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0);
public static final String dispatchWindowClosingActionMapKey = "com.jayxu:WINDOW_CLOSING"; // any key string you like

public static void installEscapeCloseOperation(final JDialog dialog) { // any method name you like
    Action dispatchClosing = new AbstractAction() {
        public void actionPerformed(ActionEvent event) {
            dialog.dispatchEvent(new WindowEvent(dialog, WindowEvent.WINDOW_CLOSING));
        }
    };

    JRootPane root = dialog.getRootPane();
    root.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escapeStroke, dispatchWindowClosingActionMapKey);
    root.getActionMap().put( dispatchWindowClosingActionMapKey, dispatchClosing);
}</pre></div></div>

<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2011/01/25/10466/">如何在JDialog上注册全局ESC键事件</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&title=%E5%A6%82%E4%BD%95%E5%9C%A8JDialog%E4%B8%8A%E6%B3%A8%E5%86%8C%E5%85%A8%E5%B1%80ESC%E9%94%AE%E4%BA%8B%E4%BB%B6" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Linux下设置ntp服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim 指令图解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">怎么把Eclipse的perspective dock放到右上角？</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2011/01/25/10466/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X 快捷键 [zz]</title>
		<link>http://www.jayxu.com/2011/01/18/10448/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mac-os-x-%25e5%25bf%25ab%25e6%258d%25b7%25e9%2594%25ae-zz</link>
		<comments>http://www.jayxu.com/2011/01/18/10448/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 07:06:16 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[互联网生活]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=10448</guid>
		<description><![CDATA[原文：http://support.apple.com/kb/HT1343?viewlocale=zh_CN 摘要 了解常见 Mac OS X 快捷键。快捷键是通过按下键盘上的组合键来调用 Mac OS X 功能的一种方式。 受影响的产品 Mac OS X 10.0, Mac OS X 10.3, Mac OS X 10.2, Mac OS X 10.1, Mac OS X 10.4, Mac OS X 10.6, Mac OS X 10.5 要使用快捷键或组合键，您可以同时按修饰键和字符键。例如，同时按下 Command 键（标有 符号的按键）和“c”键会将当前选中的任何内容（文本、图形等等）拷贝至夹纸板。这也称作 Command-C 组合键（或快捷键）。 许多组合键中都包含修饰键。修饰键将改变 Mac OS X 对其他按键或鼠标点按动作的解释方式。修饰键包括 Command、Control、Option、Shift、Caps Lock 和 fn <a href="http://www.jayxu.com/2011/01/18/10448/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F25%2F1892%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X的内存管理策略</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X刷新DNS缓存</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F30%2F734%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">OS比较形象的比较</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F11%2F07%2F25%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X竟然开源了</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F07%2F29%2F127%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Unbuntu + Mac</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>原文：<a href="http://support.apple.com/kb/HT1343?viewlocale=zh_CN&amp;locale=zh_CN" target="_blank">http://support.apple.com/kb/HT1343?viewlocale=zh_CN</a></p>
<h2>摘要</h2>
<p>了解常见 Mac OS X 快捷键。快捷键是通过按下键盘上的组合键来调用 Mac OS X 功能的一种方式。</p>
<div>
<h2>受影响的产品</h2>
<p>Mac OS X 10.0, Mac OS X 10.3, Mac OS X 10.2, Mac OS X 10.1, Mac OS X 10.4, Mac OS X 10.6, Mac OS X 10.5</p>
</div>
<div>
<p>要使用快捷键或组合键，您可以同时按修饰键和字符键。例如，同时按下 Command 键（标有 <img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" width="9" height="9" /> 符号的按键）和“c”键会将当前选中的任何内容（文本、图形等等）拷贝至夹纸板。这也称作 Command-C 组合键（或快捷键）。</p>
<p>许多组合键中都包含修饰键。修饰键将改变 Mac OS X 对其他按键或鼠标点按动作的解释方式。修饰键包括 Command、Control、Option、Shift、Caps Lock 和 fn 键（如果您的键盘有 fn 键）。</p>
<p>以下是出现在 Mac OS X 菜单中的修饰键符号：</p>
<p><img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="" width="0" height="0" /><img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_command.gif" alt="Command 键图标" width="9" height="9" />（Command 键） &#8211; 在某些 Apple 键盘上，此键也可能带有 Apple 标志（<img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_apple_icon.gif" alt="apple 标志" width="13" height="13" />）<br />
<img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_control.gif" alt="Control 键图标" width="9" height="9" />（Control 键）<br />
<img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_option.gif" alt="Option 或 Alt 键图标" width="9" height="9" />（Option 键）-“Alt”可能也出现在此键上<br />
<img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_shift.gif" alt="Shift 键图标" width="9" height="9" />（Shift 键）<br />
<img src="http://km.support.apple.com/library/APPLE/APPLECARE_ALLGEOS/HT1343/ks_caps_lock.gif" alt="Caps lock 键图标" width="9" height="9" />（Caps Lock 键）- 切换 Caps Lock 开或关<br />
fn（功能键）</p>
<p><strong>启动快捷键</strong></p>
<p>按下按键或组合键，直到所需的功能出现（例如，在启动过程中按住 Option 直到出现“启动管理程序”，或按住 Shift 直到出现“安全启动”）。<strong>提示</strong>：如果启动功能未起作用，而您使用的是第三方键盘，请连接 Apple 键盘，然后再试一次。</p>
<table id="kbtable" border="0" cellspacing="0" width="100%">
<tbody>
<tr id="header">
<td><strong>按键或组合键</strong></td>
<td><strong>功能<br />
</strong></td>
</tr>
<tr>
<td>Option</td>
<td>显示所有可引导宗卷（<a href="http://support.apple.com/kb/HT1310?viewlocale=zh_CN&amp;locale=zh_CN">启动管理程序</a>）</td>
</tr>
<tr>
<td>Shift</td>
<td>执行<a href="http://support.apple.com/kb/HT1564?viewlocale=zh_CN&amp;locale=zh_CN">安全启动</a>（以<a href="http://support.apple.com/kb/HT1455?viewlocale=zh_CN&amp;locale=zh_CN">安全模式</a>启动）</td>
</tr>
<tr>
<td>C</td>
<td>从可引导磁盘启动（DVD、CD）</td>
</tr>
<tr>
<td>T</td>
<td>以 <a href="http://support.apple.com/kb/HT1661?viewlocale=zh_CN&amp;locale=zh_CN">FireWire 目标磁盘模式</a>启动</td>
</tr>
<tr>
<td>N</td>
<td>从 NetBoot 服务器启动</td>
</tr>
<tr>
<td>X</td>
<td>强制 Mac OS X 启动（如果存在非 Mac OS X 启动宗卷）</td>
</tr>
<tr>
<td>Command-V</td>
<td>以<a href="http://support.apple.com/kb/HT1492?viewlocale=zh_CN&amp;locale=zh_CN">详细模式</a>启动</td>
</tr>
<tr>
<td>Command-S</td>
<td>以<a href="http://support.apple.com/kb/HT1492?viewlocale=zh_CN&amp;locale=zh_CN">单用户模式</a>启动</td>
</tr>
</tbody>
</table>
<p><strong><br />
Finder 快捷键</strong></p>
<table id="kbtable" border="0" cellspacing="0" width="100%">
<tbody>
<tr id="header">
<td><strong>组合键</strong></td>
<td><strong>功能</strong></td>
</tr>
<tr>
<td>Command-A</td>
<td>选中最前面的 Finder 窗口中的所有项（如果未打开任何窗口则选中桌面内容）</td>
</tr>
<tr>
<td>Option-Command-A</td>
<td>取消选择所有项</td>
</tr>
<tr>
<td>Shift-Command-A</td>
<td>打开“应用程序”文件夹</td>
</tr>
<tr>
<td>Command-C</td>
<td>拷贝所选项/文本至夹纸板</td>
</tr>
<tr>
<td>Shift-Command-C</td>
<td>打开“电脑”窗口</td>
</tr>
<tr>
<td>Command-D</td>
<td>复制所选项</td>
</tr>
<tr>
<td>Shift-Command-D</td>
<td>打开桌面文件夹</td>
</tr>
<tr>
<td>Command-E</td>
<td>推出</td>
</tr>
<tr>
<td>Command-F</td>
<td>查找任何匹配 Spotlight 属性的内容</td>
</tr>
<tr>
<td>Shift-Command-F</td>
<td>查找 Spotlight 文件名匹配项</td>
</tr>
<tr>
<td>Option-Command-F</td>
<td>导航到已打开的 Spotlight 窗口中的搜索栏</td>
</tr>
<tr>
<td>Shift-Command-G</td>
<td>前往文件夹</td>
</tr>
<tr>
<td>Shift-Command-H</td>
<td>打开当前所登录用户帐户的个人文件夹</td>
</tr>
<tr>
<td>Command-I</td>
<td>显示简介</td>
</tr>
<tr>
<td>Option-Command-I</td>
<td>显示检查器</td>
</tr>
<tr>
<td>Control-Command-I</td>
<td>获得摘要信息</td>
</tr>
<tr>
<td>Shift-Command-I</td>
<td>打开 iDisk</td>
</tr>
<tr>
<td>Command-J</td>
<td>调出“显示”选项</td>
</tr>
<tr>
<td>Command-K</td>
<td>连接服务器</td>
</tr>
<tr>
<td>Shift-Command-K</td>
<td>打开“网络”窗口</td>
</tr>
<tr>
<td>Command-L</td>
<td>为所选项制作替身</td>
</tr>
<tr>
<td>Command-M</td>
<td>最小化窗口</td>
</tr>
<tr>
<td>Option-Command-M</td>
<td>最小化所有窗口</td>
</tr>
<tr>
<td>Command-N</td>
<td>新建 Finder 窗口</td>
</tr>
<tr>
<td>Shift-Command-N</td>
<td>新建文件夹</td>
</tr>
<tr>
<td>Option-Command-N</td>
<td>新建智能文件夹</td>
</tr>
<tr>
<td>Command-O</td>
<td>打开所选项</td>
</tr>
<tr>
<td>Shift-Command-Q</td>
<td>注销</td>
</tr>
<tr>
<td>Option-Shift-Command-Q</td>
<td>立即注销</td>
</tr>
<tr>
<td>Command-R</td>
<td>显示（替身的）原身</td>
</tr>
<tr>
<td>Command-T</td>
<td>添加到工具条</td>
</tr>
<tr>
<td>Shift-Command-T</td>
<td>添加到个人收藏</td>
</tr>
<tr>
<td>Option-Command-T</td>
<td>在 Finder 窗口中隐藏工具栏/显示工具栏</td>
</tr>
<tr>
<td>Shift-Command-U</td>
<td>打开“实用工具”文件夹</td>
</tr>
<tr>
<td>Command-V</td>
<td>粘贴</td>
</tr>
<tr>
<td>Command-W</td>
<td>关闭窗口</td>
</tr>
<tr>
<td>Option-Command-W</td>
<td>关闭所有窗口</td>
</tr>
<tr>
<td>Command-X</td>
<td>剪切</td>
</tr>
<tr>
<td>Option-Command-Y</td>
<td>幻灯片显示（Mac OS X 10.5 或更高版本）</td>
</tr>
<tr>
<td>Command-Z</td>
<td>还原/重做</td>
</tr>
<tr>
<td>Command-1</td>
<td>以图标显示</td>
</tr>
<tr>
<td>Command-2</td>
<td>列表方式显示</td>
</tr>
<tr>
<td>Command-3</td>
<td>以分栏方式显示</td>
</tr>
<tr>
<td>Command-4</td>
<td>以 Cover Flow 方式显示（Mac OS X 10.5 或更高版本）</td>
</tr>
<tr>
<td>Command-,（Command 加逗号键）</td>
<td>打开 Finder 偏好设置</td>
</tr>
<tr>
<td>Command-`（重音符键 &#8211; 美式英语键盘布局中 Tab 键的上方）</td>
<td>循环显示打开的 Finder 窗口</td>
</tr>
<tr>
<td>Command-Shift-?</td>
<td>打开 Mac 帮助</td>
</tr>
<tr>
<td>Option-Shift-Command-Esc（按住三秒钟）- 仅 Mac OS X v10.5、v10.6 或更高版本</td>
<td><a href="http://support.apple.com/kb/HT3411?viewlocale=zh_CN&amp;locale=zh_CN">强制退出</a>最前面的应用程序</td>
</tr>
<tr>
<td>Command-[</td>
<td>后退</td>
</tr>
<tr>
<td>Command-]</td>
<td>前进</td>
</tr>
<tr>
<td>Command-上箭头</td>
<td>打开所含文件夹</td>
</tr>
<tr>
<td>Control-Command-上箭头</td>
<td>在新窗口中打开所含文件夹</td>
</tr>
<tr>
<td>Command-下箭头</td>
<td>打开高亮显示的项</td>
</tr>
<tr>
<td>Command-Tab</td>
<td>切换应用程序 &#8211; 向前循环</td>
</tr>
<tr>
<td>Shift-Command-Tab</td>
<td>切换应用程序 &#8211; 向后循环</td>
</tr>
<tr>
<td>Command-Delete</td>
<td>移到废纸篓</td>
</tr>
<tr>
<td>Shift-Command-Delete</td>
<td>清倒废纸篓</td>
</tr>
<tr>
<td>Option-Shift-Command-Delete</td>
<td>清倒废纸篓（不显示确认对话框）</td>
</tr>
<tr>
<td>空格键（或 Command-Y）</td>
<td>快速查看（Mac OS X 10.5 或更高版本）</td>
</tr>
<tr>
<td>拖移时按 Command 键</td>
<td>将拖移的项移到其他宗卷/位置（按住按键时指针图标发生变化 &#8211; 请参阅<a href="http://support.apple.com/kb/TA22365">此文章</a>）</td>
</tr>
<tr>
<td>拖移时按 Option 键</td>
<td>拷贝拖移的项（按住按键时指针图标发生变化 &#8211; 请参阅<a href="http://support.apple.com/kb/TA22365">此文章</a>）</td>
</tr>
<tr>
<td>拖移时按 Option-Command 组合键</td>
<td>为拖移的项制作替身（按住按键时指针图标发生变化 &#8211; 请参阅<a href="http://support.apple.com/kb/TA22365">此文章</a>）</td>
</tr>
</tbody>
</table>
<p><strong>应用程序和其他 Mac OS X 键盘命令 </strong></p>
<p><strong>注：</strong>有些应用程序可能不支持以下所有应用程序组合键。</p>
<table id="kbtable" border="0" cellspacing="0" width="100%">
<tbody>
<tr id="header">
<td><strong>组合键</strong></td>
<td><strong>功能</strong></td>
</tr>
<tr>
<td>Command-空格键</td>
<td>显示或隐藏 Spotlight 搜索栏（如果安装了多语种，则可能循环显示启用的语系）</td>
</tr>
<tr>
<td>Control-A</td>
<td>移到行/段落的开头</td>
</tr>
<tr>
<td>Control-B</td>
<td>向后移动一个字符</td>
</tr>
<tr>
<td>Control-D</td>
<td>删除光标前的字符</td>
</tr>
<tr>
<td>Control-E</td>
<td>移到行/段落的结尾</td>
</tr>
<tr>
<td>Control-F</td>
<td>向前移动一个字符</td>
</tr>
<tr>
<td>Control-H</td>
<td>删除光标后的字符</td>
</tr>
<tr>
<td>Control-K</td>
<td>删除从光标前的字符到行/段落结尾的所有内容</td>
</tr>
<tr>
<td>Control-L</td>
<td>将光标/所选内容置于可见区域中央</td>
</tr>
<tr>
<td>Control-N</td>
<td>下移一行</td>
</tr>
<tr>
<td>Control-O</td>
<td>在光标后插入一行</td>
</tr>
<tr>
<td>Control-P</td>
<td>上移一行</td>
</tr>
<tr>
<td>Control-T</td>
<td>移调光标前后的字符</td>
</tr>
<tr>
<td>Control-V</td>
<td>下移一个页面</td>
</tr>
<tr>
<td>Option-Command-空格键</td>
<td>显示 Spotlight 搜索结果窗口（如果安装了多语种，则可能循环显示某一语系下的键盘布局和输入法）</td>
</tr>
<tr>
<td>Command-Tab</td>
<td>在打开的应用程序列表中，向下移动到下一个最近使用的应用程序</td>
</tr>
<tr>
<td>Shift-Command-Tab</td>
<td>在打开的应用程序列表中向上移动（按最近使用时间排序）</td>
</tr>
<tr>
<td>Shift-Tab</td>
<td>按反方向浏览各控件</td>
</tr>
<tr>
<td>Control-Tab</td>
<td>聚焦对话框中的下一组控件或聚焦下一个表格（当 Tab 移到下一个单元格时）</td>
</tr>
<tr>
<td>Shift-Control-Tab</td>
<td>聚焦上一组控件</td>
</tr>
<tr>
<td>Command-esc</td>
<td>打开 Front Row（如果已安装）</td>
</tr>
<tr>
<td>Option-推出键</td>
<td>从备选光盘驱动器中推出（如果已安装）</td>
</tr>
<tr>
<td>Control-推出键</td>
<td>显示关机对话框</td>
</tr>
<tr>
<td>Option-Command-推出键</td>
<td>使电脑进入睡眠模式</td>
</tr>
<tr>
<td>Control-Command-推出键</td>
<td>退出所有应用程序（会让您先存储对已打开文稿所作的更改），然后重新启动电脑</td>
</tr>
<tr>
<td>Control Option-Command-推出键</td>
<td>退出所有应用程序（会让您先存储对已打开文稿所作的更改），然后关闭电脑</td>
</tr>
<tr>
<td>fn-Delete</td>
<td>向前删除（适用于便携式 Mac 的内建键盘）</td>
</tr>
<tr>
<td>Control-F1</td>
<td>切换全键盘控制开或关</td>
</tr>
<tr>
<td>Control-F2</td>
<td>聚焦菜单栏</td>
</tr>
<tr>
<td>Control-F3</td>
<td>聚焦 Dock</td>
</tr>
<tr>
<td>Control-F4</td>
<td>聚焦活跃窗口或下一个窗口</td>
</tr>
<tr>
<td>Shift-Control-F4</td>
<td>聚焦上一个活跃窗口</td>
</tr>
<tr>
<td>Control-F5</td>
<td>聚焦工具栏</td>
</tr>
<tr>
<td>Control-F6</td>
<td>聚焦第一个（或下一个）面板</td>
</tr>
<tr>
<td>Shift-Control-F6</td>
<td>聚焦上一个面板</td>
</tr>
<tr>
<td>Control-F7</td>
<td>临时覆盖窗口和对话框中的当前键盘控制模式</td>
</tr>
<tr>
<td>F9</td>
<td>拼贴或取消拼贴所有打开的窗口</td>
</tr>
<tr>
<td>F10</td>
<td>拼贴或取消拼贴当前活跃应用程序中所有打开的窗口</td>
</tr>
<tr>
<td>F11</td>
<td>隐藏或显示所有打开的窗口</td>
</tr>
<tr>
<td>F12</td>
<td>隐藏或显示 Dashboard</td>
</tr>
<tr>
<td>Command-`</td>
<td>激活最前面的应用程序中下一个打开的窗口</td>
</tr>
<tr>
<td>Shift-Command-`</td>
<td>激活最前面的应用程序中上一个打开的窗口</td>
</tr>
<tr>
<td>Option-Command-`</td>
<td>聚焦窗口抽屉</td>
</tr>
<tr>
<td>Command- -（减号）</td>
<td>缩小所选项</td>
</tr>
<tr>
<td>Command-{</td>
<td>使所选内容左对齐</td>
</tr>
<tr>
<td>Command-}</td>
<td>使所选内容右对齐</td>
</tr>
<tr>
<td>Command-|</td>
<td>使所选内容居中对齐</td>
</tr>
<tr>
<td>Command-:</td>
<td>显示“拼写”窗口</td>
</tr>
<tr>
<td>Command-;</td>
<td>查找文稿中拼写错误的词</td>
</tr>
<tr>
<td>Command-,</td>
<td>打开最前面的应用程序的偏好设置窗口（前提是应用程序支持此快捷键）</td>
</tr>
<tr>
<td>Option-Control-Command-,</td>
<td>降低屏幕对比度</td>
</tr>
<tr>
<td>Option-Control-Command-.</td>
<td>增强屏幕对比度</td>
</tr>
<tr>
<td>Command-?</td>
<td>在帮助显示程序中打开应用程序的帮助</td>
</tr>
<tr>
<td>Option-Command-/</td>
<td>打开或关闭字体平滑</td>
</tr>
<tr>
<td>Shift-Command-=</td>
<td>放大所选项</td>
</tr>
<tr>
<td>Shift-Command-3</td>
<td>将屏幕捕捉到文件</td>
</tr>
<tr>
<td>Shift-Control-Command-3</td>
<td>将屏幕捕捉到夹纸板</td>
</tr>
<tr>
<td>Shift-Command-4</td>
<td>将所选内容捕捉到文件</td>
</tr>
<tr>
<td>Shift-Control-Command-4</td>
<td>将所选内容捕捉到夹纸板</td>
</tr>
<tr>
<td>Command-A</td>
<td>高亮显示文稿或窗口中的所有项，或高亮显示文本栏中的所有字符</td>
</tr>
<tr>
<td>Command-B</td>
<td>以粗体显示所选文本或切换文本粗体显示开/关</td>
</tr>
<tr>
<td>Command-C</td>
<td>将所选数据拷贝到夹纸板</td>
</tr>
<tr>
<td>Shift-Command-C</td>
<td>显示“颜色”窗口</td>
</tr>
<tr>
<td>Option-Command-C</td>
<td>拷贝所选文本的样式</td>
</tr>
<tr>
<td>Control-Command-C</td>
<td>拷贝所选项的格式设置并存储到夹纸板</td>
</tr>
<tr>
<td>Option-Command-D</td>
<td>显示或隐藏 Dock</td>
</tr>
<tr>
<td>Command-Control D</td>
<td>在字典应用程序中显示所选词的定义</td>
</tr>
<tr>
<td>Command-E</td>
<td>使用所选内容进行查找</td>
</tr>
<tr>
<td>Command-F</td>
<td>打开“查找”窗口</td>
</tr>
<tr>
<td>Option-Command-F</td>
<td>移到搜索栏控件</td>
</tr>
<tr>
<td>Command-G</td>
<td>查找所选内容出现的下一个位置</td>
</tr>
<tr>
<td>Shift-Command-G</td>
<td>查找所选内容出现的上一个位置</td>
</tr>
<tr>
<td>Command-H</td>
<td>隐藏当前正在运行的应用程序窗口</td>
</tr>
<tr>
<td>Option-Command-H</td>
<td>隐藏所有其他正在运行的应用程序窗口</td>
</tr>
<tr>
<td>Command-I</td>
<td>以斜体显示所选文本或切换文本斜体显示开/关</td>
</tr>
<tr>
<td>Option-Command-I</td>
<td>显示检查器窗口</td>
</tr>
<tr>
<td>Command-J</td>
<td>滚动到所选部分</td>
</tr>
<tr>
<td>Command-M</td>
<td>将活跃窗口最小化至 Dock</td>
</tr>
<tr>
<td>Option-Command-M</td>
<td>将活跃应用程序的所有窗口最小化至 Dock</td>
</tr>
<tr>
<td>Command-N</td>
<td>在最前面的应用程序中创建新文稿</td>
</tr>
<tr>
<td>Command-O</td>
<td>显示对话框，用于选择要在最前面的应用程序中打开的文稿</td>
</tr>
<tr>
<td>Command-P</td>
<td>显示“打印”对话框</td>
</tr>
<tr>
<td>Shift-Command-P</td>
<td>显示用于指定打印参数（页面设置）的对话框</td>
</tr>
<tr>
<td>Command-Q</td>
<td>退出最前面的应用程序</td>
</tr>
<tr>
<td>Command-S</td>
<td>存储活跃文稿</td>
</tr>
<tr>
<td>Shift-Command-S</td>
<td>显示“存储为”对话框</td>
</tr>
<tr>
<td>Command-T</td>
<td>显示“字体”窗口</td>
</tr>
<tr>
<td>Option-Command-T</td>
<td>显示或隐藏工具栏</td>
</tr>
<tr>
<td>Command-U</td>
<td>对所选文本加下划线或打开/关闭加下划线功能</td>
</tr>
<tr>
<td>Command-V</td>
<td>在插入点位置粘贴夹纸板内容</td>
</tr>
<tr>
<td>Option-Command-V</td>
<td>将某对象的样式应用于所选对象（粘贴样式）</td>
</tr>
<tr>
<td>Option-Shift-Command-V</td>
<td>将周围文本的样式应用于所插入对象（粘贴并匹配样式）</td>
</tr>
<tr>
<td>Control-Command-V</td>
<td>将格式设置应用于所选对象（粘贴标尺命令）</td>
</tr>
<tr>
<td>Command-W</td>
<td>关闭最前面的窗口</td>
</tr>
<tr>
<td>Shift-Command-W</td>
<td>关闭文件及其关联窗口</td>
</tr>
<tr>
<td>Option-Command-W</td>
<td>不退出应用程序直接关闭其所有窗口</td>
</tr>
<tr>
<td>Command-X</td>
<td>移去所选内容并存储到夹纸板</td>
</tr>
<tr>
<td>Command-Z</td>
<td>还原上一命令（有些应用程序允许多次还原）</td>
</tr>
<tr>
<td>Shift-Command-Z</td>
<td>重做上一命令（有些应用程序允许多次重做）</td>
</tr>
<tr>
<td>Control-右箭头</td>
<td>聚焦视图（如表格）内的另一个值或单元格</td>
</tr>
<tr>
<td>Control-左箭头</td>
<td>聚焦视图（如表格）内的另一个值或单元格</td>
</tr>
<tr>
<td>Control-下箭头</td>
<td>聚焦视图（如表格）内的另一个值或单元格</td>
</tr>
<tr>
<td>Control-上箭头</td>
<td>聚焦视图（如表格）内的另一个值或单元格</td>
</tr>
<tr>
<td>Command-右箭头</td>
<td>将文本插入点移至当前行的行尾</td>
</tr>
<tr>
<td>Command-左箭头</td>
<td>将文本插入点移至当前行的行首</td>
</tr>
<tr>
<td>Command-下箭头</td>
<td>将文本插入点移至文稿的结尾</td>
</tr>
<tr>
<td>Command-上箭头</td>
<td>将文本插入点移至文稿的开头</td>
</tr>
<tr>
<td>Shift-Command-右箭头</td>
<td>选中插入点与当前行行尾之间的文本 (*)</td>
</tr>
<tr>
<td>Shift-Command-左箭头</td>
<td>选中插入点与当前行行首之间的文本 (*)</td>
</tr>
<tr>
<td>Shift-右箭头</td>
<td>将文本选择范围向右扩展一个字符 (*)</td>
</tr>
<tr>
<td>Shift-左箭头</td>
<td>将文本选择范围向左扩展一个字符 (*)</td>
</tr>
<tr>
<td>Shift-Command-上箭头</td>
<td>选中插入点与文稿开头之间的文本 (*)</td>
</tr>
<tr>
<td>Shift-Command-下箭头</td>
<td>选中插入点与文稿结尾之间的文本 (*)</td>
</tr>
<tr>
<td>Shift-上箭头</td>
<td>将文本选择范围扩展到上一行相同水平位置的最近字符边缘 (*)</td>
</tr>
<tr>
<td>Shift-下箭头</td>
<td>将文本选择范围扩展到下一行相同水平位置的最近字符边缘 (*)</td>
</tr>
<tr>
<td>Shift-Option-右箭头</td>
<td>将文本选择范围扩展到当前词的词尾，再按一次则扩展到后一词的词尾 (*)</td>
</tr>
<tr>
<td>Shift-Option-左箭头</td>
<td>将文本选择范围扩展到当前词的词首，再按一次则扩展到后一词的词首 (*)</td>
</tr>
<tr>
<td>Shift-Option-下箭头</td>
<td>将文本选择范围扩展到当前段落的段尾，再按一次则扩展到下一段落的结尾 (*)</td>
</tr>
<tr>
<td>Shift-Option-上箭头</td>
<td>将文本选择范围扩展到当前段落的段首，再按一次则扩展到下一段落的段首 (*)</td>
</tr>
<tr>
<td>Control-空格键</td>
<td>在当前输入源和上一输入源之间切换</td>
</tr>
<tr>
<td>Option-Control-空格键</td>
<td>在所有启用的输入源之间切换</td>
</tr>
<tr>
<td>Option-Command-esc</td>
<td><a href="http://support.apple.com/kb/HT3411?viewlocale=zh_CN&amp;locale=zh_CN">强制退出</a></td>
</tr>
</tbody>
</table>
<p><strong>(*) 注：</strong>如果未选择任何文本，则从插入点位置开始扩展。如果通过拖移选择文本，则从所选内容的边缘开始扩展。反向选择所选内容会取消选择相应部分。</p>
<p><strong><br />
万能辅助 &#8211; <a href="http://docs.info.apple.com/article.html?path=Mac/10.5/zh/8825.html">VoiceOver</a> 键盘命令</strong></p>
<p>有关 Mac OS X v10.6 中 VoiceOver 组合键差异的信息，请参阅<a href="http://support.apple.com/kb/HT3786?viewlocale=zh_CN&amp;locale=zh_CN">此文章</a>。</p>
<table id="kbtable" border="0" cellspacing="0" width="100%">
<tbody>
<tr id="header">
<td><strong>组合键</strong></td>
<td><strong>功能</strong></td>
</tr>
<tr>
<td>Command-F5 或<br />
fn Command-F5</td>
<td>打开或关闭 VoiceOver</td>
</tr>
<tr>
<td>Control Option-F8 或<br />
fn Control Option-F8</td>
<td>打开 VoiceOver 实用工具</td>
</tr>
<tr>
<td>Control Option-F7 或<br />
fn Control Option-F7</td>
<td>显示 VoiceOver 菜单</td>
</tr>
<tr>
<td>Control Option-;<br />
或 fn Control Option-;</td>
<td>启用/停用 VoiceOver 控制选项锁定</td>
</tr>
<tr>
<td>Option-Command-8 或<br />
fn Command-F11</td>
<td>开启缩放功能</td>
</tr>
<tr>
<td>Option-Command-+</td>
<td>放大</td>
</tr>
<tr>
<td>Option-Command- -（减号）</td>
<td>缩小</td>
</tr>
<tr id="odd10">
<td>Option-Control-Command-8</td>
<td>反转/复原<a href="http://support.apple.com/kb/HT3488?viewlocale=zh_CN&amp;locale=zh_CN">屏幕颜色</a></td>
</tr>
<tr>
<td>Control Option-Command-,</td>
<td>降低对比度</td>
</tr>
<tr>
<td>Control Option-Command-.</td>
<td>增强对比度</td>
</tr>
</tbody>
</table>
<p><strong>注</strong>：您可能需要在“键盘”偏好设置中启用“将 F1、F2 等键用作标准功能键”，才能使 VoiceOver 菜单和实用工具正常工作。</p>
<p><strong><br />
万能辅助 &#8211; 鼠标键</strong></p>
<p>在“万能辅助”偏好设置中打开<a href="http://docs.info.apple.com/article.html?path=Mac/10.5/zh/8565.html">鼠标键</a>后，您便可以使用键盘或数字小键盘上的键移动鼠标指针。如果电脑没有数字小键盘，请使用 Fn（功能）键。</p>
<table id="kbtable" border="0" cellspacing="0" width="100%">
<tbody>
<tr id="header">
<td><strong>组合键</strong></td>
<td><strong>功能</strong></td>
</tr>
<tr>
<td>8</td>
<td>上移</td>
</tr>
<tr>
<td>2</td>
<td>下移</td>
</tr>
<tr>
<td>4</td>
<td>左移</td>
</tr>
<tr>
<td>6</td>
<td>右移</td>
</tr>
<tr>
<td>1</td>
<td>沿对角线向左下角移</td>
</tr>
<tr>
<td>3</td>
<td>沿对角线向右下角移</td>
</tr>
<tr>
<td>7</td>
<td>沿对角线向左上角移</td>
</tr>
<tr>
<td>9</td>
<td>沿对角线向右上角移</td>
</tr>
<tr>
<td>5</td>
<td>按鼠标按钮</td>
</tr>
<tr>
<td>0</td>
<td>按住鼠标按钮</td>
</tr>
<tr>
<td>.（数字小键盘上的句点）</td>
<td>释放按住的鼠标按钮</td>
</tr>
</tbody>
</table>
<p>另请参阅：<a href="http://docs.info.apple.com/article.html?path=Mac/10.5/zh/cdb_moskys.html">鼠标快捷键</a>。</p>
</div>
<div>
<h2>其他信息</h2>
<p><strong>高级</strong>：本文所指为默认的修饰键分配。可在系统偏好设置的“键盘与鼠标”偏好设置中更改修饰键分配。例如，您可以将 Command 键改为用作 Option 键，反之亦然。您也可以恢复默认修饰键设置。</p>
<p>另请参阅：</p>
<ul>
<li><a href="http://support.apple.com/kb/HT1192?viewlocale=zh_CN&amp;locale=zh_CN">基于 Intel 的 Apple 便携式电脑：对 Caps Lock 键进行了修改，以减少意外激活的发生</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=Mac/10.5/zh/8564.html">为应用程序创建快捷键</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=Mac/10.5/zh/8950.html">如果快捷键不能正常工作</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=Mac/10.5/zh/8425.html">如果您不能使用某些快捷键</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=Mac/10.5/zh/8557.html">使用全局快捷键</a></li>
<li><a href="http://support.apple.com/kb/HT1310?viewlocale=zh_CN&amp;locale=zh_CN">启动管理程序：如何选择启动宗卷</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=VoiceOver/1.0/en/mh2070.html">解决 VoiceOver 按键命令冲突</a></li>
<li><a href="http://docs.info.apple.com/article.html?artnum=61530">Mac OS X：控制电脑的备选方法</a></li>
<li><a href="http://support.apple.com/kb/HT2307?viewlocale=zh_CN&amp;locale=zh_CN">Mac OS X：Dock 的附加功能</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=Mac/10.5/zh/8414.html">Mac OS X：语音 &#8211; 如何为快捷键添加口述命令</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=QuickTime%20Player/7.0/zh/kbshortcuts.html">QuickTime Player：关于影片播放快捷键</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=Keynote/4.0/en/c0kn10.html">Keynote 4.0 帮助 (iWork &#8217;08)</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=Mac/10.4/en/cdb_frkybd.html">Front Row 的快捷键</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=iCal/3.0/zh/kbshortcuts.html">iCal 3 快捷键</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=iWeb/3.0/zh/keycuts.html">iWeb 3 快捷键</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=iPhoto/8.0/zh/keycuts.html">iPhoto 8 快捷键</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=iPhoto/8.0/zh/11898.html">iPhoto 8：为喜爱的关键词创建快捷键</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=GarageBand/5.0/zh/keycuts.html">GarageBand 5 快捷键</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=iMovie/8.0/zh/keycuts.html">iMovie 8 快捷键</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=iTunesMac/8.0/zh/kybd.html">iTunes 8 快捷键</a></li>
<li><a href="http://docs.info.apple.com/article.html?path=Pages/3.0/en/c0pg10.html">Pages 3 快捷键</a></li>
</ul>
</div>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2011/01/18/10448/">Mac OS X 快捷键 [zz]</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F&title=Mac+OS+X+%E5%BF%AB%E6%8D%B7%E9%94%AE+%5Bzz%5D" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F25%2F1892%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X的内存管理策略</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X刷新DNS缓存</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F30%2F734%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">OS比较形象的比较</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F11%2F07%2F25%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X竟然开源了</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F07%2F29%2F127%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Unbuntu + Mac</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2011/01/18/10448/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>怎么把Eclipse的perspective dock放到右上角？</title>
		<link>http://www.jayxu.com/2011/01/13/10426/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%2580%258e%25e4%25b9%2588%25e6%258a%258aeclipse%25e7%259a%2584perspective-dock%25e6%2594%25be%25e5%2588%25b0%25e5%258f%25b3%25e4%25b8%258a%25e8%25a7%2592%25ef%25bc%259f</link>
		<comments>http://www.jayxu.com/2011/01/13/10426/#comments</comments>
		<pubDate>Thu, 13 Jan 2011 10:29:38 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[osgi]]></category>
		<category><![CDATA[PDE]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=10426</guid>
		<description><![CDATA[Eclipse很强大，osgi很灵活，PDE扩展性很强，但是，PDE实在太huge了，加上各种各样的plugin提供的extension point，以及仅仅org.eclipse.ui提供的workbench，workbenchwindow，menumanager，coolbarmanager，toolbarmanager……文档、javadoc就够你受的。今天在修一个issue，很简单，我们实现了一个standalone的基于PDE的界面，可不知道为什么，perspective dock默认出现在了左边（图一），而用户希望出现在常见的右边（图二） 看上去很简单，但是搞了半天没有搞定，上网google，找到了这篇和这篇，结论很简单，要想把dock放到右边，得调用IWorkbenchWindowConfigurer.setShowCoolBar(true);；要拿到IWorkbenchWindowConfigurer的对象，得继承IApplication，然后继承WorkbenchAdvisor，然后继承WorkbenchWindowAdvisor，最后覆盖WorkbenchWindowAdvisor.preWindowOpen()……反正就是得搞出三个类，覆盖三个方法……虽然看着麻烦点，但是能搞定的。然而，对于非standalone的PDE应用，你是不可能继承IApplication的，因为程序入口由Eclipse接管，而不是IApplication……于是上面这些research都是白做…… 于是开始看源代码，然后静态分析上面各个方法的调用关系，最后找到了这么一个方法：WorkbenchWindow.setPerspectiveBarLocation(IWorkbenchPreferenceConstants.TOP_RIGHT);，于是把着个方法放到Activator的子类里，比如这样： public class CompActivator extends AbstractUIPlugin &#123; &#160; &#160; &#160; @Override &#160; &#160; public void start&#40;BundleContext context&#41; throws Exception &#123; &#160; &#160; &#160; &#160; super.start&#40;context&#41;; &#160; &#160; &#160; &#160; &#160; ... &#160; &#160; &#160; &#160; &#160; // put perspective dock to top-right &#160; &#160; &#160; &#160; &#40;&#40;WorkbenchWindow&#41; this.getWorkbench&#40;&#41;.getActiveWorkbenchWindow&#40;&#41;&#41; &#160; &#160; &#160; <a href="http://www.jayxu.com/2011/01/13/10426/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Apache给EJB 3.1（JSR #318）投了否决票</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim 指令图解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JScrollBar的unitIncrement和blockIncrement</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim键盘布局，中英高清带字幕</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Eclipse很强大，osgi很灵活，PDE扩展性很强，但是，PDE实在太huge了，加上各种各样的plugin提供的extension point，以及仅仅org.eclipse.ui提供的workbench，workbenchwindow，menumanager，coolbarmanager，toolbarmanager……文档、javadoc就够你受的。今天在修一个issue，很简单，我们实现了一个standalone的基于PDE的界面，可不知道为什么，perspective dock默认出现在了左边（图一），而用户希望出现在常见的右边（图二）</p>
<div id="attachment_10430" class="wp-caption alignnone" style="width: 490px"><a href="http://www.jayxu.com/log/wp-content/uploads/2011/01/left1.png"><img class="size-medium wp-image-10430" title="left" src="http://www.jayxu.com/log/wp-content/uploads/2011/01/left1-480x337.png" alt="" width="480" height="337" /></a><p class="wp-caption-text">图一</p></div>
<div id="attachment_10431" class="wp-caption alignnone" style="width: 490px"><a href="http://www.jayxu.com/log/wp-content/uploads/2011/01/right1.png"><img class="size-medium wp-image-10431" title="right" src="http://www.jayxu.com/log/wp-content/uploads/2011/01/right1-480x337.png" alt="" width="480" height="337" /></a><p class="wp-caption-text">图二</p></div>
<p>看上去很简单，但是搞了半天没有搞定，上网google，找到了<a href="http://www.eclipse.org/forums/index.php?t=thread&amp;frm_id=106" target="_blank">这篇</a>和<a href="http://www.vogella.de/articles/EclipseCommands/article.html" target="_blank">这篇</a>，结论很简单，要想把dock放到右边，得调用IWorkbenchWindowConfigurer.setShowCoolBar(true);；要拿到IWorkbenchWindowConfigurer的对象，得继承IApplication，然后继承WorkbenchAdvisor，然后继承WorkbenchWindowAdvisor，最后覆盖WorkbenchWindowAdvisor.preWindowOpen()……反正就是得搞出三个类，覆盖三个方法……虽然看着麻烦点，但是能搞定的。然而，对于非standalone的PDE应用，你是不可能继承IApplication的，因为程序入口由Eclipse接管，而不是IApplication……于是上面这些research都是白做……</p>
<p>于是开始看源代码，然后静态分析上面各个方法的调用关系，最后找到了这么一个方法：WorkbenchWindow.setPerspectiveBarLocation(IWorkbenchPreferenceConstants.TOP_RIGHT);，于是把着个方法放到Activator的子类里，比如这样：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">class</span> CompActivator <span class="kw1">extends</span> AbstractUIPlugin <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; @Override</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> start<span class="br0">&#40;</span>BundleContext context<span class="br0">&#41;</span> <span class="kw1">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">super</span>.<span class="me1">start</span><span class="br0">&#40;</span>context<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; ...</div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// put perspective dock to top-right</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span><span class="br0">&#40;</span>WorkbenchWindow<span class="br0">&#41;</span> <span class="kw1">this</span>.<span class="me1">getWorkbench</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getActiveWorkbenchWindow</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .<span class="me1">setPerspectiveBarLocation</span><span class="br0">&#40;</span>IWorkbenchPreferenceConstants.<span class="me1">TOP_RIGHT</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public class CompActivator extends AbstractUIPlugin {

    @Override
    public void start(BundleContext context) throws Exception {
        super.start(context);

        ...

        // put perspective dock to top-right
        ((WorkbenchWindow) this.getWorkbench().getActiveWorkbenchWindow())
            .setPerspectiveBarLocation(IWorkbenchPreferenceConstants.TOP_RIGHT);
    }
}</pre></div></div>

<p>p.s. 可气的是，在看源代码的过程中，IWorkbenchWindowConfigurer.setShowCoolBar(boolean)的实现里有这么一句注释（368行）：“@issue need to be able to reconfigure after window&#8217;s controls created”，MF！
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2011/01/13/10426/">怎么把Eclipse的perspective dock放到右上角？</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F&title=%E6%80%8E%E4%B9%88%E6%8A%8AEclipse%E7%9A%84perspective+dock%E6%94%BE%E5%88%B0%E5%8F%B3%E4%B8%8A%E8%A7%92%EF%BC%9F" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Apache给EJB 3.1（JSR #318）投了否决票</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim 指令图解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JScrollBar的unitIncrement和blockIncrement</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F13%2F10426%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim键盘布局，中英高清带字幕</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2011/01/13/10426/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>有关Character.isLetter()和Character.isLetterOrDigit()</title>
		<link>http://www.jayxu.com/2010/12/10/10324/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%259c%2589%25e5%2585%25b3character-isletter%25e5%2592%258ccharacter-isletterordigit</link>
		<comments>http://www.jayxu.com/2010/12/10/10324/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 03:27:40 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[apache commons]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=10324</guid>
		<description><![CDATA[在项目中有时候可能需要判断输入的是否全是英文或数字，如果你不善于使用正则，JDK中提供了Character类对字符进行操作，其中的 isLetter和isLetterOrDigit方法貌似可以做到这一点。但是如果你试下下面的代码，你会失望的： System.out.println&#40;Character.isLetter&#40;'中'&#41;&#41;; System.out.println(Character.isLetter('中')); 很不幸地，Java天生提供了对unicode的支持，因此在她眼里中文也是“letter”，所以上面打印出的是true……。替代方案是，使用Apache Commons子项目中的lang库，CharUtils的isAsciiAlpha和isAsciiAlphanumberic可以帮助你只对英文字母进行判断 多说一句，commons项目是个大宝库，其中提供了大量对JDK的增强API，lang库就是对java.lang的增强，比如使用反射生成toString的ToStringBuilder，使用反射生成hashCode的HashCodeBuilder，使用反射生成equals的EqualsBuilder等等，大家可以慢慢自己发掘～ 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 有关Character.isLetter()和Character.isLetterOrDigit()<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Apache给EJB 3.1（JSR #318）投了否决票</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D2379&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Linux+Apache+PHP+MySQL服务器环境(CentOS篇) (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ycy8.net%2F2011_8192.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Character公司-回收印刷术 (@ycy8)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fdongdong.im%2F11&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">安装apache已经成功了！ (@dongdong)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fnginx-web-server&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Nginx占有率超过10% 成为屈居apache之后的第二大web服务器 (@bfya)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>在项目中有时候可能需要判断输入的是否全是英文或数字，如果你不善于使用正则，JDK中提供了<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Character.html" target="_blank">Character</a>类对字符进行操作，其中的 <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Character.html#isLetter(char)" target="_blank">isLetter</a>和<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Character.html#isLetterOrDigit(char)" target="_blank">isLetterOrDigit</a>方法貌似可以做到这一点。但是如果你试下下面的代码，你会失望的：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="kw3">Character</span>.<span class="me1">isLetter</span><span class="br0">&#40;</span><span class="st0">'中'</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">System.out.println(Character.isLetter('中'));</pre></div></div>

<p>很不幸地，Java天生提供了对unicode的支持，因此在她眼里中文也是“letter”，所以上面打印出的是true……。替代方案是，使用<a href="http://commons.apache.org/" target="_blank">Apache Commons</a>子项目中的<a href="http://commons.apache.org/lang/" target="_blank">lang</a>库，<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/CharUtils.html" target="_blank">CharUtils</a>的<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/CharUtils.html#isAsciiAlpha(char)" target="_blank">isAsciiAlpha</a>和<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/CharUtils.html#isAsciiAlphanumeric(char)" target="_blank">isAsciiAlphanumberic</a>可以帮助你只对英文字母进行判断</p>
<p>多说一句，commons项目是个大宝库，其中提供了大量对JDK的增强API，lang库就是对java.lang的增强，比如使用反射生成toString的<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/builder/ToStringBuilder.html" target="_blank">ToStringBuilder</a>，使用反射生成hashCode的<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/builder/HashCodeBuilder.html" target="_blank">HashCodeBuilder</a>，使用反射生成equals的<a href="http://commons.apache.org/lang/api-release/org/apache/commons/lang/builder/EqualsBuilder.html" target="_blank">EqualsBuilder</a>等等，大家可以慢慢自己发掘～
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/12/10/10324/">有关Character.isLetter()和Character.isLetterOrDigit()</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F&title=%E6%9C%89%E5%85%B3Character.isLetter%28%29%E5%92%8CCharacter.isLetterOrDigit%28%29" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F02%2F1899%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Apache给EJB 3.1（JSR #318）投了否决票</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D2379&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Linux+Apache+PHP+MySQL服务器环境(CentOS篇) (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ycy8.net%2F2011_8192.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Character公司-回收印刷术 (@ycy8)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fdongdong.im%2F11&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">安装apache已经成功了！ (@dongdong)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fnginx-web-server&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F12%2F10%2F10324%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Nginx占有率超过10% 成为屈居apache之后的第二大web服务器 (@bfya)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/12/10/10324/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何在Hibernate中让SQLServer使用nvarchar代替varchar</title>
		<link>http://www.jayxu.com/2010/11/23/10275/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e5%259c%25a8hibernate%25e4%25b8%25ad%25e8%25ae%25a9sqlserver%25e4%25bd%25bf%25e7%2594%25a8nvarchar%25e4%25bb%25a3%25e6%259b%25bfvarchar</link>
		<comments>http://www.jayxu.com/2010/11/23/10275/#comments</comments>
		<pubDate>Tue, 23 Nov 2010 08:19:38 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[dialect]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sqlserver]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.jayxu.com/?p=10275</guid>
		<description><![CDATA[有关SQLServer中varchar和nvarchar的区别可以直接去google。一般在中文系统中应该使用nvarchar作为字符串的对应类型，但是Hibernate中的默认实现SQLServerDialect使用了varchar。以下方法可以简单地转为使用nvarchar： 自己写一个dialect，继承SQLServerDialect，在构造器中将原先varchar类型的注册声明覆盖： registerColumnType&#40;Types.VARCHAR, &#34;nvarchar($l)&#34;&#41;; registerColumnType(Types.VARCHAR, "nvarchar($l)"); 千万注意，“$”后面的是字段长度的占位符，是“l(ength)”，而不是数字“1”（因为看hibernate的doc时没分清“l”和“1”，浪费了我一上午去找原因） 然后在hibernate的配置文件中将hibernate.dialect的值设为你的dialect实现类就OK了 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 如何在Hibernate中让SQLServer使用nvarchar代替varchar<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F15%2F13164%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">About save/persist, update/merge in JPA/Hibernate</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F06%2F09%2F2342%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Spring之Hibernate+JBoss Treecache实现Hibernate集群</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F24%2F10280%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">谨慎升级至Hibernate 3.6</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">小心Derby的ResultSet陷阱</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fsql-wordpress-keywords&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL 查询包含某些文字的内容 如wordpress查询所有带图片的文章 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1967&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">用过SQL语句获取织梦DedeCMS每个栏目各有多少文章 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2Farchives%2F173.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL语句导入导出大全 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D316&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">利用SQL语句删除或修改织梦DedeCms数据库内容 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>有关SQLServer中varchar和nvarchar的区别可以直接去google。一般在中文系统中应该使用nvarchar作为字符串的对应类型，但是Hibernate中的默认实现SQLServerDialect使用了varchar。以下方法可以简单地转为使用nvarchar：</p>
<p>自己写一个dialect，继承SQLServerDialect，在构造器中将原先varchar类型的注册声明覆盖：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1">registerColumnType<span class="br0">&#40;</span><span class="kw3">Types</span>.<span class="me1">VARCHAR</span>, <span class="st0">&quot;nvarchar($l)&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">registerColumnType(Types.VARCHAR, "nvarchar($l)");</pre></div></div>

<p>千万注意，“$”后面的是字段长度的占位符，是“l(ength)”，而不是数字“1”（因为看hibernate的doc时没分清“l”和“1”，浪费了我一上午去找原因）</p>
<p>然后在hibernate的配置文件中将hibernate.dialect的值设为你的dialect实现类就OK了
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/11/23/10275/">如何在Hibernate中让SQLServer使用nvarchar代替varchar</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F&title=%E5%A6%82%E4%BD%95%E5%9C%A8Hibernate%E4%B8%AD%E8%AE%A9SQLServer%E4%BD%BF%E7%94%A8nvarchar%E4%BB%A3%E6%9B%BFvarchar" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F15%2F13164%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">About save/persist, update/merge in JPA/Hibernate</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F06%2F09%2F2342%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Spring之Hibernate+JBoss Treecache实现Hibernate集群</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F24%2F10280%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">谨慎升级至Hibernate 3.6</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">小心Derby的ResultSet陷阱</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fsql-wordpress-keywords&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL 查询包含某些文字的内容 如wordpress查询所有带图片的文章 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1967&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">用过SQL语句获取织梦DedeCMS每个栏目各有多少文章 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2Farchives%2F173.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL语句导入导出大全 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D316&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">利用SQL语句删除或修改织梦DedeCms数据库内容 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/11/23/10275/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>有关使用asadmin启动Glassfish的问题</title>
		<link>http://www.jayxu.com/2010/10/19/2480/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%259c%2589%25e5%2585%25b3%25e4%25bd%25bf%25e7%2594%25a8asadmin%25e5%2590%25af%25e5%258a%25a8glassfish%25e7%259a%2584%25e9%2597%25ae%25e9%25a2%2598</link>
		<comments>http://www.jayxu.com/2010/10/19/2480/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 06:24:06 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://jayxu.com/?p=2480</guid>
		<description><![CDATA[这个问题是在我们之前的一个项目中发现的，在这里与大家分享 一般在命令行下启动glassfish（3.0.x）有两种方法： 先进入asadmin模式：${glassfish_home}/bin/asadmin。然后使用start-domain 直接执行：${glassfish_home}/bin/asadmin start-domain domain1 对于第一种做法，会有一个很严重的问题：当使用ssh连接至远程主机，进入asadmin并执行start-domain后，如果没有在asadmin模式下执行exit退出（并显示“Command multimode executed successfully.”）而直接关闭ssh进程（直接kill、关闭console窗口或logout），会导致glassfish服务器终止（即使start-domain已成功），此问题已被稳定重现 因此，在这里提出建议：尽量使用第二种方法启动glassfish服务器；若使用第一种方法启动，请确保退出ssh进程前在asadmin下执行exit命令 针对glassfish版本：3.0.0及3.0.1 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 有关使用asadmin启动Glassfish的问题<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F10%2F2412%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在CLI下更新Glassfish</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Which GlassFish version is right for me? [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F27%2F2424%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关PWC4011: Unable to set request character encoding to UTF-8</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何让Netbeans以英文模式启动</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim 指令图解</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fwindows8-download-install-question-solve.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Windows 8 官方下载及安装问题解决汇总{动态更新} (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fie9-install-question-solve.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IE9 安装程序无法启动解决方法以及已知问题解决方法 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3602&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">A5优化小组：优化论坛需要注意哪些问题 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fie6ie7-z-index-not-work&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IE6/IE7 position:relative/absolute z-index失效问题css bug (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3513&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">浅析网站使用百度分享按钮的几个问题 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Courier New'} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px 'Courier New'; min-height: 15.0px} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; min-height: 15.0px} li.li3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial} ul.ul1 {list-style-type: disc} -->这个问题是在我们之前的一个项目中发现的，在这里与大家分享</p>
<p>一般在命令行下启动glassfish（3.0.x）有两种方法：</p>
<ul>
<li>先进入asadmin模式：${glassfish_home}/bin/asadmin。然后使用start-domain</li>
<li>直接执行：${glassfish_home}/bin/asadmin start-domain domain1</li>
</ul>
<p>对于第一种做法，会有一个很严重的问题：当使用ssh连接至远程主机，进入asadmin并执行start-domain后，如果没有在asadmin模式下执行exit退出（并显示“Command multimode executed successfully.”）而直接关闭ssh进程（直接kill、关闭console窗口或logout），会导致glassfish服务器终止（即使start-domain已成功），此问题已被稳定重现</p>
<p>因此，在这里提出建议：尽量使用第二种方法启动glassfish服务器；若使用第一种方法启动，请确保退出ssh进程前在asadmin下执行exit命令</p>
<p>针对glassfish版本：3.0.0及3.0.1
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/10/19/2480/">有关使用asadmin启动Glassfish的问题</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F&title=%E6%9C%89%E5%85%B3%E4%BD%BF%E7%94%A8asadmin%E5%90%AF%E5%8A%A8Glassfish%E7%9A%84%E9%97%AE%E9%A2%98" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F10%2F2412%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在CLI下更新Glassfish</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F07%2F18%2F1570%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Which GlassFish version is right for me? [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F09%2F27%2F2424%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关PWC4011: Unable to set request character encoding to UTF-8</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何让Netbeans以英文模式启动</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim 指令图解</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fwindows8-download-install-question-solve.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Windows 8 官方下载及安装问题解决汇总{动态更新} (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fie9-install-question-solve.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IE9 安装程序无法启动解决方法以及已知问题解决方法 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3602&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">A5优化小组：优化论坛需要注意哪些问题 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fie6ie7-z-index-not-work&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IE6/IE7 position:relative/absolute z-index失效问题css bug (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3513&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">浅析网站使用百度分享按钮的几个问题 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/10/19/2480/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>误区！double类型做加减法不会有误差？</title>
		<link>http://www.jayxu.com/2010/08/25/2401/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e8%25af%25af%25e5%258c%25ba%25ef%25bc%2581double%25e7%25b1%25bb%25e5%259e%258b%25e5%2581%259a%25e5%258a%25a0%25e5%2587%258f%25e6%25b3%2595%25e4%25b8%258d%25e4%25bc%259a%25e6%259c%2589%25e8%25af%25af%25e5%25b7%25ae%25ef%25bc%259f</link>
		<comments>http://www.jayxu.com/2010/08/25/2401/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 02:36:08 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://jayxu.com/?p=2401</guid>
		<description><![CDATA[如果你跟我一样以为Java的double类型只有在作乘除法时才会出现误差，那试一下在Java里执行一下下面的代码： public static void &#160;main&#40;String&#91;&#93; args&#41; &#123; &#160; &#160; System.out.println&#40;44.42 + 710.79 + 44.42 + &#160;88.85&#41;; &#125; public static void main(String[] args) { System.out.println(44.42 + 710.79 + 44.42 + 88.85); } 执行前先猜一下结果，是会输出888.48么？还是……？ 建议：对于和钱有关的计算，不论加减乘除，统一使用 BigDecimal！ 然而不多久之后同事告诉我另一个BigDecimal的问题，试一下下面的代码： System.out.println&#40;new BigDecimal&#40;0.99&#41;.setScale&#40;2, RoundingMode.DOWN&#41;.toString&#40;&#41;&#41;; System.out.println(new BigDecimal(0.99).setScale(2, RoundingMode.DOWN).toString()); 结果是令人发指的0.98！ 看了一下 BigDecimal(double)的源码，其中使用位操作分别提取了0.99浮点值的整数部分和纯小数部分，或者说是2的正数次幂和负数次幂部分。而这样提取出来的值纯小数部分本身就是近似的，与直接使用double类型没有本质区别，这是浮点表示法决定的，再经过2位截取后就产生了误差 而当使用BigDecimal(String)的构造器时得到的是精确值，因为该构造器将数字使用科学计数法表示，即 0.99表示为99*10^-2，这样做运算时先对齐至相同的整数位再进行计算 因此，对上面的补充是：如果要获取最精确的结果，请使用BD+字符串类型的构造器 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 误区！double类型做加减法不会有误差？<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JScrollBar的unitIncrement和blockIncrement</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>如果你跟我一样以为Java的double类型只有在作乘除法时才会出现误差，那试一下在Java里执行一下下面的代码：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> &nbsp;main<span class="br0">&#40;</span><span class="kw3">String</span><span class="br0">&#91;</span><span class="br0">&#93;</span> args<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="nu0">44.42</span> <span class="sy0">+</span> <span class="nu0">710.79</span> <span class="sy0">+</span> <span class="nu0">44.42</span> <span class="sy0">+</span> &nbsp;<span class="nu0">88.85</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public static void  main(String[] args) {
    System.out.println(44.42 + 710.79 + 44.42 +  88.85);
}</pre></div></div>

<p>执行前先猜一下结果，是会输出888.48么？还是……？</p>
<blockquote><p>建议：对于和钱有关的计算，不论加减乘除，统一使用 BigDecimal！</p></blockquote>
<p>然而不多久之后同事告诉我另一个BigDecimal的问题，试一下下面的代码：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw3">System</span>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="kw1">new</span> <span class="kw3">BigDecimal</span><span class="br0">&#40;</span><span class="nu0">0.99</span><span class="br0">&#41;</span>.<span class="me1">setScale</span><span class="br0">&#40;</span><span class="nu0">2</span>, RoundingMode.<span class="me1">DOWN</span><span class="br0">&#41;</span>.<span class="me1">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">System.out.println(new BigDecimal(0.99).setScale(2, RoundingMode.DOWN).toString());</pre></div></div>

<p>结果是令人发指的0.98！</p>
<p>看了一下 BigDecimal(double)的源码，其中使用位操作分别提取了0.99浮点值的整数部分和纯小数部分，或者说是2的正数次幂和负数次幂部分。而这样提取出来的值纯小数部分本身就是近似的，与直接使用double类型没有本质区别，这是浮点表示法决定的，再经过2位截取后就产生了误差</p>
<p>而当使用BigDecimal(String)的构造器时得到的是精确值，因为该构造器将数字使用科学计数法表示，即 0.99表示为99*10^-2，这样做运算时先对齐至相同的整数位再进行计算</p>
<blockquote><p>因此，对上面的补充是：如果要获取最精确的结果，请使用BD+字符串类型的构造器</p></blockquote>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/08/25/2401/">误区！double类型做加减法不会有误差？</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&title=%E8%AF%AF%E5%8C%BA%EF%BC%81double%E7%B1%BB%E5%9E%8B%E5%81%9A%E5%8A%A0%E5%87%8F%E6%B3%95%E4%B8%8D%E4%BC%9A%E6%9C%89%E8%AF%AF%E5%B7%AE%EF%BC%9F" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JScrollBar的unitIncrement和blockIncrement</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/08/25/2401/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring之经验教训（一）</title>
		<link>http://www.jayxu.com/2010/07/18/2373/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=spring%25e4%25b9%258b%25e7%25bb%258f%25e9%25aa%258c%25e6%2595%2599%25e8%25ae%25ad%25ef%25bc%2588%25e4%25b8%2580%25ef%25bc%2589</link>
		<comments>http://www.jayxu.com/2010/07/18/2373/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 17:27:24 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[aop]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[struts]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[transaction]]></category>
		<category><![CDATA[依赖注入]]></category>

		<guid isPermaLink="false">http://jayxu.com/?p=2373</guid>
		<description><![CDATA[在现在的项目中我们使用了spring + hibernate + struts的架构，在享受aop, orm, ioc, di带来的种种便利的同时，我们亦遇到了很多莫名其妙或者说刻骨铭心的教训，今天先整理两点，日后继续补充 经验一：时刻牢记，spring、hibernate对对象 进行了动态代理，尽量不要试图在动态代理后的对象上进行反射，尤其是field！ 不管是hibernate的orm还是spring的声明式事务管理，都对原来的pojo、dao进行了动态代理。虽然s、h&#8220;号称&#8221;动态代理做得天衣无缝且无色无味，但是，那只是在&#8220;绝大多数情况下&#8221;，如果想对动态代理后的对象进行反射，麻烦便来了，代码片段： public static void setCreditInfoStatus&#40;CreditInfo info, CreditType type, CreditValidateStatus status&#41; &#123; &#160; &#160; ... &#160; &#160; &#160; Field&#91;&#93; fields = CreditInfo.class.getDeclaredFields&#40;&#41;; &#160; &#160; &#160; for &#40;Field f : fields&#41; &#123; &#160; &#160; &#160; &#160; if &#40;f.isAnnotationPresent&#40;Credit.class&#41; &#38;&#38; f.getAnnotation&#40;Credit.class&#41;.value&#40;&#41; == type&#41; &#123; &#160; &#160; &#160; &#160; <a href="http://www.jayxu.com/2010/07/18/2373/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">使用Spring LDAP ODM操作LDAP</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F06%2F09%2F2342%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Spring之Hibernate+JBoss Treecache实现Hibernate集群</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F01%2F12%2F13221%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">解决Velocity＋Spring的中文乱码问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Hibernate中让SQLServer使用nvarchar代替varchar</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2F%3Fp%3D238&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">注入语句 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fspring-flowers-message-block-information.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">春之信息花器留言座 [意外中秋礼物] (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D970&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">善用百度经验获取高质量外链 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fspring-party&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">四年一宴 —— 安妮宝贝《春宴》书评 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2Farchives%2F163.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">WordPress Photoracer插件id参数SQL注入漏洞 (@swhack)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>在现在的项目中我们使用了spring + hibernate + struts的架构，在享受aop, orm, ioc, di带来的种种便利的同时，我们亦遇到了很多莫名其妙或者说刻骨铭心的教训，今天先整理两点，日后继续补充</p>
<h4>经验一：时刻牢记，spring、hibernate对对象 进行了动态代理，尽量不要试图在动态代理后的对象上进行反射，尤其是field！</h4>
<p>不管是hibernate的orm还是spring的声明式事务管理，都对原来的pojo、dao进行了动态代理。虽然s、h&ldquo;号称&rdquo;动态代理做得天衣无缝且无色无味，但是，那只是在&ldquo;绝大多数情况下&rdquo;，如果想对动态代理后的对象进行反射，麻烦便来了，代码片段：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> setCreditInfoStatus<span class="br0">&#40;</span>CreditInfo info, CreditType type, CreditValidateStatus status<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; ...</div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw3">Field</span><span class="br0">&#91;</span><span class="br0">&#93;</span> fields <span class="sy0">=</span> CreditInfo.<span class="kw1">class</span>.<span class="me1">getDeclaredFields</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw3">Field</span> f <span class="sy0">:</span> fields<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>f.<span class="me1">isAnnotationPresent</span><span class="br0">&#40;</span>Credit.<span class="kw1">class</span><span class="br0">&#41;</span> <span class="sy0">&amp;&amp;</span> f.<span class="me1">getAnnotation</span><span class="br0">&#40;</span>Credit.<span class="kw1">class</span><span class="br0">&#41;</span>.<span class="me1">value</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">==</span> type<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">PropertyDescriptor</span> pd <span class="sy0">=</span> BeanUtils.<span class="me1">getPropertyDescriptor</span><span class="br0">&#40;</span>CreditInfo.<span class="kw1">class</span>, f.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>pd <span class="sy0">!=</span> <span class="kw2">null</span><span class="br0">&#41;</span> &nbsp;<span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ...</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public static void setCreditInfoStatus(CreditInfo info, CreditType type, CreditValidateStatus status) {
    ...

    Field[] fields = CreditInfo.class.getDeclaredFields();

    for (Field f : fields) {
        if (f.isAnnotationPresent(Credit.class) &amp;&amp; f.getAnnotation(Credit.class).value() == type) {
            PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(CreditInfo.class, f.getName());
            if (pd != null)  {
                ...
            }
            break;
        }
    }
}</pre></div></div>

<p>原先第7行写为 info.getClass()，乍一看与现有的代码功能上是一样的，但是别忘了让人又恨又爱的动态代理！上面代码返回的是真正的CreditInfo class，而左边的返回的是动态代理后的class，即意味着，第一个&ldquo;if&rdquo;永远返回的是false，除非动态代理后的对象的field上附带了原有的annotation</p>
<h4>经验二：spring的声明式事务管理确很强大，强大到可以支持多线程，但是，结合上一点，不要在线程中调用this中的事务方法</h4>
<p>声明式事务，即spring中使用aop织入或 @Transactional标记的方法注入事务容器，码农们可以完全不用操心何时begin，何时commit，何时 rollback，有没有嵌套，绝对傻瓜级的编程模型。但是，牢记，spring中的aop、annotation都是使用动态代理实现的，即，如果没有经过动态代理便也没有了事务管理，代码片段：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">class</span> AutomatedService<span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; ...</div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="me1">loanQueue</span>.<span class="me1">execute</span><span class="br0">&#40;</span><span class="kw1">new</span> <span class="kw3">Runnable</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; @Override</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">public</span> <span class="kw4">void</span> run<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">Thread</span> thread <span class="sy0">=</span> &nbsp;<span class="kw3">Thread</span>.<span class="me1">currentThread</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span><span class="sy0">!</span>thread.<span class="me1">isInterrupted</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">try</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loanService.<span class="me1">checkNSetLoanStatus</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw3">Thread</span>.<span class="me1">sleep</span><span class="br0">&#40;</span>loanStatusCheckIntervalMinutes <span class="sy0">*</span> Consts.<span class="me1">ONE_MINUTE</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span><span class="kw3">InterruptedException</span> ex<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; thread.<span class="me1">interrupt</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; ...</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public class AutomatedService{
    ...

    loanQueue.execute(new Runnable() {

        @Override
        public void run() {
            Thread thread =  Thread.currentThread();

            while (!thread.isInterrupted()) {
                try {
                    loanService.checkNSetLoanStatus();

                    Thread.sleep(loanStatusCheckIntervalMinutes * Consts.ONE_MINUTE);
                } catch (InterruptedException ex) {
                    thread.interrupt();
                }
            }
        }
    });

    ...
}</pre></div></div>

<p>原先的checkNSetLoanStatus方法是定义在AutomatedService中的，且标记了@Transactional。 但是，令人发指的是，checkNSetLoanStatus中的事务没有被提交。在痛定思痛仔细回想了spring的声明式事务的本质后，豁然发现当调用this.checkNSetLoanStatus()时，并没有被织入事务管理。spring还没有霸道到或者说聪明到对this进行动态代理，于是将该方法移至其它service并注入，问题解决</p>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/07/18/2373/">Spring之经验教训（一）</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F&title=Spring%E4%B9%8B%E7%BB%8F%E9%AA%8C%E6%95%99%E8%AE%AD%EF%BC%88%E4%B8%80%EF%BC%89" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F12%2F14%2F13131%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">使用Spring LDAP ODM操作LDAP</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F06%2F09%2F2342%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Spring之Hibernate+JBoss Treecache实现Hibernate集群</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F01%2F12%2F13221%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">解决Velocity＋Spring的中文乱码问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F11%2F23%2F10275%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Hibernate中让SQLServer使用nvarchar代替varchar</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2F%3Fp%3D238&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">注入语句 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fspring-flowers-message-block-information.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">春之信息花器留言座 [意外中秋礼物] (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D970&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">善用百度经验获取高质量外链 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fspring-party&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">四年一宴 —— 安妮宝贝《春宴》书评 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2Farchives%2F163.html&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F07%2F18%2F2373%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">WordPress Photoracer插件id参数SQL注入漏洞 (@swhack)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/07/18/2373/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>vim键盘布局，中英高清带字幕</title>
		<link>http://www.jayxu.com/2010/04/14/2124/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=vim%25e9%2594%25ae%25e7%259b%2598%25e5%25b8%2583%25e5%25b1%2580%25ef%25bc%258c%25e4%25b8%25ad%25e8%258b%25b1%25e9%25ab%2598%25e6%25b8%2585%25e5%25b8%25a6%25e5%25ad%2597%25e5%25b9%2595</link>
		<comments>http://www.jayxu.com/2010/04/14/2124/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 03:11:19 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://jayxu.com/?p=2124</guid>
		<description><![CDATA[原创内容，转载请注明： 转载自拈花微笑 本文链接地址: vim键盘布局，中英高清带字幕<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim 指令图解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F08%2F11701%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Learn Vim Progressively</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Linux下设置ntp服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fchmod-all-files&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">linux chmod 文件夹中所有文件改为777的权限 命令 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Flinux-ftp-command&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Linux 下FTP命令 指令大全 详解 及使用技巧 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Flinux-download-command&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">linux 下用命令行下载文件的方法 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Flinux-search-string&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">linux 命令 搜索所有源文件是否包含指定字符串 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Frtl8191se-linux-driver&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">瑞昱 RTL8191SE Wireless LAN 802.11N PCI-E NIC (RTL8192SE) Linux/BT3/BT4 下安装驱动 (@bfya)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p><a href="http://jayxu.com/log/wp-content/uploads/2010/04/vi-vim-cheat-sheet.gif"><img class="alignnone size-medium wp-image-2125" title="vi-vim-cheat-sheet" src="http://jayxu.com/log/wp-content/uploads/2010/04/vi-vim-cheat-sheet-480x339.gif" alt="" width="480" height="339" /></a></p>
<p><a href="http://jayxu.com/log/wp-content/uploads/2010/04/vim_go.png"><img class="alignnone size-medium wp-image-2126" title="vim_go" src="http://jayxu.com/log/wp-content/uploads/2010/04/vim_go-480x338.png" alt="" width="480" height="338" /></a>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/04/14/2124/">vim键盘布局，中英高清带字幕</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F&title=vim%E9%94%AE%E7%9B%98%E5%B8%83%E5%B1%80%EF%BC%8C%E4%B8%AD%E8%8B%B1%E9%AB%98%E6%B8%85%E5%B8%A6%E5%AD%97%E5%B9%95" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim 指令图解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F08%2F11701%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Learn Vim Progressively</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Linux下设置ntp服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fchmod-all-files&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">linux chmod 文件夹中所有文件改为777的权限 命令 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Flinux-ftp-command&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Linux 下FTP命令 指令大全 详解 及使用技巧 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Flinux-download-command&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">linux 下用命令行下载文件的方法 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Flinux-search-string&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">linux 命令 搜索所有源文件是否包含指定字符串 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Frtl8191se-linux-driver&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">瑞昱 RTL8191SE Wireless LAN 802.11N PCI-E NIC (RTL8192SE) Linux/BT3/BT4 下安装驱动 (@bfya)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/04/14/2124/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>有关64位Snow Leopard</title>
		<link>http://www.jayxu.com/2010/03/30/2104/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e6%259c%2589%25e5%2585%25b364%25e4%25bd%258dsnow-leopard</link>
		<comments>http://www.jayxu.com/2010/03/30/2104/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 05:24:29 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[生活]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[snow leopard]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://jayxu.com/2010/03/30/2104/</guid>
		<description><![CDATA[这篇小tip一直想写，却一直懒得写，今天补上 64位的好处？ 谷歌一下你会知道得更多 SL的默认设置？ 默认以64位兼容模式启动，即内核为32位，但兼容64位应用程序 如何获知你的内核是跑在32位还是64位下？ 打开活动监视器，找到“kernal_task”，看“种类”一列（没有的话加上）是否是“Intel（64位）” 如何知道你的系统是否支持64位？ 根据这篇post，可以使用如下命令： ioreg -l -p IODeviceTree &#124; grep firmware-abi ioreg -l -p IODeviceTree &#124; grep firmware-abi 如何在启动时在32位与64位之间切换？ 启动时按住“3”和“2”键或“6”和“4”键（超赞apple这种灵光），但是需要注意，只在本次启动有效，重启后将回到之前的模式 如何使内核一直以64位启动？ 根据这篇post，使用如下命令： nvram boot-args=&#34;arch=x86_64&#34; nvram boot-args="arch=x86_64" 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 有关64位Snow Leopard<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F08%2F24%2F1711%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Snow Leopard终于要来了~~</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Snow Leopard下的JDK链接有问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F30%2F1487%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Leopard下的RSS Visualizer（屏保）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F10%2F29%2F26%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Leopard入驻</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F03%2F1730%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Bootcamp 3.0 torrent</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>这篇小tip一直想写，却一直懒得写，今天补上</p>
<h3>64位的好处？</h3>
<p>谷歌一下你会知道得更多</p>
<h3>SL的默认设置？</h3>
<p>默认以64位兼容模式启动，即内核为32位，但兼容64位应用程序</p>
<h3>如何获知你的内核是跑在32位还是64位下？</h3>
<p>打开活动监视器，找到“kernal_task”，看“种类”一列（没有的话加上）是否是“Intel（64位）”</p>
<h3>如何知道你的系统是否支持64位？</h3>
<p>根据<a href="http://www.zdnet.com/blog/apple/will-your-mac-boot-64-bit-snow-leopard-by-default-not-unless-its-an-xserve/4712" target="_blank">这篇</a>post，可以使用如下命令：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="bash"><ol><li class="li1"><div class="de1">ioreg <span class="re5">-l</span> <span class="re5">-p</span> IODeviceTree <span class="sy0">|</span> <span class="kw2">grep</span> firmware-abi</div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">ioreg -l -p IODeviceTree | grep firmware-abi</pre></div></div>

<h3>如何在启动时在32位与64位之间切换？</h3>
<p>启动时按住“3”和“2”键或“6”和“4”键（超赞apple这种灵光），但是需要注意，只在本次启动有效，重启后将回到之前的模式</p>
<h3>如何使内核一直以64位启动？</h3>
<p>根据<a href="http://mygrotto.org/2009/06/boot-64-bit-snow-leopard-kernel/" target="_blank">这篇</a>post，使用如下命令：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="bash"><ol><li class="li1"><div class="de1">nvram boot-args=<span class="st0">&quot;arch=x86_64&quot;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">nvram boot-args="arch=x86_64"</pre></div></div>

<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/03/30/2104/">有关64位Snow Leopard</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F&title=%E6%9C%89%E5%85%B364%E4%BD%8DSnow+Leopard" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F08%2F24%2F1711%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Snow Leopard终于要来了~~</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F01%2F26%2F2031%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Snow Leopard下的JDK链接有问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F04%2F30%2F1487%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Leopard下的RSS Visualizer（屏保）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F10%2F29%2F26%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Leopard入驻</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F03%2F1730%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F30%2F2104%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Bootcamp 3.0 torrent</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/03/30/2104/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mac OS X刷新DNS缓存</title>
		<link>http://www.jayxu.com/2010/03/08/2086/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mac-os-x%25e5%2588%25b7%25e6%2596%25b0dns%25e7%25bc%2593%25e5%25ad%2598</link>
		<comments>http://www.jayxu.com/2010/03/08/2086/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 07:04:40 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[未分类]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://jayxu.com/?p=2086</guid>
		<description><![CDATA[在命令行下输入： sudo dscacheutil -flushcache 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: Mac OS X刷新DNS缓存<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac 下快速切换显示隐藏文件的 widget</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X 快捷键 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F07%2F29%2F127%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Unbuntu + Mac</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F11%2F07%2F25%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X竟然开源了</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1423%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">推荐一款mac下的文本编辑器</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fmac-os-secret-socks&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SECRET SOCKS 苹果官网 软件 MAC OS 设置 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F908&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Skype 5.4 for Mac开始支持Facebook聊天 (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2F%3Fp%3D85&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">VMware曝漏洞:Windows虚拟机可攻击Mac主机 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3349&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">谷歌Chrome OS将成为Windows杀手的五个理由 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwest263-dns-refund&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">西部数码 域名 DNS管理 退款经历 记录 (@bfya)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>在命令行下输入：</p>
<blockquote><p>sudo dscacheutil -flushcache</p></blockquote>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2010/03/08/2086/">Mac OS X刷新DNS缓存</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F&title=Mac+OS+X%E5%88%B7%E6%96%B0DNS%E7%BC%93%E5%AD%98" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac 下快速切换显示隐藏文件的 widget</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X 快捷键 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F07%2F29%2F127%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Unbuntu + Mac</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F11%2F07%2F25%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X竟然开源了</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1423%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">推荐一款mac下的文本编辑器</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fmac-os-secret-socks&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SECRET SOCKS 苹果官网 软件 MAC OS 设置 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.wolfherder.com%2Farchives%2F908&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Skype 5.4 for Mac开始支持Facebook聊天 (@wolfherder)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.swhack.cn%2F%3Fp%3D85&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">VMware曝漏洞:Windows虚拟机可攻击Mac主机 (@swhack)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D3349&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">谷歌Chrome OS将成为Windows杀手的五个理由 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwest263-dns-refund&from=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">西部数码 域名 DNS管理 退款经历 记录 (@bfya)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2010/03/08/2086/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何配置Tomcat数据库连接池</title>
		<link>http://www.jayxu.com/2009/12/10/1911/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e9%2585%258d%25e7%25bd%25aetomcat%25e6%2595%25b0%25e6%258d%25ae%25e5%25ba%2593%25e8%25bf%259e%25e6%258e%25a5%25e6%25b1%25a0</link>
		<comments>http://www.jayxu.com/2009/12/10/1911/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 13:24:39 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[dbcp]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/?p=1911</guid>
		<description><![CDATA[仅需修改context.xml： &#60;context path=&#34;/chinatrial&#34;&#62; &#160; &#160; &#60;resource &#160; &#160; &#160; &#160;name=&#34;jdbc/DBPool&#34; &#160; &#160; &#160; &#160;type=&#34;javax.sql.DataSource&#34; &#160; &#160; &#160; &#160;driverClassName=&#34;com.mysql.jdbc.Driver&#34; &#160; &#160; &#160; &#160;maxIdle=&#34;16&#34; &#160; &#160; &#160; &#160;minIdle=&#34;8&#34; &#160; &#160; &#160; &#160;maxActive=&#34;64&#34; &#160; &#160; &#160; &#160;initialSize=&#34;16&#34; &#160; &#160; &#160; &#160;username=&#34;root&#34; &#160; &#160; &#160; &#160;password=&#34;root&#34; &#160; &#160; &#160; &#160;poolPreparedStatements=&#34;true&#34; &#160; &#160; &#160; &#160;removeAbandoned=&#34;true&#34; &#160; &#160; &#160; &#160;removeAbandonedTimeout=&#34;60&#34; &#160; <a href="http://www.jayxu.com/2009/12/10/1911/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Tomcat 6中使用log4j</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Linux下设置ntp服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim 指令图解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim键盘布局，中英高清带字幕</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何让Netbeans以英文模式启动</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>仅需修改context.xml：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="xml"><ol><li class="li1"><div class="de1"><span class="sc3"><span class="re1">&lt;context</span> <span class="re0">path</span>=<span class="st0">&quot;/chinatrial&quot;</span><span class="re2">&gt;</span></span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;resource</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">name</span>=<span class="st0">&quot;jdbc/DBPool&quot;</span></span></div></li>
<li class="li2"><div class="de2"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">type</span>=<span class="st0">&quot;javax.sql.DataSource&quot;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">driverClassName</span>=<span class="st0">&quot;com.mysql.jdbc.Driver&quot;</span></span></div></li>
<li class="li2"><div class="de2"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">maxIdle</span>=<span class="st0">&quot;16&quot;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">minIdle</span>=<span class="st0">&quot;8&quot;</span></span></div></li>
<li class="li2"><div class="de2"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">maxActive</span>=<span class="st0">&quot;64&quot;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">initialSize</span>=<span class="st0">&quot;16&quot;</span></span></div></li>
<li class="li2"><div class="de2"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">username</span>=<span class="st0">&quot;root&quot;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">password</span>=<span class="st0">&quot;root&quot;</span></span></div></li>
<li class="li2"><div class="de2"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">poolPreparedStatements</span>=<span class="st0">&quot;true&quot;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">removeAbandoned</span>=<span class="st0">&quot;true&quot;</span></span></div></li>
<li class="li2"><div class="de2"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">removeAbandonedTimeout</span>=<span class="st0">&quot;60&quot;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">testOnBorrow</span>=<span class="st0">&quot;false &quot;</span></span></div></li>
<li class="li2"><div class="de2"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">url</span>=<span class="st0">&quot;jdbc:mysql://localhost/chinatrial&quot;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp;<span class="re0">connectionProperties</span>=<span class="st0">&quot;useUnicode=true;characterEncoding=utf-8;autoReconnect=true&quot;</span><span class="re2">&gt;</span></span></div></li>
<li class="li2"><div class="de2"><span class="sc3"><span class="re1">&lt;/context<span class="re2">&gt;</span></span></span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">&lt;context path="/chinatrial"&gt;
    &lt;resource
        name="jdbc/DBPool"
        type="javax.sql.DataSource"
        driverClassName="com.mysql.jdbc.Driver"
        maxIdle="16"
        minIdle="8"
        maxActive="64"
        initialSize="16"
        username="root"
        password="root"
        poolPreparedStatements="true"
        removeAbandoned="true"
        removeAbandonedTimeout="60"
        testOnBorrow="false "
        url="jdbc:mysql://localhost/chinatrial"
        connectionProperties="useUnicode=true;characterEncoding=utf-8;autoReconnect=true"&gt;
&lt;/context&gt;</pre></div></div>

<p>各属性的含义以及完整属性列表可参考：<a href="http://commons.apache.org/dbcp/configuration.html" target="_blank">DBCP官方文档</a>，以下是一些建议：</p>
<ul>
<li> 将连接属性配置在“ connectionProperties”中，这样可以避免对“&amp;”符号进行转义</li>
<li>配置“poolPreparedStatements”以缓存PreparedStatement对象提升性能</li>
<li>配置“removeAbandoned”和“removeAbandonedTimeout”以打开“Remove Abandoned Connection”功能。该功能会定期检查并关闭没有被close的connection，避免连接泄</li>
<li>将“testOnBorrow”设为“false”以关闭从连接池获取连接时的有效性检查</li>
</ul>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/12/10/1911/">如何配置Tomcat数据库连接池</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F&title=%E5%A6%82%E4%BD%95%E9%85%8D%E7%BD%AETomcat%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9E%E6%8E%A5%E6%B1%A0" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Tomcat 6中使用log4j</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Linux下设置ntp服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F08%2F10667%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim 指令图解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim键盘布局，中英高清带字幕</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何让Netbeans以英文模式启动</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/12/10/1911/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac 下快速切换显示隐藏文件的 widget</title>
		<link>http://www.jayxu.com/2009/09/04/1735/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mac-%25e4%25b8%258b%25e5%25bf%25ab%25e9%2580%259f%25e5%2588%2587%25e6%258d%25a2%25e6%2598%25be%25e7%25a4%25ba%25e9%259a%2590%25e8%2597%258f%25e6%2596%2587%25e4%25bb%25b6%25e7%259a%2584-widget</link>
		<comments>http://www.jayxu.com/2009/09/04/1735/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 10:16:07 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[iLife]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/09/04/1735/</guid>
		<description><![CDATA[Mac里的finder（就是“我的电脑”）默认不显示隐藏文件（夹）（即“.”开头的文件（夹）），而且也没有菜单项可以打开，有时候真的很麻烦。而hiddenfiles这个widget可以在dashboard中方便地切换是否显示隐藏文件（夹），唯一的瑕疵就是切换后会自动重启finder。可以从apple官方网站下载 补：根据applewoods这篇文章的介绍，从雪豹开始，在“打开”或“存储”对话框中，只要按下 Shift-Command-. 便可显示隐藏文件（夹） 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: Mac 下快速切换显示隐藏文件的 widget<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X刷新DNS缓存</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X 快捷键 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F07%2F29%2F127%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Unbuntu + Mac</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F11%2F07%2F25%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X竟然开源了</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F21%2F11337%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac Lion BT</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Mac里的finder（就是“我的电脑”）默认不显示隐藏文件（夹）（即“.”开头的文件（夹）），而且也没有菜单项可以打开，有时候真的很麻烦。而hiddenfiles这个widget可以在dashboard中方便地切换是否显示隐藏文件（夹），唯一的瑕疵就是切换后会自动重启finder。可以从apple官方网站<a href="http://www.apple.com/downloads/dashboard/developer/hiddenfiles.html" target="_blank">下载</a></p>
<p>补：根据applewoods<a href="http://applewoods.org/archives/2009/09/snow_leopard_hidden_file.php" target="_blank">这篇</a>文章的介绍，从雪豹开始，在“打开”或“存储”对话框中，只要按下 <tt>Shift-Command-.</tt> 便可显示隐藏文件（夹）
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/09/04/1735/">Mac 下快速切换显示隐藏文件的 widget</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F&title=Mac+%E4%B8%8B%E5%BF%AB%E9%80%9F%E5%88%87%E6%8D%A2%E6%98%BE%E7%A4%BA%E9%9A%90%E8%97%8F%E6%96%87%E4%BB%B6%E7%9A%84+widget" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F03%2F08%2F2086%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X刷新DNS缓存</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F18%2F10448%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X 快捷键 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F07%2F29%2F127%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Unbuntu + Mac</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2007%2F11%2F07%2F25%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac OS X竟然开源了</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F07%2F21%2F11337%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F09%2F04%2F1735%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Mac Lion BT</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/09/04/1735/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何让Netbeans以英文模式启动</title>
		<link>http://www.jayxu.com/2009/03/16/1449/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e8%25ae%25a9netbeans%25e4%25bb%25a5%25e8%258b%25b1%25e6%2596%2587%25e6%25a8%25a1%25e5%25bc%258f%25e5%2590%25af%25e5%258a%25a8</link>
		<comments>http://www.jayxu.com/2009/03/16/1449/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 12:51:40 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/03/16/1449/</guid>
		<description><![CDATA[不得不承认，Sun在Java及其周边产品的本地化上下了很大的功夫，比如中文版的Javadoc，NB，GlassFish……但是，Sun不得不承认的是，这些本地化尤其是后两个做得太TM狗屎了。每次新装Sun为我们“精心准备”的130+ MB的“中文版”的、菜单参杂着中英文的NB时我就想骂街。之前自己摸索了一种方法把版本强制转换为英文，就是到NB的安装目录下，搜索*zh_CN.jar，能搜到一堆的L10N的jar包，然后全部删了就好了。后来小权提供了一个更方便的招：打开NB安装目录下etc/netbeans.conf文件，在“netbeans_default_options=”最后（引号内）加上 --locale en_US --locale en_US 重启NB，整个世界都清净了~~ 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 如何让Netbeans以英文模式启动<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关使用asadmin启动Glassfish的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Linux下设置ntp服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim键盘布局，中英高清带字幕</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">小心Derby的ResultSet陷阱</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>不得不承认，Sun在Java及其周边产品的本地化上下了很大的功夫，比如中文版的Javadoc，NB，GlassFish……但是，Sun不得不承认的是，这些本地化尤其是后两个做得太TM狗屎了。每次新装Sun为我们“精心准备”的130+ MB的“中文版”的、菜单参杂着中英文的NB时我就想骂街。之前自己摸索了一种方法把版本强制转换为英文，就是到NB的安装目录下，搜索*zh_CN.jar，能搜到一堆的L10N的jar包，然后全部删了就好了。后来小权提供了一个更方便的招：打开NB安装目录下etc/netbeans.conf文件，在“netbeans_default_options=”最后（引号内）加上</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="sy0">--</span>locale en_US</div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">--locale en_US</pre></div></div>

<p>重启NB，整个世界都清净了~~
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/03/16/1449/">如何让Netbeans以英文模式启动</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F&title=%E5%A6%82%E4%BD%95%E8%AE%A9Netbeans%E4%BB%A5%E8%8B%B1%E6%96%87%E6%A8%A1%E5%BC%8F%E5%90%AF%E5%8A%A8" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F10%2F19%2F2480&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关使用asadmin启动Glassfish的问题</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Linux下设置ntp服务</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim键盘布局，中英高清带字幕</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F16%2F1449%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">小心Derby的ResultSet陷阱</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/03/16/1449/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java RMI中的NoSuchObjectException</title>
		<link>http://www.jayxu.com/2009/03/02/1425/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=java-rmi%25e4%25b8%25ad%25e7%259a%2584nosuchobjectexception</link>
		<comments>http://www.jayxu.com/2009/03/02/1425/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 03:08:17 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[rmi]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/03/02/1425/</guid>
		<description><![CDATA[最近项目里的RMI在Linux下运行老出问题，而且问题出得还很不稳定。那个程序启动时会分别在4个端口上绑定4个相同的对象，结果就是有时绑定成功3个，有时候才1个……查看log，抛出下面异常 java.rmi.NoSuchObjectException: no such object in table 上网搜了一下，这篇文章给出了原因和解决方法：我在代码中做RMI绑定的时候用的是局部变量： registry.rebind&#40;name, UnicastRemoteObject.exportObject&#40;new RemoteObject&#40;&#41;, 0&#41;&#41;; registry.rebind(name, UnicastRemoteObject.exportObject(new RemoteObject(), 0)); 该局部变量在服务器端被GC后客户端再远程调用方法便会抛出上述异常。解决方法很简单，使用对远程对象的强引用以防止对象被GC，比如把局部引用改为类静态引用 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: Java RMI中的NoSuchObjectException<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最近项目里的RMI在Linux下运行老出问题，而且问题出得还很不稳定。那个程序启动时会分别在4个端口上绑定4个相同的对象，结果就是有时绑定成功3个，有时候才1个……查看log，抛出下面异常</p>
<blockquote><p>java.rmi.NoSuchObjectException: no such object in table</p></blockquote>
<p>上网搜了一下，<a href="http://forums.oracle.com" target="_blank">这篇</a>文章给出了原因和解决方法：我在代码中做RMI绑定的时候用的是局部变量：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1">registry.<span class="me1">rebind</span><span class="br0">&#40;</span>name, <span class="kw3">UnicastRemoteObject</span>.<span class="me1">exportObject</span><span class="br0">&#40;</span><span class="kw1">new</span> <span class="kw3">RemoteObject</span><span class="br0">&#40;</span><span class="br0">&#41;</span>, <span class="nu0">0</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">registry.rebind(name, UnicastRemoteObject.exportObject(new RemoteObject(), 0));</pre></div></div>

<p>该局部变量在服务器端被GC后客户端再远程调用方法便会抛出上述异常。解决方法很简单，使用对远程对象的强引用以防止对象被GC，比如把局部引用改为类静态引用
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/03/02/1425/">Java RMI中的NoSuchObjectException</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&title=Java+RMI%E4%B8%AD%E7%9A%84NoSuchObjectException" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F09%2F26%2F11723%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">X and XX Usgaes for Java</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/03/02/1425/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在Tomcat 6中使用log4j</title>
		<link>http://www.jayxu.com/2009/01/20/1354/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%259c%25a8tomcat-6%25e4%25b8%25ad%25e4%25bd%25bf%25e7%2594%25a8log4j</link>
		<comments>http://www.jayxu.com/2009/01/20/1354/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 04:15:00 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[log4j]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/2009/01/20/1354/</guid>
		<description><![CDATA[Tomcat 6之前，在web应用中使用log4j还算容易，只要将log4j的jar包和相应的配置文件扔到项目的class path就齐活了。但是从6开始，一切变得如此复杂…… 根据Tomcat 6 的官方文档，默认tomcat用的是JDK的logging框架，并配以“精简版”的common logging框架，即不支持common logging的底层框架自动切换功能，要使用log4j也就不可能了。要使用上述功能，需要使用“完整版”的common logging，而这个完整版的jar包apache上不提供下载，需要“自己编译tomcat代码”-_-&#124;&#124;&#124;，具体步骤如下： 当然，你必须得有JDK、ant、SVN（如果你直接下载源代码包，可以不需要SVN） 从http://svn.apache.org/repos/asf/tomcat/tc6.0.x/ check out代码 执行ant download 执行ant（这里提一句，源代码的编码为utf8，直接编译的话会扔一堆warning，只要改一下ant脚本里的javac task就好了，加上encoding=”utf8&#8243;） 执行ant -f extras.xml 将output/extras/tomcat-juli.jar覆盖到tomcat的bin目录下 将output/extras/tomcat-juli-adapters.jar拷到tomcat的lib目录下 在lib目录下写tomcat的全局log4j配置 在你的web项目中放入log4j.jar和log4j.properties(.xml) 附： tomcat-juli.jar tomcat-juli-adapters.jar 使用utf8编译的build.xml 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 在Tomcat 6中使用log4j<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何配置Tomcat数据库连接池</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwp_wpmm_log&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">关于 wordpress 数据库多出一个 wp_wpmm_log 表结构的说明 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fiphone-4-%25E5%25A4%259A%25E5%258A%259F%25E8%2583%25BD%25E5%2588%259B%25E6%2584%258F%25E9%259F%25B3%25E5%2593%258D%25E8%2583%258C%25E5%258C%2585.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IPhone 4 多功能创意音响背包 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fa4estudio-codina-house.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">A4estudio建筑设计-Codina House (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F1346.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">国家大J院 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ycy8.net%2F2011_7070.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Jessie J个人专辑- Who You Are (@ycy8)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Tomcat 6之前，在web应用中使用log4j还算容易，只要将log4j的jar包和相应的配置文件扔到项目的class path就齐活了。但是从6开始，一切变得如此复杂……<br />
根据Tomcat 6 的<a href="http://tomcat.apache.org/tomcat-6.0-doc/logging.html" target="_blank">官方文档</a>，默认tomcat用的是JDK的logging框架，并配以“精简版”的common logging框架，即不支持common logging的底层框架自动切换功能，要使用log4j也就不可能了。要使用上述功能，需要使用“完整版”的common logging，而这个完整版的jar包apache上不提供下载，需要“自己编译tomcat代码”-_-|||，具体步骤如下：</p>
<ol>
<li>当然，你必须得有JDK、ant、SVN（如果你直接下载<a href="http://tomcat.apache.org/download-60.cgi" target="_blank">源代码包</a>，可以不需要SVN）</li>
<li>从http://svn.apache.org/repos/asf/tomcat/tc6.0.x/ check out代码</li>
<li>执行ant download</li>
<li>执行ant（这里提一句，源代码的编码为utf8，直接编译的话会扔一堆warning，只要改一下ant脚本里的javac task就好了，加上encoding=”utf8&#8243;）</li>
<li>执行ant -f extras.xml</li>
<li>将output/extras/<code>tomcat-juli.jar覆盖到tomcat的bin目录下</code></li>
<li>将output/extras/tomcat-juli-adapters.jar拷到tomcat的lib目录下</li>
<li>在lib目录下写tomcat的全局log4j配置</li>
<li>在你的web项目中放入log4j.jar和log4j.properties(.xml)</li>
</ol>
<p><del datetime="2009-12-18T09:08:48+00:00">附：<br />
tomcat-juli.jar<br />
tomcat-juli-adapters.jar<br />
使用utf8编译的build.xml</del>
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2009/01/20/1354/">在Tomcat 6中使用log4j</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F&title=%E5%9C%A8Tomcat+6%E4%B8%AD%E4%BD%BF%E7%94%A8log4j" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F12%2F10%2F1911%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何配置Tomcat数据库连接池</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F11%2F2396%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java程序员必看电影：Java 4-ever</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwp_wpmm_log&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">关于 wordpress 数据库多出一个 wp_wpmm_log 表结构的说明 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fiphone-4-%25E5%25A4%259A%25E5%258A%259F%25E8%2583%25BD%25E5%2588%259B%25E6%2584%258F%25E9%259F%25B3%25E5%2593%258D%25E8%2583%258C%25E5%258C%2585.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">IPhone 4 多功能创意音响背包 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fa4estudio-codina-house.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">A4estudio建筑设计-Codina House (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.caodanshi.com%2F2011%2F1346.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">国家大J院 (@caodanshi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.ycy8.net%2F2011_7070.html&from=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Jessie J个人专辑- Who You Are (@ycy8)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2009/01/20/1354/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何使用J2D将一张图片灰度化</title>
		<link>http://www.jayxu.com/2008/12/10/1263/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e4%25bd%25bf%25e7%2594%25a8j2d%25e5%25b0%2586%25e4%25b8%2580%25e5%25bc%25a0%25e5%259b%25be%25e7%2589%2587%25e7%2581%25b0%25e5%25ba%25a6%25e5%258c%2596</link>
		<comments>http://www.jayxu.com/2008/12/10/1263/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 07:23:37 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=1263</guid>
		<description><![CDATA[可使用以下代码： Graphics2D g2d = source.createGraphics&#40;&#41;; &#160; ColorSpace grayCS = ColorSpace.getInstance&#40;ColorSpace.CS_GRAY&#41;; ColorConvertOp colorConvertOp = new ColorConvertOp&#40;grayCS, g2d.getRenderingHints&#40;&#41;&#41;; colorConvertOp.filter&#40;source, source&#41;; Graphics2D g2d = source.createGraphics(); ColorSpace grayCS = ColorSpace.getInstance(ColorSpace.CS_GRAY); ColorConvertOp colorConvertOp = new ColorConvertOp(grayCS, g2d.getRenderingHints()); colorConvertOp.filter(source, source); 其中source为BufferedImage对象 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 如何使用J2D将一张图片灰度化<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Tomcat 6中使用log4j</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>可使用以下代码：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw3">Graphics2D</span> g2d <span class="sy0">=</span> source.<span class="me1">createGraphics</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="kw3">ColorSpace</span> grayCS <span class="sy0">=</span> <span class="kw3">ColorSpace</span>.<span class="me1">getInstance</span><span class="br0">&#40;</span><span class="kw3">ColorSpace</span>.<span class="me1">CS_GRAY</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="kw3">ColorConvertOp</span> colorConvertOp <span class="sy0">=</span> <span class="kw1">new</span> <span class="kw3">ColorConvertOp</span><span class="br0">&#40;</span>grayCS, g2d.<span class="me1">getRenderingHints</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">colorConvertOp.<span class="me1">filter</span><span class="br0">&#40;</span>source, source<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">Graphics2D g2d = source.createGraphics();

ColorSpace grayCS = ColorSpace.getInstance(ColorSpace.CS_GRAY);
ColorConvertOp colorConvertOp = new ColorConvertOp(grayCS, g2d.getRenderingHints());
colorConvertOp.filter(source, source);</pre></div></div>

<p>其中source为BufferedImage对象
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/12/10/1263/">如何使用J2D将一张图片灰度化</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&title=%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8J2D%E5%B0%86%E4%B8%80%E5%BC%A0%E5%9B%BE%E7%89%87%E7%81%B0%E5%BA%A6%E5%8C%96" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F20%2F1354%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Tomcat 6中使用log4j</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/12/10/1263/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Enable Anti-Aliased Globally Since JDK 5</title>
		<link>http://www.jayxu.com/2008/11/25/1243/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-enable-anti-aliased-globally-since-jdk-5</link>
		<comments>http://www.jayxu.com/2008/11/25/1243/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 09:51:56 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[swing]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/11/25/1243/</guid>
		<description><![CDATA[I just read “Swing Hacks” and find it is that easy to enable anti-aliased since JDK 5.  Just add a one-line code listed below at the very beginning of your whole application System.setProperty&#40;&#34;swing.aatext&#34;, &#34;true&#34;&#41;; System.setProperty("swing.aatext", "true"); That&#8217;s all 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: How To Enable Anti-Aliased Globally Since JDK 5<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fproud-swing-little-monkey-wall-clock.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">得意摇摆小猴挂钟 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fwindows-mobile-popup-input&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">windows mobile/PPC禁止输入法自动弹出方法——改注册表 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fxjeek.com%2F%3Fp%3D1377&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">纽约东城的地下公园 (@xjeek)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.mianfeidi.com%2F2011%2Fwoothemes-buro.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">WooThemes出品的适应任意浏览器的Buro WordPress主题 (@mianfeidi)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>I just read “Swing Hacks” and find it is that easy to enable anti-aliased since JDK 5.  Just add a one-line code listed below at the very beginning of your whole application</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw3">System</span>.<span class="me1">setProperty</span><span class="br0">&#40;</span><span class="st0">&quot;swing.aatext&quot;</span>, <span class="st0">&quot;true&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">System.setProperty("swing.aatext", "true");</pre></div></div>

<p>That&#8217;s all
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/25/1243/">How To Enable Anti-Aliased Globally Since JDK 5</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&title=How+To+Enable+Anti-Aliased+Globally+Since+JDK+5" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jandou.com%2Fproud-swing-little-monkey-wall-clock.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">得意摇摆小猴挂钟 (@jandou)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fmall.ycy8.net%2F2011_296.html&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">【Doulex】简约温馨ESC按键灯-黄光 (@ycy8)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.lzhi.org%2Fviews%2F232&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">男人女人，看懂这41条，你会想通很多事情 (@lzhi)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fxiaomanhua.info%2F1101%2F325%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">爱斯基摩人的选择 (@xiaomanhua)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/25/1243/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JFreeChart中的TimeSeries可能导致内存泄露</title>
		<link>http://www.jayxu.com/2008/11/25/1233/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jfreechart%25e4%25b8%25ad%25e7%259a%2584timeseries%25e5%258f%25af%25e8%2583%25bd%25e5%25af%25bc%25e8%2587%25b4%25e5%2586%2585%25e5%25ad%2598%25e6%25b3%2584%25e9%259c%25b2</link>
		<comments>http://www.jayxu.com/2008/11/25/1233/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 06:40:01 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jfreechart]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[性能调优]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/11/25/1233/</guid>
		<description><![CDATA[前段时间说到现在的项目里在用JFreeChart。昨天晚上走之前没把客户端关掉，今天中午到公司发现程序已经崩了，狂抛OutOfMemoryError。用NB的profiler跟了一下，发现是JFreeChart或者说是没有正确使用JFreeChart的TimeSeries导致的后果 TimeSeries有一个方法setMaximumItemAge： public void setMaximumItemAge&#40;long periods&#41; public void setMaximumItemAge(long periods) 该方法文档如下： Sets the number of time units in the &#8216;history&#8217; for the series. This provides one mechanism for automatically dropping old data from the time series. For example, if a series contains daily data, you might set the history count to 30. Then, when you <a href="http://www.jayxu.com/2008/11/25/1233/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JFreeChart Developer Guide</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">让Struts 2性能提升一个数量级的的5个步骤 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">慎用LinkedXxxx集合</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>前段时间说到现在的项目里在用JFreeChart。昨天晚上走之前没把客户端关掉，今天中午到公司发现程序已经崩了，狂抛OutOfMemoryError。用NB的profiler跟了一下，发现是JFreeChart或者说是没有正确使用JFreeChart的TimeSeries导致的后果<br />
TimeSeries有一个方法setMaximumItemAge：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw4">void</span> setMaximumItemAge<span class="br0">&#40;</span><span class="kw4">long</span> periods<span class="br0">&#41;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public void setMaximumItemAge(long periods)</pre></div></div>

<p>该方法文档如下：</p>
<blockquote><dl>
<dd>Sets the number of time units in the &#8216;history&#8217; for the series.  This provides one mechanism for automatically dropping old data from the time series. For example, if a series contains daily data, you might set the history count to 30.  Then, when you add a new data item, all data items more than 30 days older than the latest value are automatically dropped from the series.</p>
</dd>
<dd> </dd>
<dd>
<dl>
<dt><strong>Parameters:</strong></dt>
<dd><code>periods</code> &#8211; the number of time periods.</dd>
<dt></dt>
</dl>
</dd>
</dl>
</blockquote>
<p>maximumItemAge的默认值为Long.MAX_VALUE，因此如果不设置该值的话在可预见的未来过期数据将不会被丢弃，这样会导致TimeSeries的数据越来越大，尤其是在设置axis.setAutoRange(true);和axis.setFixedAutoRange(DATA_AGE);后（将横轴设为固定长度，图表只容纳限定数目个点，视觉上就是数据从右边“推入”图表，从左侧被“推出”）。虽然视觉上数据只有那么一点，但是从图表上消失的“旧”数据并没有从series里清除，导致最终的内存不足</p>
<p><a href="http://jayxu.com/log/wp-content/uploads/2008/11/mem_heap_2.png"><img class="alignnone size-medium wp-image-1236" title="mem_heap_2" src="http://jayxu.com/log/wp-content/uploads/2008/11/mem_heap_2.png" alt="" width="436" height="278" /></a></p>
<p>未使用setMaximumItemAge的堆分布，才2分钟就开始深度GC，且堆大小已经开始扩大</p>
<p><a href="http://jayxu.com/log/wp-content/uploads/2008/11/mem_gc_2.png"><img class="alignnone size-medium wp-image-1237" title="mem_gc_2" src="http://jayxu.com/log/wp-content/uploads/2008/11/mem_gc_2.png" alt="" width="436" height="278" /></a></p>
<p>未使用setMaximumItemAge的对象年龄（代），曲线很陡，说明很多对象没有被回收</p>
<p><a href="http://jayxu.com/log/wp-content/uploads/2008/11/mem_heap.png"><img class="alignnone size-medium wp-image-1238" title="mem_heap" src="http://jayxu.com/log/wp-content/uploads/2008/11/mem_heap.png" alt="" width="436" height="278" /></a></p>
<p>使用setMaximumItemAge的堆分布，堆内存占用比较缓慢，堆大小未扩大，未进行深度GC</p>
<p><a href="http://jayxu.com/log/wp-content/uploads/2008/11/mem_gc.png"><img class="alignnone size-medium wp-image-1239" title="mem_gc" src="http://jayxu.com/log/wp-content/uploads/2008/11/mem_gc.png" alt="" width="436" height="278" /></a></p>
<p>使用setMaximumItemAge的对象年龄（代），数值很高，是因为还没有进行深度GC的原因</p>
<p>在此提醒正在使用JFreeChart尤其是TimeSeries的给位，千万记得设置maximumItemAge
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/25/1233/">JFreeChart中的TimeSeries可能导致内存泄露</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F&title=JFreeChart%E4%B8%AD%E7%9A%84TimeSeries%E5%8F%AF%E8%83%BD%E5%AF%BC%E8%87%B4%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F15%2F848%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JFreeChart Developer Guide</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F01%2F06%2F1337%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">让Struts 2性能提升一个数量级的的5个步骤 [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F05%2F1441%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">慎用LinkedXxxx集合</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1233%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/25/1233/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何cancel一个swing worker（续）</title>
		<link>http://www.jayxu.com/2008/11/14/844/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595cancel%25e4%25b8%2580%25e4%25b8%25aaswing-worker%25ef%25bc%2588%25e7%25bb%25ad%25ef%25bc%2589</link>
		<comments>http://www.jayxu.com/2008/11/14/844/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 15:35:19 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[swingx]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=844</guid>
		<description><![CDATA[上一次谈到如何去cancel一个swing worker，今天在代码里又出了问题：即使使用swingWorker.cancel(true)仍然无法在sleep时中止线程。追了一下代码，最后在javax.swing.ImageIcon类里找到了原因： protected void loadImage(Image image) { synchronized(tracker) { int id = getNextID(); tracker.addImage(image, id); try { tracker.waitForID(id, 0); } catch (InterruptedException e) { System.out.println("INTERRUPTED while loading Image"); } loadStatus = tracker.statusID(id, false); tracker.removeImage(image, id); width = image.getWidth(imageObserver); height = image.getHeight(imageObserver); } } 其中第7行会抛出InterruptedException，而在第10行捕捉了该异常，导致InterruptedException无法抛到我的代码里。很典型的“eat-up exception”的例子。解决该问题可以在初始化ImageIcon前sleep一下，比如sleep(5)，让interrupted状态在sleep中触发InterruptedException 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 如何cancel一个swing worker（续）<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何cancel一个swingworker</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F12%2F2120%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">世界杯了，买俩扎库米热热身</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>上一次谈到如何去cancel一个swing worker，今天在代码里又出了问题：即使使用swingWorker.cancel(true)仍然无法在sleep时中止线程。追了一下代码，最后在javax.swing.ImageIcon类里找到了原因：</p>
<pre lang="java" line="1">
protected void loadImage(Image image) {
    synchronized(tracker) {
        int id = getNextID();

        tracker.addImage(image, id);
	try {
	    tracker.waitForID(id, 0);
	} catch (InterruptedException e) {
	    System.out.println("INTERRUPTED while loading Image");
	}
        loadStatus = tracker.statusID(id, false);
	tracker.removeImage(image, id);

        width = image.getWidth(imageObserver);
	height = image.getHeight(imageObserver);
    }
}
</pre>
<p>其中第7行会抛出InterruptedException，而在第10行捕捉了该异常，导致InterruptedException无法抛到我的代码里。很典型的“eat-up exception”的例子。解决该问题可以在初始化ImageIcon前sleep一下，比如sleep(5)，让interrupted状态在sleep中触发InterruptedException
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/14/844/">如何cancel一个swing worker（续）</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F&title=%E5%A6%82%E4%BD%95cancel%E4%B8%80%E4%B8%AAswing+worker%EF%BC%88%E7%BB%AD%EF%BC%89" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F25%2F1243%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">How To Enable Anti-Aliased Globally Since JDK 5</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F01%2F25%2F10466%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在JDialog上注册全局ESC键事件</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何cancel一个swingworker</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F10%2F17%2F11779%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F14%2F844%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">一周tweets更新 [2011-10-17]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/14/844/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>小心Derby的ResultSet陷阱</title>
		<link>http://www.jayxu.com/2008/11/09/59/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25b0%258f%25e5%25bf%2583derby%25e7%259a%2584resultset%25e9%2599%25b7%25e9%2598%25b1</link>
		<comments>http://www.jayxu.com/2008/11/09/59/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 09:19:21 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[derby]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/?p=59</guid>
		<description><![CDATA[Derby作为一个纯Java实现的嵌入式DB一直很受Java社区的欢迎，在我们的项目中也用到了。但昨天晚上遇到的一个问题让我对Derby相当失望——Derby实现的ResultSet会将列名中的表名抹掉 具体代码： SQL： SELECT staff.staffid FROM staff WHERE ... JDBC： ResultSet rs = stmt.executeQuery&#40;...&#41;; if&#40;rs.next&#40;&#41;&#41;&#123; &#160; &#160; String id = rs.getString&#40;&#34;staff.id&#34;&#41;; &#125; ResultSet rs = stmt.executeQuery(...); if(rs.next()){ String id = rs.getString("staff.id"); } 运行时抛出异常： Caused by: java.sql.SQLException: 列“staff.staffid”未找到。 &#160; &#160; at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException&#40;Unknown Source&#41; &#160; &#160; at org.apache.derby.impl.jdbc.Util.newEmbedSQLException&#40;Unknown Source&#41; &#160; &#160; at org.apache.derby.impl.jdbc.Util.newEmbedSQLException&#40;Unknown Source&#41; &#160; &#160; at <a href="http://www.jayxu.com/2008/11/09/59/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fsql-wordpress-keywords&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL 查询包含某些文字的内容 如wordpress查询所有带图片的文章 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1967&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">用过SQL语句获取织梦DedeCMS每个栏目各有多少文章 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D316&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">利用SQL语句删除或修改织梦DedeCms数据库内容 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1602%26cpage%3D1&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">织梦DedeCms用SQL语句调用数据库任意内容方法 | 织梦(Dedecms)管理员之家 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Derby作为一个纯Java实现的嵌入式DB一直很受Java社区的欢迎，在我们的项目中也用到了。但昨天晚上遇到的一个问题让我对Derby相当失望——Derby实现的ResultSet会将列名中的表名抹掉<br />
具体代码：<br />
SQL：</p>
<pre>SELECT staff.staffid FROM staff WHERE ...</pre>
<p>JDBC：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw3">ResultSet</span> rs <span class="sy0">=</span> stmt.<span class="me1">executeQuery</span><span class="br0">&#40;</span>...<span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="kw1">if</span><span class="br0">&#40;</span>rs.<span class="me1">next</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw3">String</span> id <span class="sy0">=</span> rs.<span class="me1">getString</span><span class="br0">&#40;</span><span class="st0">&quot;staff.id&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">ResultSet rs = stmt.executeQuery(...);
if(rs.next()){
    String id = rs.getString("staff.id");
}</pre></div></div>

<p>运行时抛出异常：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1">Caused by<span class="sy0">:</span> java.<span class="me1">sql</span>.<span class="kw3">SQLException</span><span class="sy0">:</span> 列“staff.<span class="me1">staffid</span>”未找到。</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="me1">SQLExceptionFactory</span>.<span class="me1">getSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="kw3">Util</span>.<span class="me1">newEmbedSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="kw3">Util</span>.<span class="me1">newEmbedSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="kw3">Util</span>.<span class="me1">generateCsSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="me1">EmbedConnection</span>.<span class="me1">newSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="me1">ConnectionChild</span>.<span class="me1">newSQLException</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="me1">EmbedResultSet</span>.<span class="me1">findColumnName</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; at org.<span class="me1">apache</span>.<span class="me1">derby</span>.<span class="me1">impl</span>.<span class="me1">jdbc</span>.<span class="me1">EmbedResultSet</span>.<span class="me1">getString</span><span class="br0">&#40;</span>Unknown Source<span class="br0">&#41;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">Caused by: java.sql.SQLException: 列“staff.staffid”未找到。
	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedResultSet.findColumnName(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedResultSet.getString(Unknown Source)</pre></div></div>

<p>如果将select语句中的“staff.staffid”改成“staffid”则不会抛出上述异常。在项目中为了保持数量庞大的SQL语句的正确性和可维护性，一般会将表名、列名定义为常量。这样对于Derby数据库就需要一套特殊的、不带表名的列名常量，给代码维护带来很大的麻烦。不知道Sun将Derby这样实现的原因是什么，这个功能点的实现也不是很麻烦，打算去提交bug
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/09/59/">小心Derby的ResultSet陷阱</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F&title=%E5%B0%8F%E5%BF%83Derby%E7%9A%84ResultSet%E9%99%B7%E9%98%B1" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
        <br/>
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">来自无觅网络的相关文章：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fbfya.com%2Fsql-wordpress-keywords&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">SQL 查询包含某些文字的内容 如wordpress查询所有带图片的文章 (@bfya)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.hui-wang.info%2F2012%2F01%2F08%2Fjava-enum-and-polymorphism%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java的枚举和接口 (@hui-wang)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1967&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">用过SQL语句获取织梦DedeCMS每个栏目各有多少文章 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D316&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">利用SQL语句删除或修改织梦DedeCms数据库内容 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.dedeadmin.com%2F%3Fp%3D1602%26cpage%3D1&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F59%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">织梦DedeCms用SQL语句调用数据库任意内容方法 | 织梦(Dedecms)管理员之家 (@dedeadmin)</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/09/59/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>如何使用反射调用静态方法</title>
		<link>http://www.jayxu.com/2008/11/09/809/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e4%25bd%25bf%25e7%2594%25a8%25e5%258f%258d%25e5%25b0%2584%25e8%25b0%2583%25e7%2594%25a8%25e9%259d%2599%25e6%2580%2581%25e6%2596%25b9%25e6%25b3%2595</link>
		<comments>http://www.jayxu.com/2008/11/09/809/#comments</comments>
		<pubDate>Sun, 09 Nov 2008 09:04:55 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/11/09/809/</guid>
		<description><![CDATA[其实很简单，真的，将invoke(Object o, Object&#8230; params)的第一个参数传入null即可 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 如何使用反射调用静态方法<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JScrollBar的unitIncrement和blockIncrement</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>其实很简单，真的，将invoke(Object o, Object&#8230; params)的第一个参数传入null即可
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/11/09/809/">如何使用反射调用静态方法</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F&title=%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8%E5%8F%8D%E5%B0%84%E8%B0%83%E7%94%A8%E9%9D%99%E6%80%81%E6%96%B9%E6%B3%95" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">JScrollBar的unitIncrement和blockIncrement</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F12%2F10%2F1263%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用J2D将一张图片灰度化</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/11/09/809/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何cancel一个swingworker</title>
		<link>http://www.jayxu.com/2008/10/30/764/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595cancel%25e4%25b8%2580%25e4%25b8%25aaswingworker</link>
		<comments>http://www.jayxu.com/2008/10/30/764/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 08:04:37 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[swingx]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/10/30/764/</guid>
		<description><![CDATA[最近在项目里一直在用jdesktop的swingworker（已经合入JDK 6），是个不错的swing线程库。今天需要在界面里cancel一个swingworker。研究了一下午，结合swingworker的文档、源代码和自己的代码实验，以下是两种安全cancel一个swingworker的方法 方法一，使用isCancelled： protected Object doInBackground&#40;&#41; throws Exception &#123; &#160; &#160; while &#40;!isCancelled&#40;&#41;&#41; &#123; &#160; &#160; &#160; &#160;... &#160; &#160; &#125; &#160; &#160; &#160; return null; &#125; protected Object doInBackground() throws Exception { while (!isCancelled()) { ... } return null; } 需要cencel时调用swingworker.cancel(false)，不中断线程，只置cancel标记。 方法二，使用sleep： protected Object doInBackground&#40;&#41; throws Exception &#123; &#160; &#160; while &#40;running&#41; &#123; &#160; <a href="http://www.jayxu.com/2008/10/30/764/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用反射调用静态方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>最近在项目里一直在用jdesktop的swingworker（已经合入JDK 6），是个不错的swing线程库。今天需要在界面里cancel一个swingworker。研究了一下午，结合swingworker的文档、源代码和自己的代码实验，以下是两种安全cancel一个swingworker的方法</p>
<p>方法一，使用isCancelled：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">protected</span> <span class="kw3">Object</span> doInBackground<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw1">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span><span class="sy0">!</span>isCancelled<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;...</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">null</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">protected Object doInBackground() throws Exception {
    while (!isCancelled()) {
       ...
    }

    return null;
}</pre></div></div>

<p>需要cencel时调用swingworker.cancel(false)，不中断线程，只置cancel标记。</p>
<p>方法二，使用sleep：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">protected</span> <span class="kw3">Object</span> doInBackground<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw1">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span>running<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; ...</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="me1">sleep</span><span class="br0">&#40;</span><span class="nu0">30</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li2"><div class="de2">&nbsp;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">null</span><span class="sy0">;</span></div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">protected Object doInBackground() throws Exception {
    while (running) {
        ...
        sleep(30);
    }

    return null;
}</pre></div></div>

<p>需要cencel时调用swingworker.cancel(true)，在sleep处中断线程。切记，不需要捕捉sleep抛出的InterruptedException，swingworker会处理该异常。
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/10/30/764/">如何cancel一个swingworker</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F&title=%E5%A6%82%E4%BD%95cancel%E4%B8%80%E4%B8%AAswingworker" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F11%2F09%2F809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何使用反射调用静态方法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F30%2F764%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/10/30/764/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JScrollBar的unitIncrement和blockIncrement</title>
		<link>http://www.jayxu.com/2008/10/09/747/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=jscrollbar%25e7%259a%2584unitincrement%25e5%2592%258cblockincrement</link>
		<comments>http://www.jayxu.com/2008/10/09/747/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 17:38:46 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/10/09/747/</guid>
		<description><![CDATA[这两天在写swing的时候遇到一个问题，JScrollPane在相应鼠标滚轮的时候很慢，滚了一大段才移了一点点，给人的感觉就是鼠标很“硬”。刚才查了一下javadoc，看到JScrollbar有个方法：setUnitIncrement(int) 和 setBlockIncrement(int)。前一个是设置点击上下箭头的移动距离（也包括滚轮滚动），后一个是单击滚动条上空白处的移动距离，单位为像素。输出了一下unitIncrement的默认值，竟然是1 -_-&#124;&#124;&#124;。手动设为10，感觉鼠标终于灵活了……具体代码： jScrollPane.getVerticalScrollBar&#40;&#41;.setUnitIncrement&#40;10&#41;; jScrollPane.getVerticalScrollBar().setUnitIncrement(10); 如果遇到和我相同问题的可以用上面的方法试一下。有点不爽的就是没有一个类似UIManager的全局变量可以设置，只能在各个JScrollBar上单独设置，有点麻烦。 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: JScrollBar的unitIncrement和blockIncrement<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>这两天在写swing的时候遇到一个问题，JScrollPane在相应鼠标滚轮的时候很慢，滚了一大段才移了一点点，给人的感觉就是鼠标很“硬”。刚才查了一下javadoc，看到JScrollbar有个方法：setUnitIncrement(int) 和 setBlockIncrement(int)。前一个是设置点击上下箭头的移动距离（也包括滚轮滚动），后一个是单击滚动条上空白处的移动距离，单位为像素。输出了一下unitIncrement的默认值，竟然是1 -_-|||。手动设为10，感觉鼠标终于灵活了……具体代码：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1">jScrollPane.<span class="me1">getVerticalScrollBar</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">setUnitIncrement</span><span class="br0">&#40;</span><span class="nu0">10</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">jScrollPane.getVerticalScrollBar().setUnitIncrement(10);</pre></div></div>

<p>如果遇到和我相同问题的可以用上面的方法试一下。有点不爽的就是没有一个类似UIManager的全局变量可以设置，只能在各个JScrollBar上单独设置，有点麻烦。
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/10/09/747/">JScrollBar的unitIncrement和blockIncrement</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F&title=JScrollBar%E7%9A%84unitIncrement%E5%92%8CblockIncrement" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">如何在Java的enum中使用annotation</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F10%2F09%2F747%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/10/09/747/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>在Linux下设置ntp服务</title>
		<link>http://www.jayxu.com/2008/09/27/731/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%259c%25a8linux%25e4%25b8%258b%25e8%25ae%25be%25e7%25bd%25aentp%25e6%259c%258d%25e5%258a%25a1</link>
		<comments>http://www.jayxu.com/2008/09/27/731/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 08:35:37 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/09/27/731/</guid>
		<description><![CDATA[节省时间，什么是ntp在这里就不解释了，下面就大概讲一下在Linux下如何配置、启动ntp服务。当然，前提是在系统中已经安装了ntp服务 首先手动同步一下时间： # ntpdate  222.73.214.125 # ntpdate  222.73.214.125 其中222.73.214.125是ntp服务器的IP，这里可以找到一堆的ntp服务器，挑一个国内的就行了 同步后使用date命令验证当前时间，如果不对需要配置系统时区。然后修改/etc/ntp.config文件，将刚才选择的ntp服务器添加进去，语法为： server 222.73.214.125 server 222.73.214.125 最后在系统服务中启动ntp： # /etc/init.d/ntpd start # chkconfig --level 35 ntpd on # /etc/init.d/ntpd start # chkconfig --level 35 ntpd on 原创内容，转载请注明： 转载自拈花微笑 本文链接地址: 在Linux下设置ntp服务<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim键盘布局，中英高清带字幕</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F05%2F19%2F10588%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Web上运行Linux [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F06%2F01%2F134%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">I love Ubuntu</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F02%2F02%2F1362%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">才知道mac/linux下的MSN群怎么显示其他用户名</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F30%2F734%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">OS比较形象的比较</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>节省时间，什么是ntp在这里就不解释了，下面就大概讲一下在Linux下如何配置、启动ntp服务。当然，前提是在系统中已经安装了ntp服务</p>
<p>首先手动同步一下时间：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="bash"><ol><li class="li1"><div class="de1"><span class="co0"># ntpdate  222.73.214.125</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse"># ntpdate  222.73.214.125</pre></div></div>

<p>其中222.73.214.125是ntp服务器的IP，<a href="http://www.pool.ntp.org/en/" target="_blank">这里</a>可以找到一堆的ntp服务器，挑一个国内的就行了</p>
<p>同步后使用date命令验证当前时间，如果不对需要配置系统时区。然后修改/etc/ntp.config文件，将刚才选择的ntp服务器添加进去，语法为：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="bash"><ol><li class="li1"><div class="de1">server 222.73.214.125</div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">server 222.73.214.125</pre></div></div>

<p>最后在系统服务中启动ntp：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="bash"><ol><li class="li1"><div class="de1"><span class="co0"># /etc/init.d/ntpd start</span></div></li>
<li class="li2"><div class="de2"><span class="co0"># chkconfig --level 35 ntpd on</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse"># /etc/init.d/ntpd start
# chkconfig --level 35 ntpd on</pre></div></div>

<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/09/27/731/">在Linux下设置ntp服务</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F&title=%E5%9C%A8Linux%E4%B8%8B%E8%AE%BE%E7%BD%AEntp%E6%9C%8D%E5%8A%A1" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F04%2F14%2F2124%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">vim键盘布局，中英高清带字幕</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2011%2F05%2F19%2F10588%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">在Web上运行Linux [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2006%2F06%2F01%2F134%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">I love Ubuntu</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F02%2F02%2F1362%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">才知道mac/linux下的MSN群怎么显示其他用户名</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F30%2F734%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F27%2F731%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">OS比较形象的比较</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/09/27/731/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何在Java的enum中使用annotation</title>
		<link>http://www.jayxu.com/2008/09/22/713/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=%25e5%25a6%2582%25e4%25bd%2595%25e5%259c%25a8java%25e4%25b8%25ad%25e5%259c%25a8enum%25e4%25b8%25ad%25e4%25bd%25bf%25e7%2594%25a8annotation</link>
		<comments>http://www.jayxu.com/2008/09/22/713/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 15:14:59 +0000</pubDate>
		<dc:creator>Jay</dc:creator>
				<category><![CDATA[技术生活]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[编程]]></category>

		<guid isPermaLink="false">http://ijay.net.cn/log/2008/09/22/713/</guid>
		<description><![CDATA[刚才在写一个方法的时候试图在enum上使用annotation： public enum DataKey &#123; &#160; &#160; @Incremental &#160; &#160; @FromProbe &#160; &#160; @Transient&#40;replacePolicy = ReplacePlolicy.REPLACE_IF_LATER_THAN&#41; &#160; &#160; VISIT_COUNT &#125; public enum DataKey { @Incremental @FromProbe @Transient(replacePolicy = ReplacePlolicy.REPLACE_IF_LATER_THAN) VISIT_COUNT } 然后在merge的时候使用annotation： if &#40;key.getClass&#40;&#41;.isAnnotationPresent&#40;Transient.class&#41;&#41; &#123; &#160; &#160; ... &#125; if (key.getClass().isAnnotationPresent(Transient.class)) { ... } 结果不进if，debug时发现key（DataKey的对象）的类型是DataKey（其实也挺顺理成章的），于是使用如下代码： if &#40;DataKey.class.getField&#40;key.name&#40;&#41;&#41;.isAnnotationPresent&#40;Transient.class&#41;&#41; &#123; &#160; &#160; ... &#125; if (DataKey.class.getField(key.name()).isAnnotationPresent(Transient.class)) { <a href="http://www.jayxu.com/2008/09/22/713/"> read more <span class="meta-nav">&#187;</span></a><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>刚才在写一个方法的时候试图在enum上使用annotation：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">public</span> <span class="kw1">enum</span> DataKey <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; @Incremental</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; @FromProbe</div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; @<span class="kw1">Transient</span><span class="br0">&#40;</span>replacePolicy <span class="sy0">=</span> ReplacePlolicy.<span class="me1">REPLACE_IF_LATER_THAN</span><span class="br0">&#41;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; VISIT_COUNT</div></li>
<li class="li2"><div class="de2"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">public enum DataKey {
    @Incremental
    @FromProbe
    @Transient(replacePolicy = ReplacePlolicy.REPLACE_IF_LATER_THAN)
    VISIT_COUNT
}</pre></div></div>

<p>然后在merge的时候使用annotation：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span>key.<span class="me1">getClass</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">isAnnotationPresent</span><span class="br0">&#40;</span><span class="kw1">Transient</span>.<span class="kw1">class</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; ...</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">if (key.getClass().isAnnotationPresent(Transient.class)) {
    ...
}</pre></div></div>

<p>结果不进if，debug时发现key（DataKey的对象）的类型是DataKey（其实也挺顺理成章的），于是使用如下代码：</p>

<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar"><div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div></div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-advanced"><div class="java"><ol><li class="li1"><div class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span>DataKey.<span class="kw1">class</span>.<span class="me1">getField</span><span class="br0">&#40;</span>key.<span class="me1">name</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">isAnnotationPresent</span><span class="br0">&#40;</span><span class="kw1">Transient</span>.<span class="kw1">class</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li2"><div class="de2">&nbsp; &nbsp; ...</div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li>
</ol></div></div>
<div class="bwp-syntax-source"><pre class="no-parse">if (DataKey.class.getField(key.name()).isAnnotationPresent(Transient.class)) {
    ...
}</pre></div></div>

<p>结果正确。<br />
结论：在对enum类型使用FIELD一级annotation时需要使用第二种方法进行反射
<div style="margin-top: 15px; font-style: italic">
<p><strong>原创内容，转载请注明：</strong> 转载自<a href="http://www.jayxu.com/">拈花微笑</a></p>
<p><strong>本文链接地址:</strong> <a href="http://www.jayxu.com/2008/09/22/713/">如何在Java的enum中使用annotation</a></p>
</div>
<p><a href="http://www.bshare.cn/share?url=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F&title=%E5%A6%82%E4%BD%95%E5%9C%A8Java%E7%9A%84enum%E4%B8%AD%E4%BD%BF%E7%94%A8annotation" title="用bShare分享或收藏本文"><img src="http://static.bshare.cn/frame/images/button_custom1-zh.gif" alt="用bShare分享或收藏本文" /></a></p><table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2012%2F02%2F02%2F13237%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">有关Java泛型的类型擦除（type erasing）</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2005%2F11%2F07%2F171%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java 销魂落魄散  [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F03%2F02%2F1425%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">Java RMI中的NoSuchObjectException</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2009%2F11%2F11%2F1809%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">10 things all JAVA developers should know [zz]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect.htm?url=http%3A%2F%2Fwww.jayxu.com%2F2010%2F08%2F25%2F2401%2F&from=http%3A%2F%2Fwww.jayxu.com%2F2008%2F09%2F22%2F713%2F">
                        <font size="-1"  style="line-height: 1.65em; font-size: 12px !important;">誤區！double類型做加減法不會有誤差？</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems.htm" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://www.jayxu.com/2008/09/22/713/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

