﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-呆呆向前冲的blog-文章分类-工作：Java技术 </title><link>http://www.blogjava.net/runforever/category/2385.html</link><description /><language>zh-cn</language><lastBuildDate>Wed, 28 Feb 2007 07:44:41 GMT</lastBuildDate><pubDate>Wed, 28 Feb 2007 07:44:41 GMT</pubDate><ttl>60</ttl><item><title>[struts1.1] 一些开发经验</title><link>http://www.blogjava.net/runforever/articles/11817.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Fri, 02 Sep 2005 02:48:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/11817.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/11817.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/11817.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/11817.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/11817.html</trackback:ping><description><![CDATA[1 DispatchAction<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一个DispatchAction可以是针对一个实体的一组crud操作。这样可以保证每个操作对应相同的ActionForm。还有相同的input<BR><img src ="http://www.blogjava.net/runforever/aggbug/11817.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-09-02 10:48 <a href="http://www.blogjava.net/runforever/articles/11817.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[struts1.1] 多语言配置 </title><link>http://www.blogjava.net/runforever/articles/11348.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Sat, 27 Aug 2005 19:34:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/11348.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/11348.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/11348.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/11348.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/11348.html</trackback:ping><description><![CDATA[<P>步骤<BR>1 资源文件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;添加资源文件：JB里默认的资源文件名称为ApplicationResources.properties。需要添加和语言地区对应的资源文件。如：ApplicationResources_zh_CN.properties、ApplicationResources_en_US.properties<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG>注意：</STRONG>命名一定要注意后缀的正确。否则struts不能自动加载<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;转换编码：将资源文件内容转换为unicode编码。以中文资源文件转换为例，命令如下：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">native2ascii&nbsp;</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">encoding&nbsp;GBK&nbsp;src</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">zh_cn.properties&nbsp;src</SPAN><SPAN style="COLOR: #000000">/</SPAN><SPAN style="COLOR: #000000">ApplicationResources_zh_CN.properties</SPAN></DIV></DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注：zh_cn.properties文件是暂存原始内容的文件<BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;配置资源文件到struts-config.xml中：在配置文件中加入如下资源文件引用</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">message-resources&nbsp;</SPAN><SPAN style="COLOR: #ff0000">parameter</SPAN><SPAN style="COLOR: #0000ff">="ApplicationResources"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN></DIV></DIV>
<P>2 设置JSP编码为UTF-8</P>
<P>3 切换当前Locale<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Struts是根据Session中存储的关键字为org.apache.struts.action.LOCALE的Locale对象判断当前的Locale，<BR>并自动加载相应的资源文件。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;即如果当前locale是zh CN,那么会自动加载 ApplicationResources_zh_CN.properties。所以如果要显示多语言版本，必须切换当前locale。例子如下：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;切换Locale的Action代码：</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG id=Codehighlighter1_44_503_Open_Image onclick="this.style.display='none'; Codehighlighter1_44_503_Open_Text.style.display='none'; Codehighlighter1_44_503_Closed_Image.style.display='inline'; Codehighlighter1_44_503_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_44_503_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_44_503_Closed_Text.style.display='none'; Codehighlighter1_44_503_Open_Image.style.display='inline'; Codehighlighter1_44_503_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;SetLocaleAction&nbsp;extends&nbsp;Action&nbsp;</SPAN><SPAN id=Codehighlighter1_44_503_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_44_503_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_194_501_Open_Image onclick="this.style.display='none'; Codehighlighter1_194_501_Open_Text.style.display='none'; Codehighlighter1_194_501_Closed_Image.style.display='inline'; Codehighlighter1_194_501_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_194_501_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_194_501_Closed_Text.style.display='none'; Codehighlighter1_194_501_Open_Image.style.display='inline'; Codehighlighter1_194_501_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;ActionForward&nbsp;execute(ActionMapping&nbsp;actionMapping,&nbsp;ActionForm&nbsp;actionForm,&nbsp;HttpServletRequest&nbsp;req,&nbsp;HttpServletResponse&nbsp;httpServletResponse)&nbsp;</SPAN><SPAN id=Codehighlighter1_194_501_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_194_501_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;langFlag&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;req.getParameter(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">lang</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;String[]&nbsp;lang&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;langFlag.split(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">_</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Locale&nbsp;locale&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Locale(lang[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">],lang[</SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">]);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;HttpSession&nbsp;session&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;req.getSession(</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;session.setAttribute(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">org.apache.struts.action.LOCALE</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,locale);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000">&nbsp;actionMapping.findForward(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">forward</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN></DIV></DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;页面文件中调用该Action的链接：</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:link&nbsp;</SPAN><SPAN style="COLOR: #ff0000">action</SPAN><SPAN style="COLOR: #0000ff">="setLocale.do?lang=zh_CN"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">chinese</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html:link</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:link&nbsp;</SPAN><SPAN style="COLOR: #ff0000">action</SPAN><SPAN style="COLOR: #0000ff">="setLocale.do?lang=en_US"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">America</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html:link</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV></DIV>
<P><STRONG>不过对于Java中的编码问题，理解的还不透彻。比如中文字符在页面之间的传递问题。如何保证能正确的接收各种语言的输入。</STRONG></P><img src ="http://www.blogjava.net/runforever/aggbug/11348.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-08-28 03:34 <a href="http://www.blogjava.net/runforever/articles/11348.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[Struts1.1]配置Validator </title><link>http://www.blogjava.net/runforever/articles/11340.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Sat, 27 Aug 2005 14:37:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/11340.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/11340.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/11340.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/11340.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/11340.html</trackback:ping><description><![CDATA[<P>步骤：<BR><BR>1 环境配置：首先要为struts加入Validator支持<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lib包：加入validator所需的jar包<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;配置文件：struts-config.xml里加入</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">plug-in&nbsp;</SPAN><SPAN style="COLOR: #ff0000">className</SPAN><SPAN style="COLOR: #0000ff">="org.apache.struts.validator.ValidatorPlugIn"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">set-property&nbsp;</SPAN><SPAN style="COLOR: #ff0000">property</SPAN><SPAN style="COLOR: #0000ff">="pathnames"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">plug-in</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV></DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这里所需的validator-rules.xml和validation.xml也需要放到/WEB-INF/下<BR><BR>2 配置actionForm<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.1 修改Form基类：将actionForm继承的基类改为ValidatorForm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.2 配置struts-config.xml文件：把要验证的form的validator属性设为true<BR></P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;?</SPAN><SPAN style="COLOR: #ff00ff">xml&nbsp;version="1.0"&nbsp;encoding="UTF-8"</SPAN><SPAN style="COLOR: #0000ff">?&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;!</SPAN><SPAN style="COLOR: #ff00ff">DOCTYPE&nbsp;struts-config&nbsp;PUBLIC&nbsp;"-//Apache&nbsp;Software&nbsp;Foundation//DTD&nbsp;Struts&nbsp;Configuration&nbsp;1.1//EN"&nbsp;"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">struts-config</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">form-beans</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">form-bean&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="userForm"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;type</SPAN><SPAN style="COLOR: #0000ff">="com.satesoft.test.UserForm"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">form-beans</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">action-mappings</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">action&nbsp;</SPAN><SPAN style="COLOR: #ff0000">input</SPAN><SPAN style="COLOR: #0000ff">="/index.jsp"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;name</SPAN><SPAN style="COLOR: #0000ff">="userForm"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;path</SPAN><SPAN style="COLOR: #0000ff">="/show"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;scope</SPAN><SPAN style="COLOR: #0000ff">="request"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;type</SPAN><SPAN style="COLOR: #0000ff">="com.satesoft.test.ShowAction"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;validate</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">forward&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="forward"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;path</SPAN><SPAN style="COLOR: #0000ff">="/show.jsp"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">action</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">action-mappings</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">message-resources&nbsp;</SPAN><SPAN style="COLOR: #ff0000">parameter</SPAN><SPAN style="COLOR: #0000ff">="ApplicationResources"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">plug-in&nbsp;</SPAN><SPAN style="COLOR: #ff0000">className</SPAN><SPAN style="COLOR: #0000ff">="org.apache.struts.validator.ValidatorPlugIn"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">set-property&nbsp;</SPAN><SPAN style="COLOR: #ff0000">property</SPAN><SPAN style="COLOR: #0000ff">="pathnames"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">plug-in</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">struts-config</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG>注意：一定要配置对应的Action里的input属性，否则struts找不到要返回的路径</STRONG>&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.3 &nbsp;配置validator.xml文件：在validation.xml里加入对要验证的actionform的定义</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;?</SPAN><SPAN style="COLOR: #ff00ff">xml&nbsp;version="1.0"&nbsp;encoding="UTF-8"</SPAN><SPAN style="COLOR: #0000ff">?&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;!</SPAN><SPAN style="COLOR: #ff00ff">DOCTYPE&nbsp;form-validation&nbsp;PUBLIC&nbsp;"-//Apache&nbsp;Software&nbsp;Foundation//DTD&nbsp;Commons&nbsp;Validator&nbsp;Rules&nbsp;Configuration&nbsp;1.0//EN"&nbsp;"http://jakarta.apache.org/commons/dtds/validator_1_0.dtd"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">form-validation</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">formset</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">form&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="userForm"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">field&nbsp;</SPAN><SPAN style="COLOR: #ff0000">property</SPAN><SPAN style="COLOR: #0000ff">="name"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;depends</SPAN><SPAN style="COLOR: #0000ff">="required"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">arg0&nbsp;</SPAN><SPAN style="COLOR: #ff0000">key</SPAN><SPAN style="COLOR: #0000ff">="user.name.required"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">field</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">form</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">formset</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">form-validation</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这里同时要配置的还有消息资源。在资源文件中加入上述配置文件中所需的消息<BR></P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">errors.header=</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">H3</SPAN><SPAN style="COLOR: #0000ff">&gt;&lt;</SPAN><SPAN style="COLOR: #800000">font&nbsp;</SPAN><SPAN style="COLOR: #ff0000">color</SPAN><SPAN style="COLOR: #0000ff">="blue"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">errors</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">font</SPAN><SPAN style="COLOR: #0000ff">&gt;&lt;</SPAN><SPAN style="COLOR: #800000">br</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.footer=</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">p</SPAN><SPAN style="COLOR: #0000ff">&gt;&lt;/</SPAN><SPAN style="COLOR: #800000">p</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.required={0}&nbsp;is&nbsp;required.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.minlength={0}&nbsp;cannot&nbsp;be&nbsp;less&nbsp;than&nbsp;{1}&nbsp;characters.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.maxlength={0}&nbsp;cannot&nbsp;be&nbsp;greater&nbsp;than&nbsp;{1}&nbsp;characters.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.invalid={0}&nbsp;is&nbsp;invalid.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.byte={0}&nbsp;must&nbsp;be&nbsp;a&nbsp;byte.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.short={0}&nbsp;must&nbsp;be&nbsp;a&nbsp;short.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.integer={0}&nbsp;must&nbsp;be&nbsp;an&nbsp;integer.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.long={0}&nbsp;must&nbsp;be&nbsp;a&nbsp;long.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.float={0}&nbsp;must&nbsp;be&nbsp;a&nbsp;float.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.double={0}&nbsp;must&nbsp;be&nbsp;a&nbsp;double.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.date={0}&nbsp;is&nbsp;not&nbsp;a&nbsp;date.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.range={0}&nbsp;is&nbsp;not&nbsp;in&nbsp;the&nbsp;range&nbsp;{1}&nbsp;through&nbsp;{2}.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.creditcard={0}&nbsp;is&nbsp;not&nbsp;a&nbsp;valid&nbsp;credit&nbsp;card&nbsp;number.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>errors.email={0}&nbsp;is&nbsp;an&nbsp;invalid&nbsp;email&nbsp;address<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>user.name.required=user&nbsp;name</SPAN></DIV></DIV>
<P>&nbsp;2.4&nbsp;配置作为input的jsp页面：&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG id=Codehighlighter1_2_45_Open_Image onclick="this.style.display='none'; Codehighlighter1_2_45_Open_Text.style.display='none'; Codehighlighter1_2_45_Closed_Image.style.display='inline'; Codehighlighter1_2_45_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_2_45_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2_45_Closed_Text.style.display='none'; Codehighlighter1_2_45_Open_Image.style.display='inline'; Codehighlighter1_2_45_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</SPAN><SPAN id=Codehighlighter1_2_45_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2_45_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@&nbsp;page&nbsp;contentType</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">text/html;&nbsp;charset=GBK</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_51_104_Open_Image onclick="this.style.display='none'; Codehighlighter1_51_104_Open_Text.style.display='none'; Codehighlighter1_51_104_Closed_Image.style.display='inline'; Codehighlighter1_51_104_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_51_104_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_51_104_Closed_Text.style.display='none'; Codehighlighter1_51_104_Open_Image.style.display='inline'; Codehighlighter1_51_104_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</SPAN><SPAN id=Codehighlighter1_51_104_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_51_104_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@&nbsp;taglib&nbsp;uri</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">/WEB-INF/struts-html.tld</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;prefix</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">html</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>index<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">body&nbsp;</SPAN><SPAN style="COLOR: #ff0000">bgcolor</SPAN><SPAN style="COLOR: #0000ff">="#ffffff"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:form&nbsp;</SPAN><SPAN style="COLOR: #ff0000">action</SPAN><SPAN style="COLOR: #0000ff">="show.do"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;method</SPAN><SPAN style="COLOR: #0000ff">="post"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:text&nbsp;</SPAN><SPAN style="COLOR: #ff0000">property</SPAN><SPAN style="COLOR: #0000ff">="name"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:submit&nbsp;</SPAN><SPAN style="COLOR: #ff0000">title</SPAN><SPAN style="COLOR: #0000ff">="确定"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:cancel&nbsp;</SPAN><SPAN style="COLOR: #ff0000">title</SPAN><SPAN style="COLOR: #0000ff">="取消"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html:cancel</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html:form</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:errors</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">body</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果需要加入javascript支持，则：<BR></P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG id=Codehighlighter1_2_45_Open_Image onclick="this.style.display='none'; Codehighlighter1_2_45_Open_Text.style.display='none'; Codehighlighter1_2_45_Closed_Image.style.display='inline'; Codehighlighter1_2_45_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_2_45_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2_45_Closed_Text.style.display='none'; Codehighlighter1_2_45_Open_Image.style.display='inline'; Codehighlighter1_2_45_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</SPAN><SPAN id=Codehighlighter1_2_45_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_2_45_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@&nbsp;page&nbsp;contentType</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">text/html;&nbsp;charset=GBK</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_51_104_Open_Image onclick="this.style.display='none'; Codehighlighter1_51_104_Open_Text.style.display='none'; Codehighlighter1_51_104_Closed_Image.style.display='inline'; Codehighlighter1_51_104_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_51_104_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_51_104_Closed_Text.style.display='none'; Codehighlighter1_51_104_Open_Image.style.display='inline'; Codehighlighter1_51_104_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</SPAN><SPAN id=Codehighlighter1_51_104_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_51_104_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@&nbsp;taglib&nbsp;uri</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">/WEB-INF/struts-html.tld</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;prefix</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">html</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>index<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">title</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">body&nbsp;</SPAN><SPAN style="COLOR: #ff0000">bgcolor</SPAN><SPAN style="COLOR: #0000ff">="#ffffff"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:form&nbsp;</SPAN><SPAN style="COLOR: #ff0000">action</SPAN><SPAN style="COLOR: #0000ff">="show.do"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;method</SPAN><SPAN style="COLOR: #0000ff">="post"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;onsubmit</SPAN><SPAN style="COLOR: #0000ff">="return&nbsp;validateUserForm(this);"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:text&nbsp;</SPAN><SPAN style="COLOR: #ff0000">property</SPAN><SPAN style="COLOR: #0000ff">="name"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:submit&nbsp;</SPAN><SPAN style="COLOR: #ff0000">title</SPAN><SPAN style="COLOR: #0000ff">="确定"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:cancel&nbsp;</SPAN><SPAN style="COLOR: #ff0000">title</SPAN><SPAN style="COLOR: #0000ff">="取消"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html:cancel</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html:form</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html:javascript&nbsp;</SPAN><SPAN style="COLOR: #ff0000">formName</SPAN><SPAN style="COLOR: #0000ff">="userForm"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">body</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注意：onsubmit里的validator<STRONG>UserForm</STRONG>要和下面的formName里的名字一致，只不过首字母大写<BR><BR><BR><STRONG>最后要注意：</STRONG>这只是客户端自动生成Javascript的验证。还要在服务器端进行验证。</P><img src ="http://www.blogjava.net/runforever/aggbug/11340.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-08-27 22:37 <a href="http://www.blogjava.net/runforever/articles/11340.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>我是老土:第一次使用JNDI从WebLogic获取数据库连接</title><link>http://www.blogjava.net/runforever/articles/10383.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Wed, 17 Aug 2005 15:53:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/10383.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/10383.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/10383.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/10383.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/10383.html</trackback:ping><description><![CDATA[<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">package&nbsp;com.satesoft.testjndi;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;java.sql.</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;java.util.</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;javax.naming.</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;javax.sql.</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_137_1258_Open_Image onclick="this.style.display='none'; Codehighlighter1_137_1258_Open_Text.style.display='none'; Codehighlighter1_137_1258_Closed_Image.style.display='inline'; Codehighlighter1_137_1258_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_137_1258_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_137_1258_Closed_Text.style.display='none'; Codehighlighter1_137_1258_Open_Image.style.display='inline'; Codehighlighter1_137_1258_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;TestJNDI&nbsp;</SPAN><SPAN id=Codehighlighter1_137_1258_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_137_1258_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_159_163_Open_Image onclick="this.style.display='none'; Codehighlighter1_159_163_Open_Text.style.display='none'; Codehighlighter1_159_163_Closed_Image.style.display='inline'; Codehighlighter1_159_163_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_159_163_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_159_163_Closed_Text.style.display='none'; Codehighlighter1_159_163_Open_Image.style.display='inline'; Codehighlighter1_159_163_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;TestJNDI()&nbsp;</SPAN><SPAN id=Codehighlighter1_159_163_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_159_163_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG id=Codehighlighter1_207_277_Open_Image onclick="this.style.display='none'; Codehighlighter1_207_277_Open_Text.style.display='none'; Codehighlighter1_207_277_Closed_Image.style.display='inline'; Codehighlighter1_207_277_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_207_277_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_207_277_Closed_Text.style.display='none'; Codehighlighter1_207_277_Open_Image.style.display='inline'; Codehighlighter1_207_277_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;main(String[]&nbsp;args)&nbsp;</SPAN><SPAN id=Codehighlighter1_207_277_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_207_277_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;TestJNDI&nbsp;testJNDI1&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;TestJNDI();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;testJNDI1.connect();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG id=Codehighlighter1_304_1256_Open_Image onclick="this.style.display='none'; Codehighlighter1_304_1256_Open_Text.style.display='none'; Codehighlighter1_304_1256_Closed_Image.style.display='inline'; Codehighlighter1_304_1256_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_304_1256_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_304_1256_Closed_Text.style.display='none'; Codehighlighter1_304_1256_Open_Image.style.display='inline'; Codehighlighter1_304_1256_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;connect()&nbsp;</SPAN><SPAN id=Codehighlighter1_304_1256_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_304_1256_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Context&nbsp;ctx&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">null</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Hashtable&nbsp;ht&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Hashtable();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;ht.put(Context.PROVIDER_URL,&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">t3://localhost:7001</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;ht.put(Context.INITIAL_CONTEXT_FACTORY,<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">weblogic.jndi.WLInitialContextFactory</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;ht.put(Context.SECURITY_PRINCIPAL,"wwx");<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">&nbsp;&nbsp;&nbsp;&nbsp;ht.put(Context.SECURITY_CREDENTIALS,"11111111");</SPAN><SPAN style="COLOR: #008000"><BR><IMG id=Codehighlighter1_631_1054_Open_Image onclick="this.style.display='none'; Codehighlighter1_631_1054_Open_Text.style.display='none'; Codehighlighter1_631_1054_Closed_Image.style.display='inline'; Codehighlighter1_631_1054_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_631_1054_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_631_1054_Closed_Text.style.display='none'; Codehighlighter1_631_1054_Open_Image.style.display='inline'; Codehighlighter1_631_1054_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_631_1054_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_631_1054_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ctx&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;InitialContext(ht);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.println(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ok</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataSource&nbsp;ds&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;(DataSource)&nbsp;ctx.lookup(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">sapp_source</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connection&nbsp;conn&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;ds.getConnection();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PreparedStatement&nbsp;pstmt&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;conn.prepareStatement(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">SELECT&nbsp;*&nbsp;FROM&nbsp;S_ENTITY</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResultSet&nbsp;rs&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;pstmt.executeQuery();<BR><IMG id=Codehighlighter1_954_1007_Open_Image onclick="this.style.display='none'; Codehighlighter1_954_1007_Open_Text.style.display='none'; Codehighlighter1_954_1007_Closed_Image.style.display='inline'; Codehighlighter1_954_1007_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_954_1007_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_954_1007_Closed_Text.style.display='none'; Codehighlighter1_954_1007_Open_Image.style.display='inline'; Codehighlighter1_954_1007_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">while</SPAN><SPAN style="COLOR: #000000">&nbsp;(rs.next())</SPAN><SPAN id=Codehighlighter1_954_1007_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_954_1007_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.println(rs.getString(</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">));<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pstmt.close();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;conn.close();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_1084_1090_Open_Image onclick="this.style.display='none'; Codehighlighter1_1084_1090_Open_Text.style.display='none'; Codehighlighter1_1084_1090_Closed_Image.style.display='inline'; Codehighlighter1_1084_1090_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1084_1090_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1084_1090_Closed_Text.style.display='none'; Codehighlighter1_1084_1090_Open_Image.style.display='inline'; Codehighlighter1_1084_1090_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(SQLException&nbsp;ex)&nbsp;</SPAN><SPAN id=Codehighlighter1_1084_1090_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1084_1090_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_1122_1155_Open_Image onclick="this.style.display='none'; Codehighlighter1_1122_1155_Open_Text.style.display='none'; Codehighlighter1_1122_1155_Closed_Image.style.display='inline'; Codehighlighter1_1122_1155_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1122_1155_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1122_1155_Closed_Text.style.display='none'; Codehighlighter1_1122_1155_Open_Image.style.display='inline'; Codehighlighter1_1122_1155_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(NamingException&nbsp;e)&nbsp;</SPAN><SPAN id=Codehighlighter1_1122_1155_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1122_1155_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e.printStackTrace();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_1169_1252_Open_Image onclick="this.style.display='none'; Codehighlighter1_1169_1252_Open_Text.style.display='none'; Codehighlighter1_1169_1252_Closed_Image.style.display='inline'; Codehighlighter1_1169_1252_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1169_1252_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1169_1252_Closed_Text.style.display='none'; Codehighlighter1_1169_1252_Open_Image.style.display='inline'; Codehighlighter1_1169_1252_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">finally</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_1169_1252_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1169_1252_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_1181_1210_Open_Image onclick="this.style.display='none'; Codehighlighter1_1181_1210_Open_Text.style.display='none'; Codehighlighter1_1181_1210_Closed_Image.style.display='inline'; Codehighlighter1_1181_1210_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1181_1210_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1181_1210_Closed_Text.style.display='none'; Codehighlighter1_1181_1210_Open_Image.style.display='inline'; Codehighlighter1_1181_1210_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_1181_1210_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1181_1210_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ctx.close();<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_1238_1246_Open_Image onclick="this.style.display='none'; Codehighlighter1_1238_1246_Open_Text.style.display='none'; Codehighlighter1_1238_1246_Closed_Image.style.display='inline'; Codehighlighter1_1238_1246_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1238_1246_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1238_1246_Closed_Text.style.display='none'; Codehighlighter1_1238_1246_Open_Image.style.display='inline'; Codehighlighter1_1238_1246_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(Exception&nbsp;e)&nbsp;</SPAN><SPAN id=Codehighlighter1_1238_1246_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1238_1246_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN></DIV></DIV><img src ="http://www.blogjava.net/runforever/aggbug/10383.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-08-17 23:53 <a href="http://www.blogjava.net/runforever/articles/10383.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>加快JBuilder里编辑XML文件的速度</title><link>http://www.blogjava.net/runforever/articles/9840.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Thu, 11 Aug 2005 09:41:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/9840.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/9840.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/9840.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/9840.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/9840.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;加快jbuilder编辑xml的速度 
<HR>
<BR>我们知道,在jbuilder中,编辑xml文件的话, 如果在头部加了dtd, JB会自动去网上下载这个DTD,来验证XML文件, 这功能当然是非<BR>常好的, 但是,给我们造成了速度慢的困扰, 特别是打开xml和保存,修改的时候. <BR>其实在jb中,是可以改变这个速度的. 采用的是地址映射的方法, 把HTTP地址,映射到本地的目录上来.<BR>我是在hibernate的xml文件中实践的<BR>先用flashget 下载 http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd 这个DTD文件. 把他放到硬盘上的一<BR>个目录里,然后在JB里,选择TOOLS, preferences,&nbsp; 然后选xml 下面的 System ID Catalog, 点ADD,加入一个映射<BR>在输入框是里填入http://hibernate.sourceforge.net/ 这代表要把这段网址映射成硬盘上的某个目录, 然后下面选directy, 选择放上面dtd的目录.<BR>当然也可以映射文件. 方法同上,只是remap成file就OK了.<BR>以上方法，是在jbuilderX中通过的<img src ="http://www.blogjava.net/runforever/aggbug/9840.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-08-11 17:41 <a href="http://www.blogjava.net/runforever/articles/9840.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Struts中文乱码问题解决方案</title><link>http://www.blogjava.net/runforever/articles/9753.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Wed, 10 Aug 2005 15:06:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/9753.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/9753.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/9753.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/9753.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/9753.html</trackback:ping><description><![CDATA[<FONT color=#555555>三种解决方式如下 <BR><BR>1、可以覆盖父类ActionServelt 的process 方法（针对服务器） <BR>在其中加入如下代码： <BR>request.setCharacterEncoding ("GB2312");//字符集内码转换 <BR>super.process (request, response);//ActionServlet 的处理 <BR><BR>2、针对Validate方法 <BR>&nbsp; &nbsp;native2ascii -encoding GBK ApplicationResources_xx.properties ApplicationResources_zh.properties <BR><BR><BR>3、提交的中文字符在服务器端(JBOSS)乱码 <BR>解决办法：增加一个filter，里面将request中的中文转换为GBK <BR>public void doFilter(ServletRequest request, ServletResponse response, <BR>&nbsp; FilterChain chain) throws IOException, ServletException { <BR>&nbsp; &nbsp; request.setCharacterEncoding("GBK"); <BR>&nbsp; &nbsp; chain.doFilter(request,response); <BR>} </FONT><BR><img src ="http://www.blogjava.net/runforever/aggbug/9753.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-08-10 23:06 <a href="http://www.blogjava.net/runforever/articles/9753.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在JBuilderX中配置Tomcat5(改编自Borland网站的一篇文章)</title><link>http://www.blogjava.net/runforever/articles/9751.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Wed, 10 Aug 2005 14:50:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/9751.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/9751.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/9751.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/9751.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/9751.html</trackback:ping><description><![CDATA[<P>1 配置步骤（来自原文）</P>
<P>This is not a supported or tested configuration. This is just a workaround to get the server running in JBuilder X. JSP debugging will not work with this solution.</P>
<P>Steps: </P>
<P>1. Tools | Configure Servers, select the Tomcat 4.1 server and click the Copy button. Change the name to Tomcat 5.0. Next, set the home directory to the root of the Tomcat 5.0 installation, and remove the entry in the Class list and add &lt;TOMCAT_5.0_HOME&gt;/bin/bootstrap.jar.</P>
<P>2. File | New Project. Set server to Tomcat 5.0 and create a web module. This will trigger generation of the Tomcat 5.0 Servlet library.</P>
<P>3. Tools | Configure Libraries. Edit the Tomcat 5.0 Servlet library and add the following jars :</P>
<P>&lt;TOMCAT_5.0_HOME&gt;/common/lib/jsp-api.jar<BR>&lt;TOMCAT_5.0_HOME&gt;/common/lib/servlet-api.jar<BR>&lt;TOMCAT_5.0_HOME&gt;/bin/commons-logging-api.jar<BR>&lt;TOMCAT_5.0_HOME&gt;/common/lib/commons-el.jar</P>
<P>Make a backup of this library (in your user home directory) as it gets regenerated when you create a new web module/JSP/servlet. Please make sure that you replace the library when you use any of the web gallery wizards.</P>
<P>4. Set server for the project to Tomcat 5.0.</P>
<P>5. If a "Tomcat" folder is not present under the project's root directory, create one (e.g. ../jbproject/untitled1/Tomcat). Next, create a directory named "conf" under this directory (e.g. ../jbproject/untitled1/Tomcat/conf). and create an XML file named server8080.xml. Sample server8080.xml is below. Please modify the appBase, docBase, and workDir, etc. according to your web module properties:</P>
<P>&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;?</SPAN><SPAN style="COLOR: #ff00ff">xml&nbsp;version="1.0"&nbsp;encoding="UTF-8"</SPAN><SPAN style="COLOR: #0000ff">?&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">Server&nbsp;</SPAN><SPAN style="COLOR: #ff0000">debug</SPAN><SPAN style="COLOR: #0000ff">="0"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;port</SPAN><SPAN style="COLOR: #0000ff">="8081"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;shutdown</SPAN><SPAN style="COLOR: #0000ff">="SHUTDOWN"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">Service&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="Tomcat-Standalone"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">Connector&nbsp;</SPAN><SPAN style="COLOR: #ff0000">acceptCount</SPAN><SPAN style="COLOR: #0000ff">="10"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;className</SPAN><SPAN style="COLOR: #0000ff">="org.apache.coyote.tomcat5.CoyoteConnector"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;connectionTimeout</SPAN><SPAN style="COLOR: #0000ff">="60000"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;debug</SPAN><SPAN style="COLOR: #0000ff">="0"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;maxProcessors</SPAN><SPAN style="COLOR: #0000ff">="75"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;minProcessors</SPAN><SPAN style="COLOR: #0000ff">="5"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;port</SPAN><SPAN style="COLOR: #0000ff">="8080"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">Engine&nbsp;</SPAN><SPAN style="COLOR: #ff0000">debug</SPAN><SPAN style="COLOR: #0000ff">="0"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;defaultHost</SPAN><SPAN style="COLOR: #0000ff">="localhost"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;name</SPAN><SPAN style="COLOR: #0000ff">="Standalone"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">Host&nbsp;</SPAN><SPAN style="COLOR: #ff0000">appBase</SPAN><SPAN style="COLOR: #0000ff">="{项目根目录}\Tomcat\webapps"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;debug</SPAN><SPAN style="COLOR: #0000ff">="0"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;name</SPAN><SPAN style="COLOR: #0000ff">="localhost"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;unpackWARs</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">Context&nbsp;</SPAN><SPAN style="COLOR: #ff0000">debug</SPAN><SPAN style="COLOR: #0000ff">="0"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;docBase</SPAN><SPAN style="COLOR: #0000ff">="{项目根目录}\{web文件目录名称}"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;path</SPAN><SPAN style="COLOR: #0000ff">="/sapp"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;reloadable</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;workDir</SPAN><SPAN style="COLOR: #0000ff">="{项目根目录}\Tomcat\work\{web文件目录名称}"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">Host</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">Engine</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">Service</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">Server</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV></DIV>
<P>&nbsp;</P>
<P>6. Start the server in JBuilder. This should use the modified server8080.xml</P>
<P>You should be able to compile JSPs using this workaround but not debug. You should be able to debug any java code. You will see a number of exceptions for the admin, manager, balancer services which do not get started when you normally run the server in JBuilder. Please ignore these exceptions. The server should function normally without these services.</P>
<P><BR>2 配置过程中遇到的一些问题及解决办法<BR>2.1 出现XML解析异常<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 解决方法：为项目引用加上JDom Library引用<BR>2.2 Servlet引用Library引用有问题<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 解决方法：仔细检查上述步骤三的是否为Tomcat 5 Servlet配置成功相应的jar。<BR>2.3 一定要把上述步骤5中的配置文件设置正确，否则出现严重错误。</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </P>
<P>&nbsp;</P><img src ="http://www.blogjava.net/runforever/aggbug/9751.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-08-10 22:50 <a href="http://www.blogjava.net/runforever/articles/9751.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ant的Build.xml示例</title><link>http://www.blogjava.net/runforever/articles/9626.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Mon, 08 Aug 2005 19:55:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/9626.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/9626.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/9626.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/9626.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/9626.html</trackback:ping><description><![CDATA[<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;?</SPAN><SPAN style="COLOR: #ff00ff">xml&nbsp;version="1.0"</SPAN><SPAN style="COLOR: #0000ff">?&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #008000">&lt;!--</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Build&nbsp;file&nbsp;for&nbsp;the&nbsp;JCatalog&nbsp;Project.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;Derek&nbsp;Y.&nbsp;Shen<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;6/2004<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #008000">--&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">project&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="jcatalog"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;default</SPAN><SPAN style="COLOR: #0000ff">="build.war"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;basedir</SPAN><SPAN style="COLOR: #0000ff">="."</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">&lt;!--</SPAN><SPAN style="COLOR: #008000">&nbsp;Configure&nbsp;the&nbsp;context&nbsp;path&nbsp;for&nbsp;this&nbsp;application&nbsp;</SPAN><SPAN style="COLOR: #008000">--&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">property&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="project.name"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="catalog"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">property&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="build.dir"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="${basedir}/build"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">property&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="src.dir"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="${basedir}/src"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">property&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="src.java.dir"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="${src.dir}"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">property&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="docs.dir"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="${basedir}/docs"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">property&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="docs.api.dir"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="${docs.dir}/api"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">property&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="web.dir"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="${basedir}/web"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">property&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="lib.dir"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="${basedir}/lib"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">property&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="dist.dir"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value</SPAN><SPAN style="COLOR: #0000ff">="${basedir}/dist"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">path&nbsp;</SPAN><SPAN style="COLOR: #ff0000">id</SPAN><SPAN style="COLOR: #0000ff">="classpath"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">fileset&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${lib.dir}"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="**/*.jar"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">fileset</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">path</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">target&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="clean"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">delete&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">target</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">target&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="prepare"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;depends</SPAN><SPAN style="COLOR: #0000ff">="clean"</SPAN><SPAN style="COLOR: #ff0000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;description</SPAN><SPAN style="COLOR: #0000ff">="Create&nbsp;build&nbsp;directories."</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">mkdir&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}/${project.name}"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">mkdir&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}/${project.name}/WEB-INF"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">mkdir&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}/${project.name}/WEB-INF/classes"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">mkdir&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}/${project.name}/WEB-INF/lib"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">target</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">target&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="deploy.copyJars"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">copy&nbsp;</SPAN><SPAN style="COLOR: #ff0000">todir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}/${project.name}/WEB-INF/lib"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">fileset&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="lib"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="**/*.jar"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="**/*.dtd"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">fileset</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">copy</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">target</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">&lt;!--</SPAN><SPAN style="COLOR: #008000">&nbsp;Executable&nbsp;Targets&nbsp;</SPAN><SPAN style="COLOR: #008000">--&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">target&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="build"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;depends</SPAN><SPAN style="COLOR: #0000ff">="prepare,deploy.copyJars"</SPAN><SPAN style="COLOR: #ff0000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;description</SPAN><SPAN style="COLOR: #0000ff">="Compile&nbsp;Java&nbsp;files&nbsp;and&nbsp;copy&nbsp;static&nbsp;files."</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">javac&nbsp;</SPAN><SPAN style="COLOR: #ff0000">srcdir</SPAN><SPAN style="COLOR: #0000ff">="${src.java.dir}"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;destdir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}/${project.name}/WEB-INF/classes"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="**/*.java"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">classpath&nbsp;</SPAN><SPAN style="COLOR: #ff0000">refid</SPAN><SPAN style="COLOR: #0000ff">="classpath"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">javac</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">copy&nbsp;</SPAN><SPAN style="COLOR: #ff0000">todir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}/${project.name}/WEB-INF"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">fileset&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${web.dir}/WEB-INF"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="*.xml"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="*.tld"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">fileset</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">copy</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">copy&nbsp;</SPAN><SPAN style="COLOR: #ff0000">todir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}/${project.name}/"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">fileset&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${web.dir}"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="*.html"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="*.gif"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="*.jpg"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="*.jsp"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="*.xml"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="*.css"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">fileset</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">copy</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">copy&nbsp;</SPAN><SPAN style="COLOR: #ff0000">todir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}/${project.name}/images"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">fileset&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${web.dir}/images"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="**/*.gif"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="**/*.jpg"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">fileset</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">copy</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">copy&nbsp;</SPAN><SPAN style="COLOR: #ff0000">todir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}/${project.name}/WEB-INF/classes"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">fileset&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${src.java.dir}"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="**/*.properties"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">include&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="**/*.xml"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">exclude&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="**/*.java"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">fileset</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">copy</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">target</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">target&nbsp;</SPAN><SPAN style="COLOR: #ff0000">name</SPAN><SPAN style="COLOR: #0000ff">="build.war"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;depends</SPAN><SPAN style="COLOR: #0000ff">="build"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">delete&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${dist.dir}"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">mkdir&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${dist.dir}"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">&lt;!--</SPAN><SPAN style="COLOR: #008000">&nbsp;create&nbsp;a&nbsp;war&nbsp;file&nbsp;for&nbsp;distribution&nbsp;</SPAN><SPAN style="COLOR: #008000">--&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">jar&nbsp;</SPAN><SPAN style="COLOR: #ff0000">destfile</SPAN><SPAN style="COLOR: #0000ff">="${dist.dir}/${project.name}.war"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;basedir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}/${project.name}"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">delete&nbsp;</SPAN><SPAN style="COLOR: #ff0000">dir</SPAN><SPAN style="COLOR: #0000ff">="${build.dir}"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">target</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">project</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV></DIV><img src ="http://www.blogjava.net/runforever/aggbug/9626.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-08-09 03:55 <a href="http://www.blogjava.net/runforever/articles/9626.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JBuiler X下Hiberante 2.1.7配置</title><link>http://www.blogjava.net/runforever/articles/9565.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Mon, 08 Aug 2005 05:57:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/9565.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/9565.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/9565.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/9565.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/9565.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;发送的发<img src ="http://www.blogjava.net/runforever/aggbug/9565.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-08-08 13:57 <a href="http://www.blogjava.net/runforever/articles/9565.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JBuilder X下Tomcat 5 服务器配置</title><link>http://www.blogjava.net/runforever/articles/9564.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Mon, 08 Aug 2005 05:51:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/9564.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/9564.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/9564.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/9564.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/9564.html</trackback:ping><description><![CDATA[稍等<img src ="http://www.blogjava.net/runforever/aggbug/9564.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-08-08 13:51 <a href="http://www.blogjava.net/runforever/articles/9564.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse运行命令行参数大全</title><link>http://www.blogjava.net/runforever/articles/9471.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Sat, 06 Aug 2005 04:37:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/9471.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/9471.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/9471.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/9471.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/9471.html</trackback:ping><description><![CDATA[<BR>包括英文版本和中文版本两种的说明,特别需要值得一提的是那个-nl参数,可以指定程序启动时所使用的<A name=3></A><B style="COLOR: black; BACKGROUND-COLOR: #ff9999">语言</B>.例如:<BR>eclipse -nl en_US<BR>将启动英文<B style="COLOR: black; BACKGROUND-COLOR: #ff9999">语言</B>,这个特性在安装了国际化<B style="COLOR: black; BACKGROUND-COLOR: #ff9999">语言</B>包以后特别有用,可以方便的切换各个<B style="COLOR: black; BACKGROUND-COLOR: #ff9999">语言</B>的版本.注意IBM<A name=0></A><B style="COLOR: black; BACKGROUND-COLOR: #ffff66">WSAD</B>v5.1也支持这个功能.<BR><BR>运行Eclipse<BR>将Eclipse驱动程序安装（解压缩）到某个目录（例如，c:\eclipse）中之后，通过运行顶级安装目录中的Eclipse可执行文件来启动"工作台"。在Windows系统上，该可执行文件称为eclipse.exe，而在Linux系统上称为eclipse。注意：下列讨论描述Windows系统上的设置。Linux上的设置是相似的。<BR><BR>如果您没有另行指定，则平台将缺省工作区目录创建为可执行文件的兄弟目录（例如c:\eclipse\workspace）。此工作区目录用作项目的缺省内容区，还用于保存任何必需的元数据。要进行共享安装或多工作区安装，应明确指出工作区的位置而不是使用缺省值。有两种控制工作区位置的方法：使用当前工作目录或使用-data命令行自变量。<BR><BR>将工作区位置设置为在当前工作目录内<BR>在此方案中，工作区位置将是当前工作目录中称为workspace的目录。<BR><BR>实现此目的最容易的方法可能是使用下列步骤来创建快捷方式：<BR><BR>导航到Windows资源管理器中的eclipse.exe并使用右键拖动来创建eclipse.exe的快捷方式。<BR>编辑快捷方式的属性，以使启动位置：字段标识工作区位置的父目录（例如，c:\users\robert）。<BR>关闭属性对话框并双击快捷方式（如果提供的目录为c:\users\robert，则工作区位置将为c:\users\robert\workspace）。<BR>当然，您也可以使用命令提示符（通过将目录切换为工作区父目录然后运行eclipse.exe）来获得同样的效果。<BR><BR>使用-data设置工作区的特定位置<BR>要使用-data命令行自变量，只要将-datayour_workspace_location（例如，-datac:\users\robert\myworkspace）添加至快捷方式属性中的目标字段或显式地将它包括在命令行上。<BR><BR>使用-vm设置javaVM<BR>建议显式指定在运行Eclipse时要使用哪个JavaVM。使用-vm命令行自变量（例如，-vmc:\jre\bin\javaw.exe）可以实现此目的。如果不使用-vm，则Eclipse将使用在O/S路径上找到的一个JavaVM。当安装其它产品时，它们可更改您的路径，导致在下一次启动Eclipse时使用另一JavaVM。<BR><BR>运行Eclipse中的高级主题<BR>Eclipse可执行文件及平台本身提供了人们感兴趣的开发或调试Eclipse各部件的许多执行选项。运行Eclipse可执行文件的一般格式是：<BR><BR>eclipse[platformoptions][-vmargs[JavaVMarguments]]<BR>Eclipse<B style="COLOR: black; BACKGROUND-COLOR: #a0ffff">启动参数</B>命令描述原因<BR>-archarchitecture<BR>定义Eclipse平台在其上运行的处理器体系结构。Eclipse平台通常使用Javaos.arch属性的常用值来计算最佳设置。如果在此处指定该项，则这是Eclipse平台使用的值。此处指定的值可作为BootLoader.getOSArch()用于插件。示例值有："x86"、"sparc"、"PA-RISC"和"ppc"。2.0<BR>-applicationapplicationId<BR>要运行的应用程序。应用程序由向org.eclipse.core.runtime.applications扩展点提供扩展的插件来声明。通常不需要此自变量。如果指定了此项，则该值会覆盖配置提供的值。如果不指定此项，则会运行"Eclipse工作台"。1.0<BR>-bootbootJarURL<BR>（建议不使用；用-configuration代替；支持1.0兼容）。Eclipse平台的引导插件代码（boot.jar）的位置，表示为URL。如果指定此项，则会用它来为装入Eclipse平台引导程序类装入器的类装入器设置类路径。仅当更改startup.jar和boot.jar的相对位置时才需要它。注意，不允许使用相对URL。*1.0<BR>-classloaderproperties[file]<BR>如果指定的话，则使用给定位置处的类装入器属性文件来激活平台类类装入器增强。文件自变量可以是文件路径或URL。注意，不允许使用相对URL。单击此处以获得更多详细信息。2.0.2<BR>-configurationconfigurationFileURL<BR>Eclipse平台配置文件的位置，表示为URL。配置文件确定Eclipse平台、可用插件集和主要功能部件的位置。注意，不允许使用相对URL。当安装或更新Eclipse平台时配置文件被写至此位置。2.0<BR>-consolelog<BR>将Eclipse平台的错误日志镜像到用来运行Eclipse的控制台。与-debug组合时很方便使用。1.0<BR>-dataworkspacePath<BR>要运行Eclipse平台的工作区的路径。工作区位置也是项目的缺省位置。相对于从中启动eclipse的目录来解释相对路径。1.0<BR>-debug[optionsFile]<BR>将平台置于调试方式，并从给定位置处的文件装入调试选项（如果指定的话）。此文件指示哪些调试点可用于插件以及是否已启用它们。如果未给出文件位置，则平台在启动eclipse的目录中查找称为".options"的文件。URL和文件系统路径都可作为文件位置。1.0<BR>-dev[classpathEntries]<BR>将平台置于开发方式。将可选类路径条目（用逗号分隔的列表）添加至每个插件的运行时类路径。例如，当工作区包含要开发的插件时，指定-devbin会为每个插件项目的名为bin的目录添加类路径条目，允许在其中存储最新生成的类文件。除去了冗余或不存在的类路径条目。1.0<BR>-endsplashparams<BR>用于在Eclipse平台启动并运行时关闭闪屏的内部选项。此选项在闪屏处理链中不同的位置有不同的语法和语义。2.0<BR>-featurefeatureId<BR>主要功能部件的标识。主要功能部件为Eclipse的已启动实例提供了产品个性，并确定使用的产品定制信息。2.0<BR>-keyringkeyringFilePath<BR>磁盘上授权数据库（或"密钥环"文件）的位置。此自变量必须与-password选项配合使用。相对于从中启动eclipse的目录来解释相对路径。1.0<BR>-nllocale<BR>定义Eclipse平台在其上运行的<B style="COLOR: black; BACKGROUND-COLOR: #ff9999">语言</B>环境的名称。Eclipse平台通常自动计算最佳设置。如果在此处指定该项，则这是Eclipse平台使用的值。此处指定的值可作为BootLoader.getNL()用于插件。示例值有："en_US"和"fr_FR_EURO"。2.0<BR>-nolazyregistrycacheloading<BR>取消激活装入优化的平台插件注册表高速缓存。缺省情况下，仅当需要时才从注册表高速缓存（可用时）中装入扩展的配置元素，以减少内存占用。此选项将在启动时强制完全装入注册表高速缓存。2.1<BR>-noregistrycache<BR>绕过读写内部插件注册表高速缓存文件。2.0<BR>-nosplash<BR>运行平台而不显示闪屏。1.0<BR>-osoperatingSystem<BR>定义Eclipse平台在其上运行的操作系统。Eclipse平台通常使用Javaos.name属性的常用值来计算最佳设置。如果在此处指定该项，则这是Eclipse平台使用的值。此处指定的值可作为BootLoader.getOS()用于插件，并用于解析插件清单文件中提及的路径中$os$变量的出现。示例值有："win32"、"linux"、"hpux"、"solaris"和"aix"。1.0<BR>-passwordpassword<BR>授权数据库的密码。与-keyring选项配合使用。1.0<BR>-perspectiveperspectiveId<BR>启动时要在活动工作台窗口中打开的透视图。如果没有指定该参数，则将打开关闭时活动的透视图。1.0<BR>-plugincustomizationpropertiesFile<BR>包含插件首选项缺省设置的属性文件的位置。这些缺省设置覆盖在主要功能部件中指定的缺省设置。相对于从中启动eclipse的目录来解释相对路径。2.0<BR>-pluginspluginsFileURL<BR>（建议不使用；用-configuration代替；支持1.0兼容）。指定Eclipse平台查找插件的文件的位置，表示为URL。该文件为属性文件格式，其中键是任意用户定义名称，值是指向plugin.xml文件的显式路径或指向包含插件的目录的路径的用逗号分隔的列表。注意，不允许使用相对URL。如果指定此项，则此选项会导致创建适当的临时配置。*1.0<BR>-refresh<BR>启动时执行工作区的全局刷新的选项。这将使从上次平台运行以来在文件系统中所做的任何更改一致。1.0<BR>-showlocation<BR>用于在窗口标题栏中显示工作区的位置的选项。在发行版2.0中，此选项仅与-data命令行自变量一起使用。2.0<BR>-showsplashparams<BR>用于显示闪屏（由可执行的Eclipse平台启动器执行）的内部选项。此选项在闪屏处理链中不同的位置有不同的语法和语义。2.0<BR>-vmvmPath<BR>要用来运行Eclipse平台的"Java运行时环境"（JRE）的位置。如果不指定此项，则JRE位于jre（它是Eclipse可执行文件的兄弟目录）。相对于从中启动eclipse的目录来解释相对路径。1.0<BR>-wswindowSystem<BR>定义Eclipse平台在其上运行的Windows系统。Eclipse平台通常使用Javaos.name属性的常用值来计算最佳设置。如果在此处指定该项，则这是Eclipse平台使用的值。此处指定的值可作为BootLoader.getWS()用于插件、用于配置SWT以及用于解析插件清单文件中提及的路径中$ws$变量的出现。示例值有："win32"、"motif"和"gtk"。1.0<BR><BR>将-vmargs条目后面的所有自变量（但不包括-vmargs）作为虚拟机自变量（即，在要运行的类的前面）直接传递到所指示的JavaVM。注意：如果Eclipse启动在Javavm自变量（-vmargs）之后提供的自变量（例如，-data），则Eclipse将不会启动并且您将接收到"JVM已终止。出口代码为1"的错误。<BR><BR>在不同的VM上运行<BR>在J9上运行Eclipse<BR>当在J9版本1.5上运行Eclipse时，建议使用以下VM选项：<BR><BR>eclipse.exe[eclipsearguments]-vmpath_to_j9w.exe-vmargs-ms:32-mm:2048-mo:32768-moi:32768-mca:32-mco:128-mx:2000000<BR>当在J9版本2.0上运行Eclipse时，J9W选择的缺省自变量应为合适的选项。但是，要覆盖Eclipse可执行文件以内部方式自动设置的参数，必须指定-vmargs不带任何参数，如下所示：<BR><BR>eclipse.exe[eclipsearguments]-vmpath_to_j9w.exe-vmargs<BR>有关进一步信息，参考J9VM文档和帮助。<BR><BR>在IBMDeveloperKit,Java(TM)TechnologyEditionVM上运行Eclipse<BR>IBMDeveloperKit,Java(TM)TechnologyEdition1.3Linux的缺省VM设置适合进行初期研究工作，但在进行大型开发时是不够的。对于大型开发，应修改VM自变量以使有更多的堆可用。例如，下列设置将允许Java堆增大为256MB：<BR><img src ="http://www.blogjava.net/runforever/aggbug/9471.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-08-06 12:37 <a href="http://www.blogjava.net/runforever/articles/9471.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>《jakarta struts编程》阅读笔记</title><link>http://www.blogjava.net/runforever/articles/9151.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Wed, 03 Aug 2005 12:14:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/9151.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/9151.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/9151.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/9151.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/9151.html</trackback:ping><description><![CDATA[<P><STRONG>第五章 Struts控制器组件</STRONG><BR><BR><STRONG><EM>实用工具类<BR></EM></STRONG>1.RequestUtils<BR>2.ResponseUtils<BR>3.BeanUtils<BR>4.Common Collection包<BR><BR><STRONG>第六章 Struts模型组件<BR></STRONG><BR><STRONG><EM>一.模型种类<BR></EM></STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG>模型:</STRONG>标明真实世界的逻辑表达,也表明供程序所使用的类和接口的物理组成.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<STRONG>模型开发过程:</STRONG>彻底分析问题域,用例分析,下一步就是开发概念模型<BR>1.概念模型<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1) 概念模型从系统中的一套用例中开发出来<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(2) 建立这个模型的[目的]:帮助识别实体并更好的了解问题域,这些实体在设计阶段极可能成为类<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(3)&nbsp;[价值]:表示出问题域所使用的实体<BR>2.设计模型<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(1)&nbsp;内容:通常包括类图表,交互图表<BR><BR>二.业务对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;业务对象就是简单的真实世界的软件抽象.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.业务对象的必要条件<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">· </SPAN>业务对象由状态和行为组成.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">· 表达了来自业务域的一个人,地点,事物或概念<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">· 可以重用<BR>&nbsp;&nbsp;&nbsp;&nbsp;2.业务对象的种类<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">· 实体业务对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;通常是从业务域中的业务名词直接提取出来的.如客户,订单,物品.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可以映射到实体bean或包含业务应用程序的状态和行为的普通JavaBean&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR></SPAN><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</STRONG><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">· 过程业务对象<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;表达应用程序中的业务处理过程或者工作流程任务.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;通常依赖于实体业务对象,是业务的动词<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;可以映射到会话Bean,消息驱动bean,或者包含特定行为作为应用程序管理者或者控制者的Javabean<BR></SPAN>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">· 事件业务对象</SPAN><SPAN style="FONT-SIZE: 10.5pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 12.0pt; mso-font-kerning: 1.0pt; mso-bidi-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">&nbsp;</SPAN><BR><BR><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;<BR></STRONG></SPAN><BR><BR><BR><BR><BR><BR><BR><BR><BR><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR><BR><BR><BR><BR><BR></STRONG></P><img src ="http://www.blogjava.net/runforever/aggbug/9151.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-08-03 20:14 <a href="http://www.blogjava.net/runforever/articles/9151.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Log4j入门(讲的真不错，把重要内容基本讲到了，详细配置要参照文档了)</title><link>http://www.blogjava.net/runforever/articles/8678.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Thu, 28 Jul 2005 14:09:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/8678.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/8678.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/8678.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/8678.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/8678.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;
<CENTER>
<H1>Short introduction to log4j</H1><FONT size=+2>Ceki Gülcü</FONT> <BR><BR>March 2002 <BR></CENTER>
<P>Copyright © 2000-2004 The Apache Software Foundation. All rights reserved. This software is published under the terms of the Apache Software License version 1.1, a copy of which has been included in the LICENSE.txt file shipped with the log4j distribution. The present short manual also borrows some text from <A href="https://www.qos.ch/shop/products/log4j/log4j-Manual.jsp">"<EM>The complete log4j manual</EM>"</A>, which contains more detailed and up to date information, by the same author (yours truly). </P>
<H2>Abstract</H2>
<P>This document describes the log4j API, its unique features and design rationale. Log4j is an open source project based on the work of many authors. It allows the developer to control which log statements are output with arbitrary granularity. It is fully configurable at runtime using external configuration files. Best of all, log4j has a gentle learning curve. Beware: judging from user feedback, it is also quite addictive. 
<H2>Introduction</H2>
<P>Almost every large application includes its own logging or tracing API. In conformance with this rule, the E.U. <A href="http://www.semper.org/">SEMPER</A> project decided to write its own tracing API. This was in early 1996. After countless enhancements, several incarnations and much work that API has evolved to become log4j, a popular logging package for Java. The package is distributed under the <A href="http://www.apache.org/licenses/LICENSE-2.0.txt">Apache Software License</A>, a fully-fledged open source license certified by the <A href="http://www.opensource.org/">open source</A> initiative. The latest log4j version, including full-source code, class files and documentation can be found at <A href="http://logging.apache.org/log4j/"><B>http://logging.apache.org/log4j/</B></A>. By the way, log4j has been ported to the C, C++, C#, Perl, Python, Ruby, and Eiffel languages. 
<P>Inserting log statements into code is a low-tech method for debugging it. It may also be the only way because debuggers are not always available or applicable. This is usually the case for multithreaded applications and distributed applications at large. 
<P>Experience indicates that logging was an important component of the development cycle. It offers several advantages. It provides precise <EM>context</EM> about a run of the application. Once inserted into the code, the generation of logging output requires no human intervention. Moreover, log output can be saved in a persistent medium to be studied at a later time. In addition to its use in the development cycle, a sufficiently-rich logging package can also be viewed as an auditing tool. 
<P>As Brian W. Kernighan and Rob Pike put it in their truly excellent book <I>"The Practice of Programming"</I> <PRE>  As personal choice, we tend not to use debuggers beyond getting a
  stack trace or the value of a variable or two. One reason is that it
  is easy to get lost in details of complicated data structures and
  control flow; we find stepping through a program less productive
  than thinking harder and adding output statements and self-checking
  code at critical places. Clicking over statements takes longer than
  scanning the output of judiciously-placed displays. It takes less
  time to decide where to put print statements than to single-step to
  the critical section of code, even assuming we know where that
  is. More important, debugging statements stay with the program;
  debugging sessions are transient.
</PRE>
<P>Logging does have its drawbacks. It can slow down an application. If too verbose, it can cause scrolling blindness. To alleviate these concerns, log4j is designed to be reliable, fast and extensible. Since logging is rarely the main focus of an application, the log4j API strives to be simple to understand and to use. 
<H2>Loggers, Appenders and Layouts</H2>
<P>Log4j has three main components: <EM>loggers</EM>, <EM>appenders</EM> and <EM>layouts</EM>. These three types of components work together to enable developers to log messages according to message type and level, and to control at runtime how these messages are formatted and where they are reported. 
<H3>Logger hierarchy</H3>
<P>The first and foremost advantage of any logging API over plain <CODE>System.out.println</CODE> resides in its ability to disable certain log statements while allowing others to print unhindered. This capability assumes that the logging space, that is, the space of all possible logging statements, is categorized according to some developer-chosen criteria. This observation had previously led us to choose <EM>category</EM> as the central concept of the package. However, since log4j version 1.2, <CODE>Logger</CODE> class has replaced the <CODE>Category</CODE> class. For those familiar with earlier versions of log4j, the <CODE>Logger</CODE> class can be considered as a mere alias to the <CODE>Category</CODE> class. 
<P>Loggers are named entities. Logger names are case-sensitive and they follow the hierarchical naming rule: 
<P>
<TABLE bgColor=#eeee99>
<TBODY>
<TR>
<TD>
<DL>
<DT><B>Named Hierarchy</B> 
<DD>
<P>A logger is said to be an <EM>ancestor</EM> of another logger if its name followed by a dot is a prefix of the <EM>descendant</EM> logger name. A logger is said to be a <EM>parent</EM> of a <EM>child</EM> logger if there are no ancestors between itself and the descendant logger. </P></DD></DL></TD></TR></TBODY></TABLE>
<P>For example, the logger named <CODE>"com.foo"</CODE> is a parent of the logger named <CODE>"com.foo.Bar"</CODE>. Similarly, <CODE>"java"</CODE> is a parent of <CODE>"java.util"</CODE> and an ancestor of <CODE>"java.util.Vector"</CODE>. This naming scheme should be familiar to most developers. 
<P>The root logger resides at the top of the logger hierarchy. It is exceptional in two ways: 
<OL>
<LI>it always exists, 
<LI>it cannot be retrieved by name. </LI></OL>
<P>Invoking the class static <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Logger.html#getRootLogger()">Logger.getRootLogger</A> method retrieves it. All other loggers are instantiated and retrieved with the class static <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Logger.html#getLogger()">Logger.getLogger</A> method. This method takes the name of the desired logger as a parameter. Some of the basic methods in the Logger class are listed below. 
<P>
<TABLE>
<TBODY>
<TR bgColor=#cccccc>
<TD><PRE>  package org.apache.log4j;

  public class <B>Logger</B> {

    // Creation &amp; retrieval methods:
    public static Logger getRootLogger();
    public static Logger getLogger(String name);

    // printing methods:
    public void debug(Object message);
    public void info(Object message);
    public void warn(Object message);
    public void error(Object message);
    public void fatal(Object message);

    // generic printing method:
    public void log(Level l, Object message);
}
</PRE></TD></TR></TBODY></TABLE>
<P>Loggers <EM>may</EM> be assigned levels. The set of possible levels, that is <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Level.html#DEBUG">DEBUG</A>, <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Level.html#INFO">INFO</A>, <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Level.html#WARN">WARN</A>, <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Level.html#ERROR">ERROR</A> and <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Level.html#FATAL">FATAL</A> are defined in the <CODE><A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Level.html">org.apache.log4j.Level</A></CODE> class. Although we do not encourage you to do so, you may define your own levels by sub-classing the <CODE>Level</CODE> class. A perhaps better approach will be explained later on. 
<P>If a given logger is not assigned a level, then it inherits one from its closest ancestor with an assigned level. More formally: 
<P>
<TABLE bgColor=#eeee99>
<TBODY>
<TR>
<TD>
<DL>
<DT><B>Level Inheritance</B> 
<DD>
<P>The <EM>inherited level</EM> for a given logger <I>C</I>, is equal to the first non-null level in the logger hierarchy, starting at <I>C</I> and proceeding upwards in the hierarchy towards the <CODE>root</CODE> logger. </P></DD></DL></TD></TR></TBODY></TABLE>
<P>To ensure that all loggers can eventually inherit a level, the root logger always has an assigned level. 
<P>Below are four tables with various assigned level values and the resulting inherited levels according to the above rule. 
<P>
<TABLE border=1>
<TBODY>
<TR>
<TH>Logger<BR>name</TH>
<TH>Assigned<BR>level</TH>
<TH>Inherited<BR>level</TH></TR>
<TR align=left>
<TD>root</TD>
<TD>Proot</TD>
<TD>Proot</TD></TR>
<TR align=left>
<TD>X </TD>
<TD>none</TD>
<TD>Proot</TD></TR>
<TR align=left>
<TD>X.Y </TD>
<TD>none</TD>
<TD>Proot</TD></TR>
<TR align=left>
<TD>X.Y.Z</TD>
<TD>none</TD>
<TD>Proot</TD></TR>
<CAPTION align=bottom>Example 1</CAPTION></TABLE>
<P>In example 1 above, only the root logger is assigned a level. This level value, <CODE>Proot</CODE>, is inherited by the other loggers <CODE>X</CODE>, <CODE>X.Y</CODE> and <CODE>X.Y.Z</CODE>. 
<P>
<TABLE border=1>
<TBODY>
<TR>
<TH>Logger<BR>name</TH>
<TH>Assigned<BR>level</TH>
<TH>Inherited<BR>level</TH></TR>
<TR align=left>
<TD>root</TD>
<TD>Proot</TD>
<TD>Proot</TD></TR>
<TR align=left>
<TD>X </TD>
<TD>Px</TD>
<TD>Px</TD></TR>
<TR align=left>
<TD>X.Y </TD>
<TD>Pxy</TD>
<TD>Pxy</TD></TR>
<TR align=left>
<TD>X.Y.Z</TD>
<TD>Pxyz</TD>
<TD>Pxyz</TD></TR>
<CAPTION align=bottom>Example 2</CAPTION></TABLE>
<P>In example 2, all loggers have an assigned level value. There is no need for level inheritence. 
<P>
<TABLE border=1>
<TBODY>
<TR>
<TH>Logger<BR>name</TH>
<TH>Assigned<BR>level</TH>
<TH>Inherited<BR>level</TH></TR>
<TR align=left>
<TD>root</TD>
<TD>Proot</TD>
<TD>Proot</TD></TR>
<TR align=left>
<TD>X </TD>
<TD>Px</TD>
<TD>Px</TD></TR>
<TR align=left>
<TD>X.Y </TD>
<TD>none</TD>
<TD>Px</TD></TR>
<TR align=left>
<TD>X.Y.Z</TD>
<TD>Pxyz</TD>
<TD>Pxyz</TD></TR>
<CAPTION align=bottom>Example 3</CAPTION></TABLE>
<P>In example 3, the loggers <CODE>root</CODE>, <CODE>X</CODE> and <CODE>X.Y.Z</CODE> are assigned the levels <CODE>Proot</CODE>, <CODE>Px</CODE> and <CODE>Pxyz</CODE> respectively. The logger <CODE>X.Y</CODE> inherits its level value from its parent <CODE>X</CODE>. 
<TABLE border=1>
<TBODY>
<TR>
<TH>Logger<BR>name</TH>
<TH>Assigned<BR>level</TH>
<TH>Inherited<BR>level</TH></TR>
<TR align=left>
<TD>root</TD>
<TD>Proot</TD>
<TD>Proot</TD></TR>
<TR align=left>
<TD>X </TD>
<TD>Px</TD>
<TD>Px</TD></TR>
<TR align=left>
<TD>X.Y </TD>
<TD>none</TD>
<TD>Px</TD></TR>
<TR align=left>
<TD>X.Y.Z</TD>
<TD>none</TD>
<TD>Px</TD></TR>
<CAPTION align=bottom>Example 4</CAPTION></TABLE>
<P>In example 4, the loggers <CODE>root</CODE> and <CODE>X</CODE> and are assigned the levels <CODE>Proot</CODE> and <CODE>Px</CODE> respectively. The loggers <CODE>X.Y</CODE> and <CODE>X.Y.Z</CODE> inherits their level value from their nearest parent <CODE>X</CODE> having an assigned level.. 
<P>Logging requests are made by invoking one of the printing methods of a logger instance. These printing methods are <CODE><A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Logger.html#debug(java.lang.Object)">debug</A>, <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Logger.html#info(java.lang.Object)">info</A>, <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Logger.html#warn(java.lang.Object)">warn</A>, <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Logger.html#error(java.lang.Object)">error</A>, <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Logger.html#fatal(java.lang.Object)">fatal</A> and <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Logger.html#log(org.apache.log4j.Level, java.lang.Object)">log</A></CODE>. 
<P>By definition, the printing method determines the level of a logging request. For example, if <CODE>c</CODE> is a logger instance, then the statement <CODE>c.info("..")</CODE> is a logging request of level INFO. 
<P>A logging request is said to be <EM>enabled</EM> if its level is higher than or equal to the level of its logger. Otherwise, the request is said to be <EM>disabled</EM>. A logger without an assigned level will inherit one from the hierarchy. This rule is summarized below. 
<P><A name=selectionRule>
<TABLE bgColor=#eeee99>
<TBODY>
<TR>
<TD>
<DL>
<DT><B>Basic Selection Rule</B> 
<DD>
<P>A log request of level <I>p</I> in a logger with (either assigned or inherited, whichever is appropriate) level <I>q</I>, is enabled if <I>p &gt;= q</I>. </P></DD></DL></TD></TR></TBODY></TABLE>
<P>This rule is at the heart of log4j. It assumes that levels are ordered. For the standard levels, we have <CODE>DEBUG &lt; INFO &lt; WARN &lt; ERROR &lt; FATAL</CODE>. 
<P>Here is an example of this rule. 
<P>
<TABLE bgColor=#cccccc>
<TBODY>
<TR>
<TD><PRE>   // get a logger instance named "com.foo"
   Logger  logger = Logger.getLogger(<STRONG>"com.foo"</STRONG>);

   // Now set its level. Normally you do not need to set the
   // level of a logger programmatically. This is usually done
   // in configuration files.
   <STRONG>logger</STRONG>.setLevel(<FONT color=#0000aa><STRONG>Level.INFO</STRONG></FONT>);

   Logger barlogger = Logger.getLogger(<STRONG>"com.foo.Bar"</STRONG>);

   // This request is enabled, because <FONT color=#00aa00><STRONG>WARN</STRONG></FONT> &gt;= <FONT color=#0000aa><STRONG>INFO</STRONG></FONT>.
   logger.<FONT color=#00aa00><STRONG>warn</STRONG></FONT>("Low fuel level.");

   // This request is disabled, because <FONT color=#00aa00><STRONG>DEBUG</STRONG></FONT> &lt; <FONT color=#0000aa><STRONG>INFO</STRONG></FONT>.
   logger.<FONT color=#00aa00><STRONG>debug</STRONG></FONT>("Starting search for nearest gas station.");

   // The logger instance barlogger, named "com.foo.Bar",
   // will inherit its level from the logger named
   // "com.foo" Thus, the following request is enabled
   // because <FONT color=#00aa00><STRONG>INFO</STRONG></FONT> &gt;= <FONT color=#0000aa><STRONG>INFO</STRONG></FONT>.
   barlogger.<FONT color=#00aa00><STRONG>info</STRONG></FONT>("Located nearest gas station.");

   // This request is disabled, because <FONT color=#00aa00><STRONG>DEBUG</STRONG></FONT> &lt; <FONT color=#0000aa><STRONG>INFO</STRONG></FONT>.
   barlogger.<FONT color=#00aa00><STRONG>debug</STRONG></FONT>("Exiting gas station search");
</PRE></TD></TR></TBODY></TABLE>
<P>Calling the <CODE>getLogger</CODE> method with the same name will always return a reference to the exact same logger object. 
<P>For example, in 
<TABLE bgColor=#cccccc>
<TBODY>
<TR>
<TD><PRE>   Logger x = Logger.getLogger("wombat");
   Logger y = Logger.getLogger("wombat");</PRE></TD></TR></TBODY></TABLE><CODE>x</CODE> and <CODE>y</CODE> refer to <EM>exactly</EM> the same logger object. 
<P>Thus, it is possible to configure a logger and then to retrieve the same instance somewhere else in the code without passing around references. In fundamental contradiction to biological parenthood, where parents always preceed their children, log4j loggers can be created and configured in any order. In particular, a "parent" logger will find and link to its descendants even if it is instantiated after them. 
<P>Configuration of the log4j environment is typically done at application initialization. The preferred way is by reading a configuration file. This approach will be discussed shortly. 
<P>Log4j makes it easy to name loggers by <EM>software component</EM>. This can be accomplished by statically instantiating a logger in each class, with the logger name equal to the fully qualified name of the class. This is a useful and straightforward method of defining loggers. As the log output bears the name of the generating logger, this naming strategy makes it easy to identify the origin of a log message. However, this is only one possible, albeit common, strategy for naming loggers. Log4j does not restrict the possible set of loggers. The developer is free to name the loggers as desired. 
<P>Nevertheless, naming loggers after the class where they are located seems to be the best strategy known so far. 
<H2>Appenders and Layouts</H2>
<P>The ability to selectively enable or disable logging requests based on their logger is only part of the picture. Log4j allows logging requests to print to multiple destinations. In log4j speak, an output destination is called an <EM>appender</EM>. Currently, appenders exist for the <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/ConsoleAppender.html">console</A>, <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/FileAppender.html">files</A>, GUI components, <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SocketAppender.html">remote socket</A> servers, <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/JMSAppender.html">JMS</A>, <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/nt/NTEventLogAppender.html">NT Event Loggers</A>, and remote UNIX <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/net/SyslogAppender.html">Syslog</A> daemons. It is also possible to log <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/AsyncAppender.html">asynchronously</A>. 
<P>More than one appender can be attached to a logger. 
<P>The <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Logger.html#addAppender(org.apache.log4j.Appender)">addAppender</A> method adds an appender to a given logger. <B>Each enabled logging request for a given logger will be forwarded to all the appenders in that logger as well as the appenders higher in the hierarchy.</B> In other words, appenders are inherited additively from the logger hierarchy. For example, if a console appender is added to the root logger, then all enabled logging requests will at least print on the console. If in addition a file appender is added to a logger, say <EM>C</EM>, then enabled logging requests for <EM>C</EM> and <EM>C</EM>'s children will print on a file <EM>and</EM> on the console. It is possible to override this default behavior so that appender accumulation is no longer additive by <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Logger.html#setAdditivity(boolean)">setting the additivity flag</A> to <CODE>false</CODE>. 
<P>The rules governing appender additivity are summarized below. 
<P><A name=additivity>
<TABLE bgColor=#eeee99>
<TBODY>
<TR>
<TD>
<DL>
<DT><B>Appender Additivity</B> 
<DD>
<P>The output of a log statement of logger <I>C</I> will go to all the appenders in <I>C</I> and its ancestors. This is the meaning of the term "appender additivity". 
<P>However, if an ancestor of logger <I>C</I>, say <I>P</I>, has the additivity flag set to <CODE>false</CODE>, then <I>C</I>'s output will be directed to all the appenders in <I>C</I> and it's ancestors upto and including <I>P</I> but not the appenders in any of the ancestors of <I>P</I>. 
<P>Loggers have their additivity flag set to <CODE>true</CODE> by default. </P></DD></DL></TD></TR></TBODY></TABLE>
<P>The table below shows an example: 
<P>
<TABLE cellPadding=10 align=center border=3>
<TBODY>
<TR rowspan="2">
<TH>Logger<BR>Name 
<TH>Added<BR>Appenders 
<TH>Additivity<BR>Flag 
<TH>Output Targets 
<TH>Comment 
<TR>
<TD>root 
<TD>A1 
<TD>not applicable 
<TD>A1 
<TD>The root logger is anonymous but can be accessed with the Logger.getRootLogger() method. There is no default appender attached to root. 
<TR>
<TD>x 
<TD>A-x1, A-x2 
<TD>true 
<TD>A1, A-x1, A-x2 
<TD>Appenders of "x" and root. 
<TR>
<TD>x.y 
<TD>none 
<TD>true 
<TD>A1, A-x1, A-x2 
<TD>Appenders of "x" and root. 
<TR>
<TD>x.y.z 
<TD>A-xyz1 
<TD>true 
<TD>A1, A-x1, A-x2, A-xyz1 
<TD>Appenders in "x.y.z", "x" and root. 
<TR>
<TD>security 
<TD>A-sec 
<TD><FONT color=blue>false</FONT> 
<TD>A-sec 
<TD>No appender accumulation since the additivity flag is set to <CODE>false</CODE>. 
<TR>
<TD>security.access 
<TD>none 
<TD>true 
<TD>A-sec 
<TD>Only appenders of "security" because the additivity flag in "security" is set to <CODE>false</CODE>. </TD></TR></TBODY></TABLE>
<P>More often than not, users wish to customize not only the output destination but also the output format. This is accomplished by associating a <EM>layout</EM> with an appender. The layout is responsible for formatting the logging request according to the user's wishes, whereas an appender takes care of sending the formatted output to its destination. The <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html">PatternLayout</A>, part of the standard log4j distribution, lets the user specify the output format according to conversion patterns similar to the C language <CODE>printf</CODE> function. 
<P>For example, the PatternLayout with the conversion pattern "%r [%t] %-5p %c - %m%n" will output something akin to: <PRE>176 [main] INFO  org.foo.Bar - Located nearest gas station.
</PRE>
<P>The first field is the number of milliseconds elapsed since the start of the program. The second field is the thread making the log request. The third field is the level of the log statement. The fourth field is the name of the logger associated with the log request. The text after the '-' is the message of the statement. 
<P>Just as importantly, log4j will render the content of the log message according to user specified criteria. For example, if you frequently need to log <CODE>Oranges</CODE>, an object type used in your current project, then you can register an <CODE>OrangeRenderer</CODE> that will be invoked whenever an orange needs to be logged. 
<P>Object rendering follows the class hierarchy. For example, assuming oranges are fruits, if you register an <CODE>FruitRenderer</CODE>, all fruits including oranges will be rendered by the <CODE>FruitRenderer</CODE>, unless of course you registered an orange specific <CODE>OrangeRenderer</CODE>. 
<P>Object renderers have to implement the <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/or/ObjectRenderer.html">ObjectRenderer</A> interface. 
<H2>Configuration</H2>
<P>Inserting log requests into the application code requires a fair amount of planning and effort. Observation shows that approximately 4 percent of code is dedicated to logging. Consequently, even moderately sized applications will have thousands of logging statements embedded within their code. Given their number, it becomes imperative to manage these log statements without the need to modify them manually. 
<P>The log4j environment is fully configurable programmatically. However, it is far more flexible to configure log4j using configuration files. Currently, configuration files can be written in XML or in Java properties (key=value) format. 
<P>Let us give a taste of how this is done with the help of an imaginary application <CODE>MyApp</CODE> that uses log4j. 
<P>
<TABLE bgColor=#cccccc>
<TBODY>
<TR>
<TD><PRE> import com.foo.Bar;

 // Import log4j classes.
 <B>import org.apache.log4j.Logger;
 import org.apache.log4j.BasicConfigurator;</B>

 public class MyApp {

   // Define a static logger variable so that it references the
   // Logger instance named "MyApp".
   <STRONG>static</STRONG> Logger logger = <STRONG>Logger.getLogger(MyApp.class);</STRONG>

   public static void main(String[] args) {

     // Set up a simple configuration that logs on the console.
     <STRONG>BasicConfigurator.configure();</STRONG>

     logger.info("Entering application.");
     Bar bar = new Bar();
     bar.doIt();
     logger.info("Exiting application.");
   }
 }
</PRE></TD></TR></TBODY></TABLE>
<P><CODE>MyApp</CODE> begins by importing log4j related classes. It then defines a static logger variable with the name <CODE>MyApp</CODE> which happens to be the fully qualified name of the class. 
<P><CODE>MyApp</CODE> uses the <CODE>Bar</CODE> class defined in the package <CODE>com.foo</CODE>. 
<P>
<TABLE bgColor=#cccccc>
<TBODY>
<TR>
<TD><PRE> <B>package com.foo;</B>
 import org.apache.log4j.Logger;

 public class Bar {
   <STRONG>static</STRONG> Logger logger = <STRONG>Logger.getLogger(Bar.class);</STRONG>

   public void doIt() {
     logger.debug("Did it again!");
   }
 }
</PRE></TD></TR></TBODY></TABLE>
<P>The invocation of the <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/BasicConfigurator.html#configure()">BasicConfigurator.configure</A> method creates a rather simple log4j setup. This method is hardwired to add to the root logger a <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/ConsoleAppender.html">ConsoleAppender</A>. The output will be formatted using a <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/PatternLayout.html">PatternLayout</A> set to the pattern "%-4r [%t] %-5p %c %x - %m%n". 
<P>Note that by default, the root logger is assigned to <CODE>Level.DEBUG</CODE>. 
<P>The output of MyApp is: <PRE>0    [main] INFO  MyApp  - Entering application.
36   [main] DEBUG com.foo.Bar  - Did it again!
51   [main] INFO  MyApp  - Exiting application.
</PRE>
<P>The figure below depicts the object diagram of <CODE>MyApp</CODE> after just having called the <CODE>BasicConfigurator.configure</CODE> method. 
<P>
<CENTER><IMG src="http://logging.apache.org/log4j/docs/od.gif" align=center> </CENTER>
<P>As a side note, let me mention that in log4j child loggers link only to their existing ancestors. In particular, the logger named <CODE>com.foo.Bar</CODE> is linked directly to the <CODE>root</CODE> logger, thereby circumventing the unused <CODE>com</CODE> or <CODE>com.foo</CODE> loggers. This significantly increases performance and reduces log4j's memory footprint. 
<P>The <CODE>MyApp</CODE> class configures log4j by invoking <CODE>BasicConfigurator.configure</CODE> method. Other classes only need to import the <CODE>org.apache.log4j.Logger</CODE> class, retrieve the loggers they wish to use, and log away. 
<P>The previous example always outputs the same log information. Fortunately, it is easy to modify <CODE>MyApp</CODE> so that the log output can be controlled at run-time. Here is a slightly modified version. 
<P>
<TABLE bgColor=#cccccc>
<TBODY>
<TR>
<TD><PRE> import com.foo.Bar;

 import org.apache.log4j.Logger;
 <B>import org.apache.log4j.PropertyConfigurator;</B>

 public class MyApp {

   static Logger logger = Logger.getLogger(MyApp.class.getName());

   public static void main(String[] args) {


     // BasicConfigurator replaced with PropertyConfigurator.
     <STRONG>PropertyConfigurator.configure(args[0]);</STRONG>

     logger.info("Entering application.");
     Bar bar = new Bar();
     bar.doIt();
     logger.info("Exiting application.");
   }
 }
</PRE></TD></TR></TBODY></TABLE>
<P>This version of <CODE>MyApp</CODE> instructs <CODE>PropertyConfigurator</CODE> to parse a configuration file and set up logging accordingly. 
<P>Here is a sample configuration file that results in exactly same output as the previous <CODE>BasicConfigurator</CODE> based example. 
<P>
<TABLE bgColor=#ccaaaa>
<TBODY>
<TR>
<TD><PRE># Set root logger level to DEBUG and its only appender to A1.
log4j.rootLogger=DEBUG, A1

# A1 is set to be a ConsoleAppender.
log4j.appender.A1=org.apache.log4j.ConsoleAppender

# A1 uses PatternLayout.
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
</PRE></TD></TR></TBODY></TABLE><!-- <p>Please note that if you copy and paste the examples, then result is
likely to include trailing spaces on some lines. These trailing spaces
are not trimmed out but interpreted by the PropertyConfigurator.  By
the time you read this article the problem should be corrected.
-->
<P>Suppose we are no longer interested in seeing the output of any component belonging to the <CODE>com.foo</CODE> package. The following configuration file shows one possible way of achieving this. 
<P>
<TABLE bgColor=#ccaaaa>
<TBODY>
<TR>
<TD><PRE>log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

# <STRONG>Print the date in ISO 8601 format</STRONG>
log4j.appender.A1.layout.ConversionPattern=<STRONG>%d</STRONG> [%t] %-5p %c - %m%n

# Print only messages of level WARN or above in the package com.foo.
<STRONG>log4j.logger.com.foo=WARN</STRONG>
</PRE></TD></TR></TBODY></TABLE>
<P>The output of <CODE>MyApp</CODE> configured with this file is shown below. <PRE><STRONG>2000-09-07 14:07:41,508</STRONG> [main] INFO  MyApp - Entering application.
<STRONG>2000-09-07 14:07:41,529</STRONG> [main] INFO  MyApp - Exiting application.
</PRE>
<P>As the logger <CODE>com.foo.Bar</CODE> does not have an assigned level, it inherits its level from <CODE>com.foo</CODE>, which was set to WARN in the configuration file. The log statement from the <CODE>Bar.doIt</CODE> method has the level DEBUG, lower than the logger level WARN. Consequently, <CODE>doIt()</CODE> method's log request is suppressed. 
<P>Here is another configuration file that uses multiple appenders. 
<P>
<TABLE bgColor=#ccaaaa>
<TBODY>
<TR>
<TD><PRE>log4j.rootLogger=debug, <STRONG>stdout, R</STRONG>

log4j.appender.<STRONG>stdout</STRONG>=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] <STRONG>(%F:%L)</STRONG> - %m%n

log4j.appender.<STRONG>R</STRONG>=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log

log4j.appender.R.MaxFileSize=<STRONG>100KB</STRONG>
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
</PRE></TD></TR></TBODY></TABLE>
<P>Calling the enhanced MyApp with the this configuration file will output the following on the console. <PRE> INFO [main] <STRONG>(MyApp2.java:12)</STRONG> - Entering application.
DEBUG [main] (Bar.java:8) - Doing it again!
 INFO [main] (MyApp2.java:15) - Exiting application.
</PRE>
<P>In addition, as the root logger has been allocated a second appender, output will also be directed to the <CODE>example.log</CODE> file. This file will be rolled over when it reaches 100KB. When roll-over occurs, the old version of <CODE>example.log</CODE> is automatically moved to <CODE>example.log.1</CODE>. 
<P>Note that to obtain these different logging behaviors we did not need to recompile code. We could just as easily have logged to a UNIX Syslog daemon, redirected all <CODE>com.foo</CODE> output to an NT Event logger, or forwarded logging events to a remote log4j server, which would log according to local server policy, for example by forwarding the log event to a second log4j server. <A name=defaultInit>
<H2>Default Initialization Procedure</H2>
<P>The log4j library does not make any assumptions about its environment. In particular, there are no default log4j appenders. Under certain well-defined circumstances however, the static inializer of the <CODE>Logger</CODE> class will attempt to automatically configure log4j. The Java language guarantees that the static initializer of a class is called once and only once during the loading of a class into memory. It is important to remember that different classloaders may load distinct copies of the same class. These copies of the same class are considered as totally unrelated by the JVM. 
<P>The default initialization is very useful in environments where the exact entry point to the application depends on the runtime environment. For example, the same application can be used as a stand-alone application, as an applet, or as a servlet under the control of a web-server. 
<P>The exact default initialization algorithm is defined as follows: 
<OL>
<LI>Setting the <B>log4j.defaultInitOverride</B> system property to any other value then "false" will cause log4j to skip the default initialization procedure (this procedure). 
<P></P>
<LI>Set the <CODE>resource</CODE> string variable to the value of the <B>log4j.configuration</B> system property. <EM>The preferred way to specify the default initialization file is through the <B>log4j.configuration</B> system property.</EM> In case the system property <B>log4j.configuration</B> is not defined, then set the string variable <CODE>resource</CODE> to its default value "log4j.properties". 
<P></P>
<LI>Attempt to convert the <CODE>resource</CODE> variable to a URL. 
<P></P>
<LI>If the resource variable cannot be converted to a URL, for example due to a <CODE>MalformedURLException</CODE>, then search for the <CODE>resource</CODE> from the classpath by calling <CODE>org.apache.log4j.helpers.Loader.getResource(resource, Logger.class)</CODE> which returns a URL. Note that the string "log4j.properties" constitutes a malformed URL. 
<P>See <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/helpers/Loader.html#getResource(java.lang.String)">Loader.getResource(java.lang.String)</A> for the list of searched locations. 
<P></P>
<LI>If no URL could not be found, abort default initialization. Otherwise, configure log4j from the URL. 
<P>The <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/PropertyConfigurator.html">PropertyConfigurator</A> will be used to parse the URL to configure log4j unless the URL ends with the ".xml" extension, in which case the <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/xml/DOMConfigurator.html">DOMConfigurator</A> will be used. You can optionaly specify a custom configurator. The value of the <B>log4j.configuratorClass</B> system property is taken as the fully qualified class name of your custom configurator. The custom configurator you specify <EM>must</EM> implement the <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/spi/Configurator.html">Configurator</A> interface. </P></LI></OL>
<H2>Example Configurations</H2>
<H2>Default Initialization under Tomcat</H2>
<P>The default log4j initialization is particularly useful in web-server environments. Under Tomcat 3.x and 4.x, you should place the <CODE>log4j.properties</CODE> under the <CODE>WEB-INF/classes</CODE> directory of your web-applications. Log4j will find the properties file and initialize itself. This is easy to do and it works. 
<P>You can also choose to set the system property <B>log4j.configuration</B> before starting Tomcat. For Tomcat 3.x The <CODE>TOMCAT_OPTS</CODE> environment variable is used to set command line options. For Tomcat 4.0, set the <CODE>CATALINA_OPTS</CODE> environment variable instead of <CODE>TOMCAT_OPTS</CODE>. 
<P><B>Example 1</B> 
<P>The Unix shell command <PRE>   export TOMCAT_OPTS="-Dlog4j.configuration=foobar.txt"
</PRE>tells log4j to use the file <CODE>foobar.txt</CODE> as the default configuration file. This file should be place under the <CODE>WEB-INF/classes</CODE> directory of your web-application. The file will be read using the <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/xml/PropertyConfigurator.html">PropertyConfigurator</A>. Each web-application will use a different default configuration file because each file is relative to a web-application. 
<P><B>Example 2</B> 
<P>The Unix shell command <PRE>   export TOMCAT_OPTS="-Dlog4j.debug -Dlog4j.configuration=foobar.xml"
</PRE>tells log4j to output log4j-internal debugging information and to use the file <CODE>foobar.xml</CODE> as the default configuration file. This file should be place under the <CODE>WEB-INF/classes</CODE> directory of your web-application. Since the file ends with a <CODE>.xml</CODE> extension, it will read using the <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/xml/DOMConfigurator.html">DOMConfigurator</A>. Each web-application will use a different default configuration file because each file is relative to a web-application. 
<P><B>Example 3</B> 
<P>The Windows shell command <PRE>   set TOMCAT_OPTS=-Dlog4j.configuration=foobar.lcf -Dlog4j.configuratorClass=com.foo.BarConfigurator
</PRE>tells log4j to use the file <CODE>foobar.lcf</CODE> as the default configuration file. This file should be place under the <CODE>WEB-INF/classes</CODE> directory of your web-application. Due to the definition of the <B>log4j.configuratorClass</B> system property, the file will be read using the <CODE>com.foo.BarConfigurator</CODE> custom configurator. Each web-application will use a different default configuration file because each file is relative to a web-application. 
<P><B>Example 4</B> 
<P>The Windows shell command <PRE>   set TOMCAT_OPTS=-Dlog4j.configuration=file:/c:/foobar.lcf</PRE>tells log4j to use the file <CODE>c:\foobar.lcf</CODE> as the default configuration file. The configuration file is fully specified by the URL <CODE>file:/c:/foobar.lcf</CODE>. Thus, the same configuration file will be used for all web-applications. 
<P>Different web-applications will load the log4j classes through their respective classloaderss. Thus, each image of the log4j environment will act independetly and without any mutual synchronization. For example, <CODE>FileAppenders</CODE> defined exactly the same way in multiple web-application configurations will all attempt to write the same file. The results are likely to be less than satisfactory. You must make sure that log4j configurations of different web-applications do not use the same underlying system resource. 
<P><B>Initialization servlet</B> 
<P>It is also possible to use a special servlet for log4j initialization. Here is an example, 
<P>
<TABLE bgColor=#cccccc>
<TBODY>
<TR>
<TD><PRE>package com.foo;

import org.apache.log4j.PropertyConfigurator;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.io.IOException;

public class Log4jInit extends HttpServlet {

  public
  void <B>init()</B> {
    String prefix =  getServletContext().getRealPath("/");
    String file = getInitParameter("log4j-init-file");
    // if the log4j-init-file is not set, then no point in trying
    if(file != null) {
      PropertyConfigurator.configure(prefix+file);
    }
  }

  public
  void doGet(HttpServletRequest req, HttpServletResponse res) {
  }
}
</PRE></TD></TR></TBODY></TABLE>
<P>Define the following servlet in the web.xml file for your web-application. 
<P>
<TABLE bgColor=#ccaaaa>
<TBODY>
<TR>
<TD><PRE>  &lt;servlet&gt;
    &lt;servlet-name&gt;log4j-init&lt;/servlet-name&gt;
    &lt;servlet-class&gt;com.foo.Log4jInit&lt;/servlet-class&gt;

    &lt;init-param&gt;
      &lt;param-name&gt;log4j-init-file&lt;/param-name&gt;
      &lt;param-value&gt;WEB-INF/classes/log4j.lcf&lt;/param-value&gt;
    &lt;/init-param&gt;

    <B>&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;</B>
  &lt;/servlet&gt;
</PRE></TD></TR></TBODY></TABLE>
<P>Writing an initialization servlet is the most flexible way for initializing log4j. There are no constraints on the code you can place in the <CODE>init()</CODE> method of the servlet. 
<H2>Nested Diagnostic Contexts</H2>
<P>Most real-world systems have to deal with multiple clients simultaneously. In a typical multithreaded implementation of such a system, different threads will handle different clients. Logging is especially well suited to trace and debug complex distributed applications. A common approach to differentiate the logging output of one client from another is to instantiate a new separate logger for each client. This promotes the proliferation of loggers and increases the management overhead of logging. 
<P>A lighter technique is to uniquely stamp each log request initiated from the same client interaction. Neil Harrison described this method in the book "Patterns for Logging Diagnostic Messages," in <EM>Pattern Languages of Program Design 3</EM>, edited by R. Martin, D. Riehle, and F. Buschmann (Addison-Wesley, 1997). 
<P>To uniquely stamp each request, the user pushes contextual information into the NDC, the abbreviation of <EM>Nested Diagnostic Context</EM>. The NDC class is shown below. <PRE>  public class NDC {
    // Used when printing the diagnostic
    public <STRONG>static</STRONG> String get();

    // Remove the top of the context from the NDC.
    public <STRONG>static</STRONG> String pop();

    // Add diagnostic context for the current thread.
    public <STRONG>static</STRONG> void push(String message);

    // Remove the diagnostic context for this thread.
    public <STRONG>static</STRONG> void remove();
  }
</PRE>
<P>The NDC is managed per thread as a <EM>stack</EM> of contextual information. Note that all methods of the <CODE>org.apache.log4j.NDC</CODE> class are static. Assuming that NDC printing is turned on, every time a log request is made, the appropriate log4j component will include the <EM>entire</EM> NDC stack for the current thread in the log output. This is done without the intervention of the user, who is responsible only for placing the correct information in the NDC by using the <CODE>push</CODE> and <CODE>pop</CODE> methods at a few well-defined points in the code. In contrast, the per-client logger approach commands extensive changes in the code. 
<P>To illustrate this point, let us take the example of a servlet delivering content to numerous clients. The servlet can build the NDC at the very beginning of the request before executing other code. The contextual information can be the client's host name and other information inherent to the request, typically information contained in cookies. Hence, even if the servlet is serving multiple clients simultaneously, the logs initiated by the same code, i.e. belonging to the same logger, can still be distinguished because each client request will have a different NDC stack. Contrast this with the complexity of passing a freshly instantiated logger to all code exercised during the client's request. 
<P>Nevertheless, some sophisticated applications, such as virtual hosting web servers, must log differently depending on the virtual host context and also depending on the software component issuing the request. Recent log4j releases support multiple hierarchy trees. This enhancement allows each virtual host to possess its own copy of the logger hierarchy. <A name=performance>
<H2>Performance</H2>
<P>One of the often-cited arguments against logging is its computational cost. This is a legitimate concern as even moderately sized applications can generate thousands of log requests. Much effort was spent measuring and tweaking logging performance. Log4j claims to be fast and flexible: speed first, flexibility second. 
<P>The user should be aware of the following performance issues. 
<OL><B>
<LI>Logging performance when logging is turned off.</B> 
<P>When logging is turned off entirely or just for a <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/Hierarchy.html#setThreshold(java.lang.String)">set of levels</A>, the cost of a log request consists of a method invocation plus an integer comparison. On a 233 MHz Pentium II machine this cost is typically in the 5 to 50 nanosecond range. 
<P>However, The method invocation involves the "hidden" cost of parameter construction. 
<P>For example, for some logger <CODE>cat</CODE>, writing, <PRE>     logger.debug("Entry number: " + i + " is " + String.valueOf(entry[i]));
    </PRE>incurs the cost of constructing the message parameter, i.e. converting both integer <CODE>i</CODE> and <CODE>entry[i]</CODE> to a String, and concatenating intermediate strings, regardless of whether the message will be logged or not. This cost of parameter construction can be quite high and it depends on the size of the parameters involved. 
<P>To avoid the parameter construction cost write: <PRE>      if(logger.isDebugEnabled() {
        logger.debug("Entry number: " + i + " is " + String.valueOf(entry[i]));
      }
   </PRE>
<P>This will not incur the cost of parameter construction if debugging is disabled. On the other hand, if the logger is debug-enabled, it will incur twice the cost of evaluating whether the logger is enabled or not: once in <CODE>debugEnabled</CODE> and once in <CODE>debug</CODE>. This is an insignificant overhead because evaluating a logger takes about 1% of the time it takes to actually log. 
<P>In log4j, logging requests are made to instances of the Logger class. Logger is a class and not an interface. This measurably reduces the cost of method invocation at the cost of some flexibility. 
<P>Certain users resort to preprocessing or compile-time techniques to compile out all log statements. This leads to perfect performance efficiency with respect to logging. However, since the resulting application binary does not contain any log statements, logging cannot be turned on for that binary. In my opinion this is a disproportionate price to pay in exchange for a small performance gain. 
<P><B></P>
<LI>The performance of deciding whether to log or not to log when logging is turned on.</B> 
<P></P>
<P>This is essentially the performance of walking the logger hierarchy. When logging is turned on, log4j still needs to compare the level of the log request with the level of the request logger. However, loggers may not have an assigned level; they can inherit them from the logger hierarchy. Thus, before inheriting a level, the logger may need to search its ancestors. 
<P>There has been a serious effort to make this hierarchy walk to be as fast as possible. For example, child loggers link only to their existing ancestors. In the <CODE>BasicConfigurator</CODE> example shown earlier, the logger named <CODE>com.foo.Bar</CODE> is linked directly to the root logger, thereby circumventing the nonexistent <CODE>com</CODE> or <CODE>com.foo</CODE> loggers. This significantly improves the speed of the walk, especially in "sparse" hierarchies. 
<P>The typical cost of walking the hierarchy is typically 3 times slower than when logging is turned off entirely. 
<P><B></P>
<LI>Actually outputting log messages</B> 
<P>This is the cost of formatting the log output and sending it to its target destination. Here again, a serious effort was made to make layouts (formatters) perform as quickly as possible. The same is true for appenders. The typical cost of actually logging is about 100 to 300 microseconds. See <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/performance/Logging.html">org.apache.log4.performance.Logging</A> for actual figures. </P></LI></OL>
<P>Although log4j has many features, its first design goal was speed. Some log4j components have been rewritten many times to improve performance. Nevertheless, contributors frequently come up with new optimizations. You should be pleased to know that when configured with the <A href="http://logging.apache.org/log4j/docs/api/org/apache/log4j/SimpleLayout.html">SimpleLayout</A> performance tests have shown log4j to log as quickly as <CODE>System.out.println</CODE>. 
<H2>Conclusions</H2>
<P>Log4j is a popular logging package written in Java. One of its distinctive features is the notion of inheritance in loggers. Using a logger hierarchy it is possible to control which log statements are output at arbitrary granularity. This helps reduce the volume of logged output and minimize the cost of logging. 
<P>One of the advantages of the log4j API is its manageability. Once the log statements have been inserted into the code, they can be controlled with configuration files. They can be selectively enabled or disabled, and sent to different and multiple output targets in user-chosen formats. The log4j package is designed so that log statements can remain in shipped code without incurring a heavy performance cost. 
<H2>Acknowledgments</H2>Many thanks to N. Asokan for reviewing the article. He is also one of the originators of the logger concept. I am indebted to Nelson Minar for encouraging me to write this article. He has also made many useful suggestions and corrections to this article. Log4j is the result of a collective effort. My special thanks go to all the authors who have contributed to the project. Without exception, the best features in the package have all originated in the user community. <img src ="http://www.blogjava.net/runforever/aggbug/8678.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-28 22:09 <a href="http://www.blogjava.net/runforever/articles/8678.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Log4j配置</title><link>http://www.blogjava.net/runforever/articles/8677.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Thu, 28 Jul 2005 13:34:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/8677.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/8677.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/8677.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/8677.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/8677.html</trackback:ping><description><![CDATA[Log4j的几个问题：<BR><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">·log4j的三大组件：logger,appender,layout</SPAN><BR>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">·</SPAN>怎么在web环境中配置Log4j<BR><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">·</SPAN>如何理解log4j<BR><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">·</SPAN>正确的配置log4j.properties<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ConversionPattern的配置：<BR><BR><SPAN style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">·</SPAN>程序中如何正确的使用logger<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR><BR><STRONG>1.Log4j在web环境中的配置<BR></STRONG>　　首先到jakarta下载一个log4j的组件。把jakarta-log4j-1.2.8\dist\lib下的log4j-1.2.8.jar文件copy到classpath指定的目录下！可以是Tomcat的common\lib目录下，也可以是你需要用到log4j的application下的lib目录。<BR>　　1.4在Application目录下的web.xml文件加入以后代码<BR>　　&lt;servlet&gt;<BR>　　&lt;servlet-name&gt;log4j&lt;/servlet-name&gt;<BR>　　&lt;servlet-class&gt;com.apache.jakarta.log4j.Log4jInit&lt;/servlet-class&gt;<BR>　　&lt;init-param&gt;<BR>　　&lt;param-name&gt;log4j&lt;/param-name&gt;<BR>　　&lt;param-value&gt;/WEB-INF/log4j.properties&lt;/param-value&gt;<BR>　　&lt;/init-param&gt;<BR>　　&lt;load-on-startup&gt;1&lt;/load-on-startup&gt;<BR>　　&lt;/servlet&gt;<BR><BR>Logger的四个级别：DEBUG&lt;INFO&lt;WARN&lt;ERROR&lt;FATAL<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;log4j的配置文件大致分为以下几部分：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.rootLogger的配置&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;log4j.rootLogger=debug,&nbsp;stdout,&nbsp;R</SPAN></DIV></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.具体appender的配置<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">log4j.appender.stdout=org.apache.log4j.ConsoleAppender<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>log4j.appender.stdout.layout=org.apache.log4j.PatternLayout<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>#&nbsp;Pattern&nbsp;to&nbsp;output&nbsp;the&nbsp;caller's&nbsp;file&nbsp;name&nbsp;and&nbsp;line&nbsp;number.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>log4j.appender.stdout.layout.ConversionPattern=%5p&nbsp;[%t]&nbsp;(%F:%L)&nbsp;-&nbsp;%m%n<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><BR>详细要弄懂的就是appender要配置的东西，比如输出类型，输出格式，<BR></P><img src ="http://www.blogjava.net/runforever/aggbug/8677.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-28 21:34 <a href="http://www.blogjava.net/runforever/articles/8677.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>package和import机制</title><link>http://www.blogjava.net/runforever/articles/8049.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Wed, 20 Jul 2005 07:52:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/8049.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/8049.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/8049.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/8049.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/8049.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;java编译器开始编译某个类的源代码时：<BR>&nbsp; 第一步：根据选项-classpath或环境变量CLASSPATH建立“类路径引用表”;如果都没有，使用缺省的“.”<BR>&nbsp; 注意：环境变量的内容会被选项-classpath覆盖。没有累加效果<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp; D:\test<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp; C:\p.jar<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;类路径引用表内容<BR><BR>&nbsp; 第二步：编译器要确定它可以利用类引用表里的数据作为相对起始路径，找到所有用到的package，并将import语句里的.用/替换<BR><BR>&nbsp; 第三步：根据类路径内容为起点，比较其中一个路径是否存在同名的目录或文件名称。<BR><BR><BR><img src ="http://www.blogjava.net/runforever/aggbug/8049.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-20 15:52 <a href="http://www.blogjava.net/runforever/articles/8049.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>深入类装载器</title><link>http://www.blogjava.net/runforever/articles/7956.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Mon, 18 Jul 2005 16:57:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/7956.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/7956.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/7956.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/7956.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/7956.html</trackback:ping><description><![CDATA[<P>隐式方法：new <BR>显式方法：<BR>1。java.lang.Class的forName方法<BR>2。java.lang.ClassLoader里的loadClass方法<BR><BR><BR>◆ 无法自行产生Class的实体，因为构造函数声明为private。<BR>◇ 只能通过Object的getClass方法，或者Class.forName("类名")获得。<BR>◆ Class类的实体在第一次载入内存时就建立了。以后在程序中产生Class代表的类的实体，其内部都会有个字段记录着这个Class类所在的位置。<BR>◇&nbsp; 可以把每个Class类的实体当作是某个类(*.class)在内存中的代理。<BR>◆ 在Java中，每个类都是由某个类加载器(ClassLoader)来载入的，因此在Class类的实体中，由字段记录载入它的ClassLoader的实体。如果该字段是null，不代表它不是由类装载器所载入，而是代表这个类由引导式装载器(bootstrap loader)载入。但是这个装载器不是java编写的，所以没有实体。<BR><IMG height=235 alt=classloader.jpg src="http://www.blogjava.net/images/blogjava_net/runforever/img1/classloader.jpg" width=665 border=0><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;图1<BR>注意：系统里同时存在多个ClassLoader实体。而且一个类装载器可以载入多个类<BR><BR><STRONG>★ 使用已有类装载器</STRONG></P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #008080">1</SPAN><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Office&nbsp;off&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;Office();<BR></SPAN><SPAN style="COLOR: #008080">2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ClassLoader&nbsp;loader&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;off.getClass().getClassLoader();<BR></SPAN><SPAN style="COLOR: #008080">3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class&nbsp;c&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;loader.loadClass(args[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]);<BR></SPAN><SPAN style="COLOR: #008080">4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object&nbsp;o&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;c.newInstance();</SPAN></DIV></DIV>
<P>注意：loadClass方法加载类时不会自动调用静态初始化块(static块)，必须等到第一次实体化该类时，才会调用。这与forName时传入第二个参数为false的效果相同。<BR><BR>下面是上述代码的另一种写法：</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #008080">1</SPAN><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class&nbsp;cb&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;Office.</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ClassLoader&nbsp;loader&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;cb.getClassLoader();<BR></SPAN><SPAN style="COLOR: #008080">3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class&nbsp;c&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;loader.loadClass(args[</SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">]);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR></SPAN><SPAN style="COLOR: #008080">4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Object&nbsp;o&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;c.newInstance();</SPAN></DIV></DIV>
<P><STRONG>★ 自己建立类装载器来载入类</STRONG><BR><BR>URLClassLoader<BR><BR><STRONG>★&nbsp;类装载器的阶层体系<BR></STRONG><BR>Java程序运行流程：<BR><BR>shur输入java ***.class，java.exe根据自己的搜索逻辑找到JRE，接着找到位于JRE中的jvm.dll（真正的java虚拟机）。最后载入这个动态链接库，激活java虚拟机。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;虚拟机一旦激活，会先做一些初始化操作，如获取系统参数。<BR>&nbsp;&nbsp;&nbsp;&nbsp; 初始化完成后，产生第一个类装载器 Bootstrap Loader。然后做一些基本的初始化，然后它载入sun.misc命名空间底下的Launcher.java之中的ExtClassLoader，并设置其parent为null。然后Bootstrap Loader会继续载入sun.misc命名空间下的Launcher.java之中的AppClassLoader，并设置其parent为刚载入的ExtClassLoader<STRONG>实体</STRONG>。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;最后由AppClassLoader负责载入***.class。<BR>&nbsp;&nbsp;&nbsp;&nbsp;<STRONG>&nbsp;&nbsp;注意：上述三个类装载器搜索类的路径都是载入时读取的，分别是“sun.boot.class.path”、“java.ext.dirs”、“java.class.path”，而且在虚拟机中只保留一份。在系统运行过程中不可能动态改变，除非使用新的类装载器。<BR></STRONG><BR><STRONG>★&nbsp;委托模型<BR></STRONG><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;类装载器有载入类的需求时，会先请示其Parent使用其搜索路径帮忙载入。如果Parent找不到，才由自己依照自己的搜索路径搜索类。<BR><BR><BR><BR><BR><BR><BR><BR>&nbsp;</P><img src ="http://www.blogjava.net/runforever/aggbug/7956.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-19 00:57 <a href="http://www.blogjava.net/runforever/articles/7956.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java.exe寻找JRE的顺序</title><link>http://www.blogjava.net/runforever/articles/7955.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Mon, 18 Jul 2005 16:48:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/7955.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/7955.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/7955.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/7955.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/7955.html</trackback:ping><description><![CDATA[java.exe按照如下的逻辑来寻找JRE:<BR>1。自己目录下有没有JRE<BR>2。父目录下的JRE子目录<BR>3。查询注册表里指定的JRE路径<BR><BR>注意：一定要弄清自己运行的是哪个java.exe。一般java.exe的路径信息在系统path变量里设置<BR><img src ="http://www.blogjava.net/runforever/aggbug/7955.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-19 00:48 <a href="http://www.blogjava.net/runforever/articles/7955.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[需要注意] Java异常处理机制的理解</title><link>http://www.blogjava.net/runforever/articles/7861.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Sun, 17 Jul 2005 08:47:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/7861.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/7861.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/7861.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/7861.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/7861.html</trackback:ping><description><![CDATA[<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD class=title1 align=middle width="100%" bgColor=#eeeeee colSpan=3 height=40><B></B></TD></TR>
<TR>
<TD align=middle width="100%" bgColor=#eeeeee></TD></TR></TBODY></TABLE></TD></TR><!-- end of article title -->
<TR>
<TD vAlign=top align=middle width="100%"><!--start of article content -->
<TABLE width="98%" border=0>
<TBODY>
<TR>
<TD class=text align=left width="100%"><BR><!-- Google Ad -->
<TABLE cellSpacing=0 cellPadding=0 align=right border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 align=left border=0>
<TBODY>
<TR>
<TD><!-- 这儿显示Google的广告 -->
<SCRIPT language=javascript>showbanner(6,6,1);</SCRIPT>

<SCRIPT type=text/javascript>google_ad_client ="pub-2141342037947367";google_ad_width = 120;google_ad_height =240;google_ad_format = "120x240_as";google_ad_channel="8570654326";google_color_border = "CCCCCC";google_color_bg ="FFFFFF";google_color_link = "000000";google_color_url ="666666";google_color_text = "333333";</SCRIPT>

<SCRIPT src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type=text/javascript></SCRIPT>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>你觉得自己是一个Java专家吗？是否肯定自己已经全面掌握了Java的异常处理机制？在下面这段代码中，你能够迅速找出异常处理的六个问题吗？<BR><BR>　　1&nbsp;OutputStreamWriter&nbsp;out&nbsp;=&nbsp;...<BR>　　2&nbsp;java.sql.Connection&nbsp;conn&nbsp;=&nbsp;...<BR>　　3&nbsp;try&nbsp;{&nbsp;//&nbsp;⑸<BR>　　4&nbsp;Statement&nbsp;stat&nbsp;=&nbsp;conn.createStatement();<BR>　　5&nbsp;ResultSet&nbsp;rs&nbsp;=&nbsp;stat.executeQuery(<BR>　　6&nbsp;"select&nbsp;uid,&nbsp;name&nbsp;from&nbsp;user");<BR>　　7&nbsp;while&nbsp;(rs.next())<BR>　　8&nbsp;{<BR>　　9&nbsp;out.println("ID："&nbsp;+&nbsp;rs.getString("uid")&nbsp;//&nbsp;⑹<BR>　　10&nbsp;"，姓名："&nbsp;+&nbsp;rs.getString("name"));<BR>　　11&nbsp;}<BR>　　12&nbsp;conn.close();&nbsp;//&nbsp;⑶<BR>　　13&nbsp;out.close();<BR>　　14&nbsp;}<BR>　　15&nbsp;catch(Exception&nbsp;ex)&nbsp;//&nbsp;⑵<BR>　　16&nbsp;{<BR>　　17&nbsp;ex.printStackTrace();&nbsp;//&nbsp;⑴，⑷<BR>　　18&nbsp;}<BR><BR>　　作为一个Java程序员，你至少应该能够找出两个问题。但是，如果你不能找出全部六个问题，请继续阅读本文。<BR><BR>　　本文讨论的不是Java异常处理的一般性原则，因为这些原则已经被大多数人熟知。我们要做的是分析各种可称为“反例”（anti-pattern）的违背优秀编码规范的常见坏习惯，帮助读者熟悉这些典型的反面例子，从而能够在实际工作中敏锐地察觉和避免这些问题。<BR><BR><STRONG>　　反例之一：丢弃异常</STRONG><BR><BR>　　代码：15行-18行。<BR><BR>　　这段代码捕获了异常却不作任何处理，可以算得上Java编程中的杀手。从问题出现的频繁程度和祸害程度来看，它也许可以和C/C++程序的一个恶名远播的问题相提并论??不检查缓冲区是否已满。如果你看到了这种丢弃（而不是抛出）异常的情况，可以百分之九十九地肯定代码存在问题（在极少数情况下，这段代码有存在的理由，但最好加上完整的注释，以免引起别人误解）。<BR><BR>　　这段代码的错误在于，异常（几乎）总是意味着某些事情不对劲了，或者说至少发生了某些不寻常的事情，我们不应该对程序发出的求救信号保持沉默和无动于衷。调用一下printStackTrace算不上“处理异常”。不错，调用printStackTrace对调试程序有帮助，但程序调试阶段结束之后，printStackTrace就不应再在异常处理模块中担负主要责任了。<BR><BR>　　丢弃异常的情形非常普遍。打开JDK的ThreadDeath类的文档，可以看到下面这段说明：“特别地，虽然出现ThreadDeath是一种‘正常的情形’，但ThreadDeath类是Error而不是Exception的子类，因为许多应用会捕获所有的Exception然后丢弃它不再理睬。”这段话的意思是，虽然ThreadDeath代表的是一种普通的问题，但鉴于许多应用会试图捕获所有异常然后不予以适当的处理，所以JDK把ThreadDeath定义成了Error的子类，因为Error类代表的是一般的应用不应该去捕获的严重问题。可见，丢弃异常这一坏习惯是如此常见，它甚至已经影响到了Java本身的设计。<BR><BR>　　那么，应该<STRONG>怎样改正呢？主要有四个选择：</STRONG><BR><BR>　　1、<STRONG>处理异常</STRONG>。针对该异常采取一些行动，例如修正问题、提醒某个人或进行其他一些处理，要根据具体的情形确定应该采取的动作。再次说明，调用printStackTrace算不上已经“处理好了异常”。<BR>　　2、<STRONG>重新抛出异常</STRONG>。处理异常的代码在分析异常之后，认为自己不能处理它，重新抛出异常也不失为一种选择。<BR>　　3、<STRONG>把该异常转换成另一种异常</STRONG>。大多数情况下，这是指把一个低级的异常转换成应用级的异常（其含义更容易被用户了解的异常）。<BR>　　4、<STRONG>不要捕获异常。<BR></STRONG><BR>　　<STRONG>结论一：既然捕获了异常，就要对它进行适当的处理。不要捕获异常之后又把它丢弃，不予理睬。<BR></STRONG><BR>　　<STRONG>反例之二：不指定具体的异常<BR></STRONG><BR>　　代码：15行。<BR><BR>　　许多时候人们会被这样一种“美妙的”想法吸引：用一个catch语句捕获所有的异常。最常见的情形就是使用catch(Exception&nbsp;ex)语句。但实际上，在绝大多数情况下，这种做法不值得提倡。为什么呢？<BR><BR>　　要理解其原因，我们必须回顾一下catch语句的用途。catch语句表示我们预期会出现某种异常，而且希望能够处理该异常。异常类的作用就是告诉Java编译器我们想要处理的是哪一种异常。由于绝大多数异常都直接或间接从java.lang.Exception派生，catch(Exception&nbsp;ex)就相当于说我们想要处理几乎所有的异常。<BR>　　再来看看前面的代码例子。我们真正想要捕获的异常是什么呢？最明显的一个是SQLException，这是JDBC操作中常见的异常。另一个可能的异常是IOException，因为它要操作OutputStreamWriter。显然，在同一个catch块中处理这两种截然不同的异常是不合适的。如果用两个catch块分别捕获SQLException和IOException就要好多了。这就是说，catch语句应当尽量指定具体的异常类型，而不应该指定涵盖范围太广的Exception类。<BR><BR>　　另一方面，除了这两个特定的异常，还有其他许多异常也可能出现。例如，如果由于某种原因，executeQuery返回了null，该怎么办？答案是让它们继续抛出，即不必捕获也不必处理。实际上，我们不能也不应该去捕获可能出现的所有异常，程序的其他地方还有捕获异常的机会??直至最后由JVM处理。<BR><BR>　　<STRONG>结论二：在catch语句中尽可能指定具体的异常类型，必要时使用多个catch。不要试图处理所有可能出现的异常。<BR></STRONG><BR>　　<STRONG>反例之三：占用资源不释放<BR></STRONG><BR>　　代码：3行-14行。<BR><BR>　　异常改变了程序正常的执行流程。这个道理虽然简单，却常常被人们忽视。如果程序用到了文件、Socket、JDBC连接之类的资源，即使遇到了异常，也要正确释放占用的资源。为此，Java提供了一个简化这类操作的关键词finally。<BR><BR>　　finally是样好东西：不管是否出现了异常，Finally保证在try/catch/finally块结束之前，执行清理任务的代码总是有机会执行。遗憾的是有些人却不习惯使用finally。<BR><BR>　　当然，编写finally块应当多加小心，特别是要注意在finally块之内抛出的异常??这是执行清理任务的最后机会，尽量不要再有难以处理的错误。<BR><BR>　　<STRONG>结论三：保证所有资源都被正确释放。充分运用finally关键词。<BR></STRONG><BR>　　<STRONG>反例之四：不说明异常的详细信息<BR></STRONG><BR>　　代码：3行-18行。<BR><BR>　　仔细观察这段代码：如果循环内部出现了异常，会发生什么事情？我们可以得到足够的信息判断循环内部出错的原因吗？不能。我们只能知道当前正在处理的类发生了某种错误，但却不能获得任何信息判断导致当前错误的原因。<BR><BR>　　printStackTrace的堆栈跟踪功能显示出程序运行到当前类的执行流程，但只提供了一些最基本的信息，未能说明实际导致错误的原因，同时也不易解读。<BR><BR>　　因此，在出现异常时，最好能够提供一些文字信息，例如当前正在执行的类、方法和其他状态信息，包括以一种更适合阅读的方式整理和组织printStackTrace提供的信息。<BR><BR>　　<STRONG>结论四：在异常处理模块中提供适量的错误原因信息，组织错误信息使其易于理解和阅读。</STRONG><BR><BR>　　<STRONG>反例之五：过于庞大的try块<BR></STRONG><BR>　　代码：3行-14行。<BR><BR>　　经常可以看到有人把大量的代码放入单个try块，实际上这不是好习惯。这种现象之所以常见，原因就在于有些人图省事，不愿花时间分析一大块代码中哪几行代码会抛出异常、异常的具体类型是什么。把大量的语句装入单个巨大的try块就象是出门旅游时把所有日常用品塞入一个大箱子，虽然东西是带上了，但要找出来可不容易。<BR><BR>　　一些新手常常把大量的代码放入单个try块，然后再在catch语句中声明Exception，而不是分离各个可能出现异常的段落并分别捕获其异常。这种做法为分析程序抛出异常的原因带来了困难，因为一大段代码中有太多的地方可能抛出Exception。<BR><BR>　　<STRONG>结论五：尽量减小try块的体积。</STRONG><BR><BR>　<STRONG>　反例之六：输出数据不完整<BR></STRONG><BR>　　代码：7行-11行。<BR><BR>　　不完整的数据是Java程序的隐形杀手。仔细观察这段代码，考虑一下如果循环的中间抛出了异常，会发生什么事情。循环的执行当然是要被打断的，其次，catch块会执行??就这些，再也没有其他动作了。已经输出的数据怎么办？使用这些数据的人或设备将收到一份不完整的（因而也是错误的）数据，却得不到任何有关这份数据是否完整的提示。对于有些系统来说，数据不完整可能比系统停止运行带来更大的损失。<BR><BR>　　较为理想的处置办法是向输出设备写一些信息，声明数据的不完整性；另一种可能有效的办法是，先缓冲要输出的数据，准备好全部数据之后再一次性输出。<BR><BR>　<STRONG>　结论六：全面考虑可能出现的异常以及这些异常对执行流程的影响。<BR></STRONG><BR><BR>　　改写后的代码<BR><BR>　　根据上面的讨论，下面给出改写后的代码。也许有人会说它稍微有点?嗦，但是它有了比较完备的异常处理机制。<BR><BR>　　OutputStreamWriter&nbsp;out&nbsp;=&nbsp;...<BR>　　java.sql.Connection&nbsp;conn&nbsp;=&nbsp;...<BR>　　try&nbsp;{<BR>　　　Statement&nbsp;stat&nbsp;=&nbsp;conn.createStatement();<BR>　　　ResultSet&nbsp;rs&nbsp;=&nbsp;stat.executeQuery("select&nbsp;uid,&nbsp;name&nbsp;from&nbsp;user");<BR>　　　while&nbsp;(rs.next())<BR>　　　{<BR>　　　　out.println("ID："&nbsp;+&nbsp;rs.getString("uid")&nbsp;+&nbsp;"，姓名:&nbsp;"&nbsp;+&nbsp;rs.getString("name"));<BR>　　　}<BR>　　}<BR>　　catch(SQLException&nbsp;sqlex)<BR>　　{<BR>　　　out.println("警告：数据不完整");<BR>　　　throw&nbsp;new&nbsp;ApplicationException("读取数据时出现SQL错误",&nbsp;sqlex);<BR>　　}<BR>　　catch(IOException&nbsp;ioex)<BR>　　{<BR>　　　throw&nbsp;new&nbsp;ApplicationException("写入数据时出现IO错误",&nbsp;ioex);<BR>　　}<BR>　　finally<BR>　　{<BR>　　　if&nbsp;(conn&nbsp;!=&nbsp;null)&nbsp;{<BR>　　　　try&nbsp;{<BR>　　　　　conn.close();<BR>　　　　}<BR>　　　　catch(SQLException&nbsp;sqlex2)<BR>　　　　{<BR>　　　　　System.err(this.getClass().getName()&nbsp;+&nbsp;".mymethod&nbsp;-&nbsp;不能关闭数据库连接:&nbsp;"&nbsp;+&nbsp;sqlex2.toString());<BR>　　　　}<BR>　　　}<BR>　　　if&nbsp;(out&nbsp;!=&nbsp;null)&nbsp;{<BR>　　　　try&nbsp;{<BR>　　　　　out.close();<BR>　　　　}<BR>　　　　catch(IOException&nbsp;ioex2)<BR>　　　　{<BR>　　　　　System.err(this.getClass().getName()&nbsp;+&nbsp;".mymethod&nbsp;-&nbsp;不能关闭输出文件"&nbsp;+&nbsp;ioex2.toString());<BR>　　　　}<BR>　　　}<BR>　　}<BR><BR>　　本文的结论不是放之四海皆准的教条，有时常识和经验才是最好的老师。如果你对自己的做法没有百分之百的信心，务必加上详细、全面的注释。<BR>　　一方面，不要笑话这些错误，不妨问问你自己是否真地彻底摆脱了这些坏习惯。即使最有经验的程序员偶尔也会误入歧途，原因很简单，因为它们确确实实带来了“方便”。所有这些反例都可以看作Java编程世界的恶魔，它们美丽动人，无孔不入，时刻诱惑着你。也许有人会认为这些都属于鸡皮蒜毛的小事，不足挂齿，但请记住：勿以恶小而为之，勿以善小而不为。</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><img src ="http://www.blogjava.net/runforever/aggbug/7861.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-17 16:47 <a href="http://www.blogjava.net/runforever/articles/7861.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JSTL</title><link>http://www.blogjava.net/runforever/articles/7648.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Wed, 13 Jul 2005 08:12:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/7648.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/7648.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/7648.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/7648.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/7648.html</trackback:ping><description><![CDATA[<P>1 核心标签<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.1 表达式操作<BR></P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #008080">&nbsp;1</SPAN><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000">&nbsp;var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">s1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">45</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">error_message</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;eFormat&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">wwx</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">&nbsp;i&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;Integer.parseInt(eFormat);<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${error_message}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000">&nbsp;var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">s2</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:remove&nbsp;var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">s2</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN></DIV></DIV>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.2 流程控制<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;c:if ../&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;c:choose ../&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;c:when ../&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;c:otherwise ../&gt;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #008080">&nbsp;1</SPAN><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&nbsp;test</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${&nbsp;s1&nbsp;==&nbsp;s2&nbsp;}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">condition</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;scope</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">page</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;%=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">测试车</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">if</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${condition}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:choose</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:when&nbsp;test</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${s1&nbsp;==&nbsp;1}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;我是1<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:when</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:when&nbsp;test</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${s1&nbsp;==&nbsp;2}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;我是2<BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:when</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:otherwise</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;都不对<BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:otherwise</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:choose</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></DIV></DIV>
<P><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.3 迭代操作<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #008080">&nbsp;1</SPAN><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;List&nbsp;list&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ArrayList();<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list.add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">张三</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list.add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">李四</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list.add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">王五</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;request.setAttribute(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">members</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,list);<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:forEach&nbsp;var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">member</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;items</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${members}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${member}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:forEach</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></DIV></DIV>
<P>&lt;c:forEach .../&gt;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #008080">&nbsp;1</SPAN><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;List&nbsp;list&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;ArrayList();<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list.add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">张三</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list.add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">李四</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list.add(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">王五</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;request.setAttribute(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">members</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">,list);<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:forEach&nbsp;var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">member</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;items</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${members}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;varStatus</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">s</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${member}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">&nbsp;&nbsp;&nbsp;&nbsp;<BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${s.index}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${s.count}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${s.first}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${s.last}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">16</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:forEach</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></DIV></DIV>
<P>1.4&nbsp;URL操作<BR></P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;c:import ..../&gt;<BR><BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #008080">1</SPAN><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:import&nbsp;url</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">header.htm</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">cs</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;scope</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">request</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.print(</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;String(request.getAttribute(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">cs</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">).toString().getBytes(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ISO-8859-1</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">),</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">GBK</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">));<BR></SPAN><SPAN style="COLOR: #008080">4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${cs}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN></DIV></DIV>
<P>&nbsp;</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #008080">1</SPAN><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">父页</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080">2</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000">&nbsp;var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">page</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">第一页</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;scope</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">request</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:import&nbsp;url</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">include.jsp</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;charEncoding</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">GBK</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">4</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:param&nbsp;name</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">pageCount</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">共100页</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">5</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;/</SPAN><SPAN style="COLOR: #000000">c:import</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">7</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">子页:include.jsp</SPAN><SPAN style="COLOR: #008000"><BR></SPAN><SPAN style="COLOR: #008080">8</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${param.pageCount}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN></DIV></DIV>
<P><BR>&nbsp;</P>
<P><BR>&nbsp; <%

	String eFormat = "wwx";

        int i = Integer.parseInt(eFormat);

%><?xml:namespace prefix = c /><c:set var="s1" value="45"></c:set><c:set var="s2" value="2"></c:set><c:out value="${error_message}"></c:out><%

	String eFormat = "wwx";

        int i = Integer.parseInt(eFormat);

%><c:set var="s1" value="45"></c:set><c:set var="s2" value="2"></c:set><c:out value="${error_message}"></c:out><BR><BR></P><img src ="http://www.blogjava.net/runforever/aggbug/7648.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-13 16:12 <a href="http://www.blogjava.net/runforever/articles/7648.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用PL/SQL Developer的一个常见问题：TNS：无法处理服务名</title><link>http://www.blogjava.net/runforever/articles/7381.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Fri, 08 Jul 2005 09:38:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/7381.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/7381.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/7381.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/7381.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/7381.html</trackback:ping><description><![CDATA[配置一下Oracle客户端安装目录下的tnsnames.ora就可以了<img src ="http://www.blogjava.net/runforever/aggbug/7381.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-08 17:38 <a href="http://www.blogjava.net/runforever/articles/7381.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>定义并使用自定义标签库的步骤</title><link>http://www.blogjava.net/runforever/articles/7291.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Thu, 07 Jul 2005 07:05:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/7291.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/7291.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/7291.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/7291.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/7291.html</trackback:ping><description><![CDATA[1。编写标签处理类<BR>2。编写标签库描述符<BR>3。在web.xml中加入标签库描述符引用<BR>4。在使用标签的页面用taglib指令引入标签库，定义前缀<img src ="http://www.blogjava.net/runforever/aggbug/7291.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-07 15:05 <a href="http://www.blogjava.net/runforever/articles/7291.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>日期格式化问题。从字符串构建Date对象，然后用SimpleDateFormat格式化成指定格式</title><link>http://www.blogjava.net/runforever/articles/7001.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Fri, 01 Jul 2005 07:11:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/7001.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/7001.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/7001.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/7001.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/7001.html</trackback:ping><description><![CDATA[<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #008080">&nbsp;1</SPAN><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">import&nbsp;java.text.</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;2</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;java.util.</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;3</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;4</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_63_429_Open_Image onclick="this.style.display='none'; Codehighlighter1_63_429_Open_Text.style.display='none'; Codehighlighter1_63_429_Closed_Image.style.display='inline'; Codehighlighter1_63_429_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_63_429_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_63_429_Closed_Text.style.display='none'; Codehighlighter1_63_429_Open_Image.style.display='inline'; Codehighlighter1_63_429_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;DateDemo&nbsp;</SPAN><SPAN id=Codehighlighter1_63_429_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_63_429_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;5</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_85_89_Open_Image onclick="this.style.display='none'; Codehighlighter1_85_89_Open_Text.style.display='none'; Codehighlighter1_85_89_Closed_Image.style.display='inline'; Codehighlighter1_85_89_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_85_89_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_85_89_Closed_Text.style.display='none'; Codehighlighter1_85_89_Open_Image.style.display='inline'; Codehighlighter1_85_89_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;DateDemo()&nbsp;</SPAN><SPAN id=Codehighlighter1_85_89_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_85_89_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;6</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">&nbsp;7</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_131_427_Open_Image onclick="this.style.display='none'; Codehighlighter1_131_427_Open_Text.style.display='none'; Codehighlighter1_131_427_Closed_Image.style.display='inline'; Codehighlighter1_131_427_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_131_427_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_131_427_Closed_Text.style.display='none'; Codehighlighter1_131_427_Open_Image.style.display='inline'; Codehighlighter1_131_427_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;main(String[]&nbsp;args)</SPAN><SPAN id=Codehighlighter1_131_427_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_131_427_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;8</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;s&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">2004-05-06&nbsp;03:01:02</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">;<BR></SPAN><SPAN style="COLOR: #008080">&nbsp;9</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;SimpleDateFormat&nbsp;sdf&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000">&nbsp;SimpleDateFormat(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">yyyy-MM-dd&nbsp;HH:mm:ss</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);<BR></SPAN><SPAN style="COLOR: #008080">10</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_251_356_Open_Image onclick="this.style.display='none'; Codehighlighter1_251_356_Open_Text.style.display='none'; Codehighlighter1_251_356_Closed_Image.style.display='inline'; Codehighlighter1_251_356_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_251_356_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_251_356_Closed_Text.style.display='none'; Codehighlighter1_251_356_Open_Image.style.display='inline'; Codehighlighter1_251_356_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">try</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN id=Codehighlighter1_251_356_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_251_356_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">11</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Date&nbsp;d&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;DateFormat.getDateTimeInstance().parse(s);<BR></SPAN><SPAN style="COLOR: #008080">12</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.</SPAN><SPAN style="COLOR: #0000ff">out</SPAN><SPAN style="COLOR: #000000">.println(sdf.format(d));<BR></SPAN><SPAN style="COLOR: #008080">13</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">14</SPAN><SPAN style="COLOR: #000000"><IMG id=Codehighlighter1_388_422_Open_Image onclick="this.style.display='none'; Codehighlighter1_388_422_Open_Text.style.display='none'; Codehighlighter1_388_422_Closed_Image.style.display='inline'; Codehighlighter1_388_422_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_388_422_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_388_422_Closed_Text.style.display='none'; Codehighlighter1_388_422_Open_Image.style.display='inline'; Codehighlighter1_388_422_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">catch</SPAN><SPAN style="COLOR: #000000">&nbsp;(ParseException&nbsp;ex)&nbsp;</SPAN><SPAN id=Codehighlighter1_388_422_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_388_422_Open_Text><SPAN style="COLOR: #000000">{<BR></SPAN><SPAN style="COLOR: #008080">15</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ex.printStackTrace();<BR></SPAN><SPAN style="COLOR: #008080">16</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">17</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR></SPAN><SPAN style="COLOR: #008080">18</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">19</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #008080">20</SPAN><SPAN style="COLOR: #000000"><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV><img src ="http://www.blogjava.net/runforever/aggbug/7001.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-01 15:11 <a href="http://www.blogjava.net/runforever/articles/7001.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JBuilder里Debug的一个问题</title><link>http://www.blogjava.net/runforever/articles/6986.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Fri, 01 Jul 2005 04:49:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/6986.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/6986.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/6986.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/6986.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/6986.html</trackback:ping><description><![CDATA[<DIV>我在JBuilder的debug模式下运行的时候。修改了页面相关的一个类，然后make，但是在重新运行这个页面的时候<SPAN class=564054004-01072005>&nbsp;</SPAN><SPAN class=564054004-01072005>好像就停在那运行不下去了，message消息窗口里显示等待重新部署修改的那个类的消息，就是不往下走了。&nbsp;</SPAN></DIV><BR><BR>WebappClassLoader:&nbsp;&nbsp; Resource '/WEB-INF/classes/com/founder/cpm/publish/PublishPropertiesManager.class' was modified; Date is now: Fri Jul 01 12:49:10 CST 2005 Was: Fri Jul 01 12:42:52 CST 2005<BR>StandardContext[/weblish3]: Reloading this Context has started<BR>StandardWrapper[/weblish3:default]: Waiting for 2 instance(s) to be deallocated<img src ="http://www.blogjava.net/runforever/aggbug/6986.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-01 12:49 <a href="http://www.blogjava.net/runforever/articles/6986.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Oracle对日期类型的处理</title><link>http://www.blogjava.net/runforever/articles/6985.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Fri, 01 Jul 2005 04:29:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/6985.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/6985.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/6985.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/6985.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/6985.html</trackback:ping><description><![CDATA[update app_publishlib&nbsp; set startdate = to_date('2005-01-09 00:00:00','yyyy-mm-dd hh24:mi:ss')<img src ="http://www.blogjava.net/runforever/aggbug/6985.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-07-01 12:29 <a href="http://www.blogjava.net/runforever/articles/6985.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JBuilderX和JBuilder2005的字体光标问题 </title><link>http://www.blogjava.net/runforever/articles/6948.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Thu, 30 Jun 2005 08:19:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/6948.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/6948.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/6948.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/6948.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/6948.html</trackback:ping><description><![CDATA[<BR>1. JBuilderX的光标不能对齐的问题源于Sun的JDK本身的问题，其实和Borland公司没有任何关系。解决的最好办法就是替换JBuilderX/jdk1.4/jre/lib目录下的font.properties.zh文件。这是一个关于字体的描述文件。只需要把这个文件替换如下内容，就可以了。<BR>&nbsp;<BR># @(#)font.properties.zh&nbsp;&nbsp;&nbsp;&nbsp; 1.10 02/03/07<BR>#<BR># Copyright 2002 Sun Microsystems, Inc. All rights reserved.<BR>#<BR>&nbsp;<BR># Component Font Mappings<BR>#<BR>dialog.plain.0=Tahoma,ANSI_CHARSET<BR>dialog.plain.1=\u5b8b\u4f53,GB2312_CHARSET<BR>dialog.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED<BR>dialog.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED <BR>&nbsp;<BR>dialog.bold.0=Tahoma Bold,ANSI_CHARSET<BR>dialog.bold.1=\u5b8b\u4f53,GB2312_CHARSET<BR>dialog.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED<BR>dialog.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED <BR>&nbsp;<BR>dialog.italic.0=Tahoma Italic,ANSI_CHARSET<BR>dialog.italic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>dialog.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED<BR>dialog.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED <BR>&nbsp;<BR>dialog.bolditalic.0=Tahoma Bold Italic,ANSI_CHARSET<BR>dialog.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>dialog.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED<BR>dialog.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED <BR>&nbsp;<BR>dialoginput.plain.0=Courier New,ANSI_CHARSET<BR>dialoginput.plain.1=\u5b8b\u4f53,GB2312_CHARSET<BR>dialoginput.plain.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED<BR>dialoginput.plain.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED <BR>&nbsp;<BR>dialoginput.bold.0=Courier New Bold,ANSI_CHARSET<BR>dialoginput.bold.1=\u5b8b\u4f53,GB2312_CHARSET<BR>dialoginput.bold.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED<BR>dialoginput.bold.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED <BR>&nbsp;<BR>dialoginput.italic.0=Courier New Italic,ANSI_CHARSET<BR>dialoginput.italic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>dialoginput.italic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED<BR>dialoginput.italic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED <BR>&nbsp;<BR>dialoginput.bolditalic.0=Courier New Bold Italic,ANSI_CHARSET<BR>dialoginput.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>dialoginput.bolditalic.2=WingDings,SYMBOL_CHARSET,NEED_CONVERTED<BR>dialoginput.bolditalic.3=Symbol,SYMBOL_CHARSET,NEED_CONVERTED <BR>&nbsp;<BR>&nbsp;<BR>serif.plain.0=Tahoma,ANSI_CHARSET<BR>serif.plain.1=\u5b8b\u4f53,GB2312_CHARSET<BR>serif.plain.2=WingDings,SYMBOL_CHARSET<BR>serif.plain.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>serif.bold.0=Tahoma Bold,ANSI_CHARSET<BR>serif.bold.1=\u5b8b\u4f53,GB2312_CHARSET<BR>serif.bold.2=WingDings,SYMBOL_CHARSET<BR>serif.bold.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>serif.italic.0=Tahoma Italic,ANSI_CHARSET<BR>serif.italic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>serif.italic.2=WingDings,SYMBOL_CHARSET<BR>serif.italic.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>serif.bolditalic.0=Tahoma Bold Italic,ANSI_CHARSET<BR>serif.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>serif.bolditalic.2=WingDings,SYMBOL_CHARSET<BR>serif.bolditalic.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>#####################################<BR>&nbsp;<BR>#serif.plain.0=Times New Roman,ANSI_CHARSET<BR>#serif.plain.1=\u5b8b\u4f53,GB2312_CHARSET<BR>#serif.plain.2=WingDings,SYMBOL_CHARSET<BR>#serif.plain.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>#serif.bold.0=Times New Roman Bold,ANSI_CHARSET<BR>#serif.bold.1=\u5b8b\u4f53,GB2312_CHARSET<BR>#serif.bold.2=WingDings,SYMBOL_CHARSET<BR>#serif.bold.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>#serif.italic.0=Times New Roman Italic,ANSI_CHARSET<BR>#serif.italic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>#serif.italic.2=WingDings,SYMBOL_CHARSET<BR>#serif.italic.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>#serif.bolditalic.0=Times New Roman Bold Italic,ANSI_CHARSET<BR>#serif.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>#serif.bolditalic.2=WingDings,SYMBOL_CHARSET<BR>#serif.bolditalic.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>#############################<BR>&nbsp;<BR>sansserif.plain.0=Tahoma,ANSI_CHARSET<BR>sansserif.plain.1=\u5b8b\u4f53,GB2312_CHARSET<BR>sansserif.plain.2=WingDings,SYMBOL_CHARSET<BR>sansserif.plain.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>sansserif.bold.0=Tahoma Bold,ANSI_CHARSET<BR>sansserif.bold.1=\u5b8b\u4f53,GB2312_CHARSET<BR>sansserif.bold.2=WingDings,SYMBOL_CHARSET<BR>sansserif.bold.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>sansserif.italic.0=Tahoma Italic,ANSI_CHARSET<BR>sansserif.italic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>sansserif.italic.2=WingDings,SYMBOL_CHARSET<BR>sansserif.italic.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>sansserif.bolditalic.0=Tahoma Bold Italic,ANSI_CHARSET<BR>sansserif.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>sansserif.bolditalic.2=WingDings,SYMBOL_CHARSET<BR>sansserif.bolditalic.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>monospaced.plain.0=Courier New,GB2312_CHARSET<BR>monospaced.plain.1=\u5b8b\u4f53,GB2312_CHARSET<BR>monospaced.plain.2=WingDings,SYMBOL_CHARSET<BR>monospaced.plain.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>monospaced.bold.0=Courier New Bold,GB2312_CHARSET<BR>monospaced.bold.1=\u5b8b\u4f53,GB2312_CHARSET<BR>monospaced.bold.2=WingDings,SYMBOL_CHARSET<BR>monospaced.bold.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>monospaced.italic.0=Courier New Italic,GB2312_CHARSET<BR>monospaced.italic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>monospaced.italic.2=WingDings,SYMBOL_CHARSET<BR>monospaced.italic.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR>monospaced.bolditalic.0=Courier New Bold Italic,GB2312_CHARSET<BR>monospaced.bolditalic.1=\u5b8b\u4f53,GB2312_CHARSET<BR>monospaced.bolditalic.2=WingDings,SYMBOL_CHARSET<BR>monospaced.bolditalic.3=Symbol,SYMBOL_CHARSET<BR>&nbsp;<BR># name aliases<BR>#alias.timesroman=serif<BR>alias.helvetica=sansserif<BR>alias.courier=monospaced <BR>&nbsp;<BR>&nbsp;<BR># Font File Names<BR>#<BR>filename.\u5b8b\u4f53=SIMSUN.TTC<BR>&nbsp;<BR>filename.Tahoma=tahoma.ttf<BR>filename.Tahoma_Italic=tahoma.ttf<BR>filename.Tahoma_Bold=tahombd.ttf<BR>filename.Tahoma_Bold_Italic=tahomabd.ttf<BR>&nbsp;<BR>filename.Arial=ARIAL.TTF<BR>filename.Arial_Bold=ARIALBD.TTF<BR>filename.Arial_Italic=ARIALI.TTF<BR>filename.Arial_Bold_Italic=ARIALBI.TTF<BR>&nbsp;<BR>filename.Courier_New=COUR.TTF<BR>filename.Courier_New_Bold=COURBD.TTF<BR>filename.Courier_New_Italic=COURI.TTF<BR>filename.Courier_New_Bold_Italic=COURBI.TTF<BR>&nbsp;<BR>filename.Times_New_Roman=TIMES.TTF<BR>filename.Times_New_Roman_Bold=TIMESBD.TTF<BR>filename.Times_New_Roman_Italic=TIMESI.TTF<BR>filename.Times_New_Roman_Bold_Italic=TIMESBI.TTF<BR>&nbsp;<BR>filename.WingDings=WINGDING.TTF<BR>filename.Symbol=SYMBOL.TTF<BR>&nbsp;<BR># Missing Glyph Character<BR>#<BR>default.char=2751<BR>&nbsp;<BR># Component Font Character Encodings<BR>#<BR>fontcharset.dialog.1=sun.io.CharToByteGBK<BR>fontcharset.dialog.2=sun.awt.windows.CharToByteWingDings<BR>fontcharset.dialog.3=sun.awt.CharToByteSymbol<BR>&nbsp;<BR>fontcharset.dialoginput.1=sun.io.CharToByteGBK<BR>fontcharset.dialoginput.2=sun.awt.windows.CharToByteWingDings<BR>fontcharset.dialoginput.3=sun.awt.CharToByteSymbol<BR>&nbsp;<BR>fontcharset.serif.1=sun.io.CharToByteGBK<BR>fontcharset.serif.2=sun.awt.windows.CharToByteWingDings<BR>fontcharset.serif.3=sun.awt.CharToByteSymbol<BR>&nbsp;<BR>fontcharset.sansserif.1=sun.io.CharToByteGBK<BR>fontcharset.sansserif.2=sun.awt.windows.CharToByteWingDings<BR>fontcharset.sansserif.3=sun.awt.CharToByteSymbol<BR>&nbsp;<BR>fontcharset.monospaced.0=sun.io.CharToByteGBK<BR>fontcharset.monospaced.1=sun.io.CharToByteGBK<BR>fontcharset.monospaced.2=sun.awt.windows.CharToByteWingDings<BR>fontcharset.monospaced.3=sun.awt.CharToByteSymbol<BR>&nbsp;<BR># Exclusion Ranges<BR>#<BR>#exclusion.dialog.0=0100-20ab,20ad-f8ff<BR>#exclusion.dialoginput.0=0100-20ab,20ad-f8ff<BR>#exclusion.serif.0=0100-20ab,20ad-f8ff<BR>#exclusion.sansserif.0=0100-20ab,20ad-f8ff<BR>#exclusion.monospaced.0=0100-20ab,20ad-f8ff<BR>&nbsp;<BR>exclusion.Tahoma.plain.0=00a0-f8ff<BR>exclusion.Tahoma.italic.0=00a0-f8ff<BR>exclusion.Tahoma.bold.0=00a0-f8ff<BR>exclusion.Tahoma.bolditalic.0=00a0-f8ff <BR>&nbsp;<BR>exclusion.dialog.plain.0=00a0-f8ff<BR>exclusion.dialog.italic.0=00a0-f8ff<BR>exclusion.dialog.bold.0=00a0-f8ff<BR>exclusion.dialog.bolditalic.0=00a0-f8ff <BR>&nbsp;<BR>exclusion.dialoginput.plain.0=00a0-f8ff<BR>exclusion.dialoginput.italic.0=00a0-f8ff<BR>exclusion.dialoginput.bold.0=00a0-f8ff<BR>exclusion.dialoginput.bolditalic.0=00a0-f8ff <BR>&nbsp;<BR>exclusion.serif.plain.0=00a0-f8ff<BR>exclusion.serif.italic.0=00a0-f8ff<BR>exclusion.serif.bold.0=00a0-f8ff<BR>exclusion.serif.bolditalic.0=00a0-f8ff <BR>&nbsp;<BR>exclusion.sansserif.plain.0=00a0-f8ff<BR>exclusion.sansserif.italic.0=00a0-f8ff<BR>exclusion.sansserif.bold.0=00a0-f8ff<BR>exclusion.sansserif.bolditalic.0=00a0-f8ff <BR>&nbsp;<BR>exclusion.monospaced.plain.0=00a0-f8ff<BR>exclusion.monospaced.italic.0=00a0-f8ff<BR>exclusion.monospaced.bold.0=00a0-f8ff<BR>exclusion.monospaced.bolditalic.0=00a0-f8ff<BR>&nbsp;<BR># Text Input Character Set<BR>#<BR>inputtextcharset=GB2312_CHARSET<BR>&nbsp;<BR>2. JBuilder 2005其实也有这种字体的问题。比如本来么有问题的文件，如果在Jbuilder里面保存一下，结果就会出现异常的编码字符出现。解决的办法也是将上面的font.properties.zh文件替换成如上的内容。同时，在Project-&gt;Project Properties-&gt;General-&gt;Encoding中选择”GB2312”的编码，然后关闭工程，重新打开即可。 <PRE><FONT size=2>JBUILDER的<FONT color=#cc0033>光标</FONT>定位不准确的最佳解决方案是：</FONT></PRE><PRE><FONT size=2>进入%JBUILDER_HOME%/bin目录下，用写字板编辑<FONT color=#cc0033>jbuilder</FONT>.<FONT color=#cc0033>config</FONT>，把下面的配置加进去： </FONT></PRE><PRE><FONT size=2>vmparam -Dprimetime.editor.useVariableWidthFont=true</FONT></PRE><img src ="http://www.blogjava.net/runforever/aggbug/6948.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-06-30 16:19 <a href="http://www.blogjava.net/runforever/articles/6948.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>The collection Framework 全览</title><link>http://www.blogjava.net/runforever/articles/6875.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Wed, 29 Jun 2005 06:23:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/6875.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/6875.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/6875.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/6875.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/6875.html</trackback:ping><description><![CDATA[<IMG height=600 alt=1.GIF src="http://www.blogjava.net/images/blogjava_net/runforever/img1/1.GIF" width=650 border=0><img src ="http://www.blogjava.net/runforever/aggbug/6875.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-06-29 14:23 <a href="http://www.blogjava.net/runforever/articles/6875.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>《Effective Java》笔记－15,16</title><link>http://www.blogjava.net/runforever/articles/6390.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Mon, 20 Jun 2005 08:30:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/6390.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/6390.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/6390.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/6390.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/6390.html</trackback:ping><description><![CDATA[<P>第15条 ：要么专门为继承而设计，并给出文档说明，要么禁止继承<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; » 为了允许继承，一个类必须遵守如下约定：<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;» 构造函数一定不能调用可被改写的方法。&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR><BR>第16条：接口优于抽象类<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp; » 接口通常是定义具有多个实现的类型的最佳途径。&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp; » 例外情形是当演化的容易性被灵活性和功能更为重要的时候。这时应该使用抽象类来定义类型。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;» 如果导出了一个重要接口，应该考虑同时提供一个骨架实现类(skeletal implementation class）<BR>&nbsp;&nbsp;&nbsp;&nbsp; » 尽可能谨慎设计所有的公有接口，并编写多个实现来测试它们。<BR><BR>第17条：接口是用于定义类型的<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;» 接口应该这是被用来定义类型的<BR>&nbsp;&nbsp;&nbsp;&nbsp; » 常量接口模式是对接口的不良使用<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果需要导出常量，应该使用类型安全枚举类，如<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public class PhysicalConstants{<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private PhysicalConstants(){}//注意：构造函数应该是私有的，避免子类化<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static final AVOCADROS_NUMBER = .....；//注意，常量类型应该是static final的<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;第18条：优先考虑静态成员类<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;» 嵌套类有四种：静态成员类，非静态成员类，匿名类，局部类<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; »&nbsp;非静态成员类的一种通用用法：允许外部类的一个实例被看做另一个不相关的类的实例。<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 例如，诸如Set和List这样的集合接口的实现往往使用非静态成员类来实现他们的迭代器<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public class MySet extends AbstractSet {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public Iterator iterator(){<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return new MyIterator();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public class MyIterator implements Iterator{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;................<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; »&nbsp;如果声明的成员类不要求访问外围实例，那么使用static修饰符使它成为静态成员类。<BR>&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<BR><BR><BR>&nbsp;<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR><BR></P><img src ="http://www.blogjava.net/runforever/aggbug/6390.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-06-20 16:30 <a href="http://www.blogjava.net/runforever/articles/6390.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>xml笔记</title><link>http://www.blogjava.net/runforever/articles/6368.html</link><dc:creator>呆呆向前冲的blog</dc:creator><author>呆呆向前冲的blog</author><pubDate>Mon, 20 Jun 2005 04:03:00 GMT</pubDate><guid>http://www.blogjava.net/runforever/articles/6368.html</guid><wfw:comment>http://www.blogjava.net/runforever/comments/6368.html</wfw:comment><comments>http://www.blogjava.net/runforever/articles/6368.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/runforever/comments/commentRss/6368.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/runforever/services/trackbacks/6368.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一．</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">XML</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">整体结构</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt">1</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">．</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">XML</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件的基本构成：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">XML</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">声明、处理指示、</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">XML</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">元素</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt">2</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">．其他一些逻辑要素：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">注释</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">: &lt;!-- --&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 21pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt">CDATA: &lt;![CDATA[<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 54pt; mso-char-indent-count: 6.0"><SPAN lang=EN-US style="FONT-SIZE: 9pt">]]&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt">3</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">．</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">CDATA</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">：标识字符数据</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">二．</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">XML</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件物理结构</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt">1</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">．实体</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>XML</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体">文件归根结底是由一组实体组成。<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体">（<SPAN lang=EN-US>1</SPAN>）实体的种类：一般实体和参数实体<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般实体：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">&lt;!ENTITY </SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实体名</SPAN><SPAN style="FONT-SIZE: 9pt"> <SPAN lang=EN-US>“</SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实体内容</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">”&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-spacerun: yes">&nbsp; </SPAN>&lt;!ENTITY </SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实体名</SPAN><SPAN style="FONT-SIZE: 9pt"> <SPAN lang=EN-US>SYSTEM “</SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">外部文件链接</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">”&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">参数实体：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">&lt;!ENTITY % </SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实体名</SPAN><SPAN style="FONT-SIZE: 9pt"> <SPAN lang=EN-US>“</SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实体内容</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">”&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">（</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt">3</SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">）实体的两种使用方式：实体声明和实体引用</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实体声明：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 78.75pt; LINE-HEIGHT: 15pt; mso-para-margin-left: 7.5gd"><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black">&lt;?xml version="1.0"?&gt;<BR>&lt;!DOCTYPE </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件根元素名</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black"> [ <BR>&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实体声明部分</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black"><BR>]&gt;<BR>&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件根元素名</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black">&gt;<BR>&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">具体数据内容</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black"><BR>&lt;/</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">文件根元素名</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black">&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 15pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实体引用：引用一个在实体声明中已经声明过的实体</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 15pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">一般实体的引用－</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black">&amp;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实体名</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black">;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 15pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black"><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">参数实体的引用－</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black">%</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">实体名</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black">;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 15pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">完整的例子：</SPAN><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black"><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 47.25pt; LINE-HEIGHT: 15pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-para-margin-left: 4.5gd" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;?xml version="1.0"?&gt;<BR>&lt;!DOCTYPE </SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">联系人列表<SPAN lang=EN-US> [ <BR>&nbsp;&nbsp;&nbsp; &lt;!ENTITY A</SPAN>公司地址 “北京市五街<SPAN lang=EN-US>1234</SPAN>号”<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;!ENTITY B</SPAN>公司地址 “上海南京路<SPAN lang=EN-US>9876</SPAN>号”〉<SPAN lang=EN-US><BR>]&gt; <o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 47.25pt; LINE-HEIGHT: 15pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-para-margin-left: 4.5gd; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto" align=left><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">&lt;</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">联系人列表<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;</SPAN>联系人<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</SPAN>姓名<SPAN lang=EN-US>&gt;</SPAN>张三<SPAN lang=EN-US>&lt;/</SPAN>姓名<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</SPAN>公司<SPAN lang=EN-US>&gt;&gt;A</SPAN>公司<SPAN lang=EN-US>&lt;/</SPAN>公司<SPAN lang=EN-US>&gt;&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</SPAN>地址<SPAN lang=EN-US>&gt;&amp;A</SPAN>公司地址<SPAN lang=EN-US>&lt;/</SPAN>地址<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/</SPAN>联系人<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;</SPAN>联系人<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</SPAN>姓名<SPAN lang=EN-US>gt;</SPAN>李四<SPAN lang=EN-US>&lt;/</SPAN>姓名<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</SPAN>公司<SPAN lang=EN-US>&gt;B</SPAN>公司<SPAN lang=EN-US>&lt;/</SPAN>公司<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</SPAN>地址<SPAN lang=EN-US>&gt;&amp;B</SPAN>公司地址〈<SPAN lang=EN-US>/</SPAN>地址〉<SPAN lang=EN-US><BR>&nbsp;&nbsp;&nbsp; &lt;/</SPAN>联系人<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;</SPAN>联系人<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</SPAN>姓名<SPAN lang=EN-US>&gt;</SPAN>王五<SPAN lang=EN-US>&lt;/</SPAN>姓名<SPAN lang=EN-US>&gt;&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</SPAN>公司<SPAN lang=EN-US>&gt;B</SPAN>公司<SPAN lang=EN-US>&lt;/</SPAN>公司<SPAN lang=EN-US>&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;</SPAN>地址<SPAN lang=EN-US>&gt;&amp;B</SPAN>公司地址〈<SPAN lang=EN-US>/</SPAN>地址〉<SPAN lang=EN-US><BR>&nbsp;&nbsp;&nbsp; &lt;/</SPAN>联系人<SPAN lang=EN-US>&gt;<BR>&lt;/</SPAN>联系人列表<SPAN lang=EN-US>&gt;<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: 15pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">XML</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">的精髓：基于信息描述，能够体现数据信息之间的逻辑。<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">XML</SPAN><SPAN style="FONT-SIZE: 9pt; COLOR: black; FONT-FAMILY: 宋体; mso-font-kerning: 0pt; mso-bidi-font-family: 宋体">大小写敏感<SPAN lang=EN-US><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-SIZE: 9pt"><o:p>&nbsp;</o:p></SPAN></P><img src ="http://www.blogjava.net/runforever/aggbug/6368.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/runforever/" target="_blank">呆呆向前冲的blog</a> 2005-06-20 12:03 <a href="http://www.blogjava.net/runforever/articles/6368.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>