﻿<?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-光子CI之旅-随笔分类-JEE</title><link>http://www.blogjava.net/kuuyee/category/49118.html</link><description>while (产品+需求+设计+开发+测试+部署+发布 == doing) 
{ 
  CI 
}</description><language>zh-cn</language><lastBuildDate>Fri, 14 Jun 2013 10:48:06 GMT</lastBuildDate><pubDate>Fri, 14 Jun 2013 10:48:06 GMT</pubDate><ttl>60</ttl><item><title>当EffectiveJava遇见Guava - 使类和成员的可访问性最小化(规则13)</title><link>http://www.blogjava.net/kuuyee/archive/2013/06/14/400560.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Fri, 14 Jun 2013 09:09:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2013/06/14/400560.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/400560.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2013/06/14/400560.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/400560.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/400560.html</trackback:ping><description><![CDATA[<div style="float: left; min-height: 1px; margin-left: 30px; width: 870px; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px; background-color: #f0efe7;"><br /><div style="background-color: #fcfcfa; border: 1px solid #e2e0d8; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 22px; margin-bottom: 35px;"><h2><span style="font-size: 14px;">软件设计的基本原则之一，就是系统要模块化，模块之间只通过他们的API进行通信，一个模块不需要知道其他模块的内部工作情况，这个概念称作信息隐藏(information hiding)或封装(encapsulation)。</span></h2><div><h5>需要遵守的原则</h5><div><ul style="padding: 0px; margin: 0px 0px 10px 25px;"><li><p style="margin: 0px 0px 10px;"><strong>尽可能地使每个类或成员不被外界访问。</strong>换句话说，应该使用与你正在编写的软件的对应功能相一致、尽可能最小的访问级别。</p></li><li><p style="margin: 0px 0px 10px;">对于顶层的(非嵌套的)类和接口，只有两种可能非访问级别，要从是包级私有的也就是<tt>default</tt>，要么是<tt>public</tt>的.包级私有就意味着它是这个包<strong>实现</strong>的一部分，不会作为该包API被导出，这样在以后的发型版本中，对它修改、替换、删除就不用担心会影响先有客户端的程序。</p></li><li><p style="margin: 0px 0px 10px;">如果一个包级私有的顶层类(或者接口)只是在某一个类内部被用到，就应该考虑把它变成唯一使用它的那个类的私有嵌套类。</p></li><li><p style="margin: 0px 0px 10px;">降低不必要公有类的可访问性，比降低包级私有的顶层类更重要的多，因为共有类是API的一部分，而包级私有的顶层类已经是包实现的一部分了。</p></li><li><p style="margin: 0px 0px 10px;">受保护(<strong>protected</strong>)的类或成员是导出API的一部分，必须永远得到支持，应该避免尽量少用。</p></li><li><p style="margin: 0px 0px 10px;">如果子类覆盖了超类的一个方法，子类中的访问级别就不允许低于超类中的访问级别，否则会编译错误。实现了接口的所有方法也必须是共有的，因为接口中的所有方法都是隐含着共有访问级别。</p></li><li><p style="margin: 0px 0px 10px;">为了便于测试，不应该把其访问级别成为共有的，取而代之是把测试类成为包的一部分，从而能够访问它的包级私有元素。</p></li><li><p style="margin: 0px 0px 10px;"><strong>实例域决不能是共有的，包含公有可变域的类即便是final的也不是线程安全的</strong>，</p></li></ul></div><div style="padding-left: 15px; margin: 0px 0px 20px; border-left-width: 5px; border-left-style: solid; border-left-color: #eeeeee;"><table style="max-width: 100%; background-color: transparent; border-collapse: collapse; border-spacing: 0px;"><tbody><tr><td><div>Note</div></td><td>长度非零的数组总数可变的，所以，类具有公有的静态final数组域，或者返回这种域的访问方法，这几乎总数错误的。<br /></td></tr></tbody></table></div><div><p style="margin: 0px 0px 10px;"><div style="display: inline-block;"></div></p><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #008888; font-weight: bold;">public</span> <span style="color: #333399; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">UnmodifiableArray</span> {<br />       <span style="color: #777777;">// 潜在安全漏洞<br /></span>       <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #008888; font-weight: bold;">final</span> <span style="color: #00aa55; font-weight: bold;">String</span><span style="color: #333399; font-weight: bold;">[]</span> VALUES = { <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">RED</span><span style="color: #771100;">"</span></span>, <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">GREEN</span><span style="color: #771100;">"</span></span> };<br /><br />       <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #333399; font-weight: bold;">void</span> main(<span style="color: #00aa55; font-weight: bold;">String</span><span style="color: #333399; font-weight: bold;">[]</span> args) {<br />         UnmodifiableArray UF = <span style="color: #008800; font-weight: bold;">new</span> UnmodifiableArray();<br />         UF.VALUES[<span style="color: #0000dd;">1</span>] = <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">YELLO</span><span style="color: #771100;">"</span></span>;<span style="color: #777777;">//设置final数组成员<br /></span>         <span style="color: #00aa55; font-weight: bold;">System</span>.out.println(UF);<br />      }<br />      <span style="color: #777777;">//使用Guava<br /></span>     <span style="color: #000077;">@Override<br /></span>     <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #00aa55; font-weight: bold;">String</span> toString() {<br />         <span style="color: #008800; font-weight: bold;">return</span> Objects.toStringHelper(<span style="color: #996633;">this</span>).add(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">VALUES0</span><span style="color: #771100;">"</span></span>, UnmodifiableArray.VALUES[<span style="color: #0000dd;">0</span>])<br />                 .add(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">VALUES1</span><span style="color: #771100;">"</span></span>, UnmodifiableArray.VALUES[<span style="color: #0000dd;">1</span>]).toString();<br />     }<br /> }</code></pre></div></div><div></div><br /><p style="margin: 0px 0px 10px;">上面的例子里，我们成功更改了一个不可变数组，把成员<tt>GREEN</tt>修改为<tt>YELLO</tt>，执行输出如下：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">UnmodifiableArray{VALUES0=RED, VALUES1=YELLO}</code></pre></div></div><div><p style="margin: 0px 0px 10px;">我们可以通过增加一个不可变集合列表来解决这个安全问题，并把原来<tt>public</tt>访问级别改为<tt>private</tt>的：</p></div><div><div style="display: inline-block;"></div></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #008888; font-weight: bold;">public</span> <span style="color: #333399; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">UnmodifiableArrayList</span> {<br />      <span style="color: #777777;">// 消除安全漏洞<br /></span>     <span style="color: #008888; font-weight: bold;">private</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #008888; font-weight: bold;">final</span> <span style="color: #00aa55; font-weight: bold;">String</span><span style="color: #333399; font-weight: bold;">[]</span> PRIVATE_VALUES = { <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">RED</span><span style="color: #771100;">"</span></span>, <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">GREEN</span><span style="color: #771100;">"</span></span> };<br />     <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #008888; font-weight: bold;">final</span> <span style="color: #00aa55; font-weight: bold;">List</span>&lt;<span style="color: #00aa55; font-weight: bold;">String</span>&gt; PVALUES = <span style="color: #00aa55; font-weight: bold;">Collections</span>.unmodifiableList(<span style="color: #00aa55; font-weight: bold;">Arrays</span>.asList(PRIVATE_VALUES));<br />     <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #333399; font-weight: bold;">void</span> main(<span style="color: #00aa55; font-weight: bold;">String</span><span style="color: #333399; font-weight: bold;">[]</span> args) {<br />         UnmodifiableArrayList UF = <span style="color: #008800; font-weight: bold;">new</span> UnmodifiableArrayList();<br />         UF.PVALUES.add(<span style="color: #0000dd;">1</span>, <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">YELLO</span><span style="color: #771100;">"</span></span>); <span style="color: #777777;">//会抛出UnsupportedOperationException异常<br /></span>         <span style="color: #00aa55; font-weight: bold;">System</span>.out.println(UF);<br />     }<br />     <span style="color: #777777;">//使用Guava<br /></span>     <span style="color: #000077;">@Override<br /></span>     <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #00aa55; font-weight: bold;">String</span> toString() {<br />         <span style="color: #008800; font-weight: bold;">return</span> Objects.toStringHelper(<span style="color: #996633;">this</span>)<br />                         .add(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">PVALUES0</span><span style="color: #771100;">"</span></span>, UnmodifiableArrayList.PVALUES.get(<span style="color: #0000dd;">0</span>))<br />                         .add(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">PVALUES1</span><span style="color: #771100;">"</span></span>, UnmodifiableArrayList.PVALUES.get(<span style="color: #0000dd;">1</span>))<br />                         .toString();<br />     }<br /> }</code></pre></div></div><div></div><div><p style="margin: 0px 0px 10px;">构建一个不可变集合，Guava给出了更简洁的办法：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">ImmutableList mmutableList = ImmutableList.of(PRIVATE_VALUES);</code></pre></div></div></div><p style="margin: 0px 0px 10px;"></p><div>2013-06-14</div></div></div><img src ="http://www.blogjava.net/kuuyee/aggbug/400560.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2013-06-14 17:09 <a href="http://www.blogjava.net/kuuyee/archive/2013/06/14/400560.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java四大名著下载大全（中文+英文）</title><link>http://www.blogjava.net/kuuyee/archive/2013/06/03/400084.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Mon, 03 Jun 2013 00:30:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2013/06/03/400084.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/400084.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2013/06/03/400084.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/400084.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/400084.html</trackback:ping><description><![CDATA[<div style="float: left; min-height: 1px; margin-left: 30px; width: 870px; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px; background-color: #f0efe7;"><br /><div style="background-color: #fcfcfa; border: 1px solid #e2e0d8; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 22px; margin-bottom: 35px;"><h2><span style="font-size: 14px;">抽时间整理了一下Java四大名著，分享出来方便大家学习！</span></h2><div style="padding-left: 15px; margin: 0px 0px 20px; border-left-width: 5px; border-left-style: solid; border-left-color: #eeeeee;"><table style="max-width: 100%; background-color: transparent; border-collapse: collapse; border-spacing: 0px;"><tbody><tr><td><div>Note</div></td><td><strong>郑重声明！本人强烈支持正版，四大名著我已经买了三本，下载电子版只是方便阅读！毕竟这么经典的书是必收藏的！</strong></td></tr></tbody></table></div><div><ul style="padding: 0px; margin: 0px 0px 10px 25px;"><li><p style="margin: 0px 0px 10px;"><a href="http://book.jd.com/10058164.html" style="color: #0088cc; text-decoration: none;">Java编程思想(第4版)</a></p><div><ul style="padding: 0px; margin: 0px 0px 0px 25px;"><li><p style="margin: 0px 0px 10px;">中文高清版：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=502949&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=502949&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">英文原版PDF：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503042&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503042&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">随书源码：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503044&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503044&amp;uk=2785758310</a></p></li></ul></div></li><li><p style="margin: 0px 0px 10px;"><a href="http://book.jd.com/10058902.html" style="color: #0088cc; text-decoration: none;">Effective Java（第2版）</a></p><div><ul style="padding: 0px; margin: 0px 0px 0px 25px;"><li><p style="margin: 0px 0px 10px;">中文高清版：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503046&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503046&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">英文原版PDF：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503049&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503049&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">随书源码：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503051&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503051&amp;uk=2785758310</a></p></li></ul></div></li><li><p style="margin: 0px 0px 10px;"><a href="http://book.jd.com/10058538.html" style="color: #0088cc; text-decoration: none;">Java核心技术 卷I（第8版）</a></p><div><ul style="padding: 0px; margin: 0px 0px 0px 25px;"><li><p style="margin: 0px 0px 10px;">中文高清版：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503052&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503052&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">英文原版PDF：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503055&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503055&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">随书源码：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503056&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503056&amp;uk=2785758310</a></p></li></ul></div></li><li><p style="margin: 0px 0px 10px;"><a href="http://book.jd.com/10058907.html" style="color: #0088cc; text-decoration: none;">Java核心技术 卷II（第8版）</a></p><div><ul style="padding: 0px; margin: 0px 0px 0px 25px;"><li><p style="margin: 0px 0px 10px;">中文高清版：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503057&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503057&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">英文原版CHM：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503058&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503058&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">随书源码：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503056&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503056&amp;uk=2785758310</a></p></li></ul></div></li><li><p style="margin: 0px 0px 10px;"><a href="http://book.jd.com/10137873.html" style="color: #0088cc; text-decoration: none;">Java语言程序设计(第4版)</a></p><div><ul style="padding: 0px; margin: 0px 0px 0px 25px;"><li><p style="margin: 0px 0px 10px;">中文高清版：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503059&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503059&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">英文原版CHM：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503060&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503060&amp;uk=2785758310</a></p></li></ul></div></li><li><p style="margin: 0px 0px 10px;"><a href="http://product.china-pub.com/24614" style="color: #0088cc; text-decoration: none;">Java编程思想(第3版)</a></p><div><ul style="padding: 0px; margin: 0px 0px 0px 25px;"><li><p style="margin: 0px 0px 10px;">中文高清非扫描版：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503099&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503099&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">英文原版PDF：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503102&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503102&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">随书源码：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503103&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503103&amp;uk=2785758310</a></p></li><li><p style="margin: 0px 0px 10px;">习题答案：&nbsp;<a href="http://pan.baidu.com/share/link?shareid=503105&amp;uk=2785758310" style="color: #0088cc; text-decoration: none;">http://pan.baidu.com/share/link?shareid=503105&amp;uk=2785758310</a></p></li></ul></div></li></ul></div><p style="margin: 0px 0px 10px;"></p><div>2013-05-30</div></div></div><img src ="http://www.blogjava.net/kuuyee/aggbug/400084.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2013-06-03 08:30 <a href="http://www.blogjava.net/kuuyee/archive/2013/06/03/400084.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>当EffectiveJava遇见Guava - 静态工厂方法代替构造器(规则1)</title><link>http://www.blogjava.net/kuuyee/archive/2013/05/30/399987.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Thu, 30 May 2013 09:09:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2013/05/30/399987.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/399987.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2013/05/30/399987.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/399987.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/399987.html</trackback:ping><description><![CDATA[<div style="float: left; min-height: 1px; margin-left: 30px; width: 870px; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px; background-color: #f0efe7;"><hr style="margin: 20px 0px; border-right-width: 0px; border-left-width: 0px; border-top-style: solid; border-top-color: #eeeeee; border-bottom-style: solid; border-bottom-color: #ffffff;" /><div style="background-color: #fcfcfa; border: 1px solid #e2e0d8; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 22px; margin-bottom: 35px;"><h2><a href="http://book.jd.com/10058902.html" style="font-size: 14px; color: #0088cc; text-decoration: none;">Effective Java</a><span style="font-size: 14px;">中指出，使用静态工厂方法代替构造器有几大优势：</span></h2><div><h4>第一大优势 - 他们有名称。</h4><div><p style="margin: 0px 0px 10px;">多个构造器只能通过匹配参数类型的顺序不同来区分使用哪一个，这样常常会导致用户调用错误构造器，而静态工程方法则不同，可以通过方法名清晰的指明用意。</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #777777;">//本例只用来说明第一大优势，请不要纠结其它问题</span> <br /><span style="color: #008888; font-weight: bold;">public</span> <span style="color: #333399; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">Foo</span> {<br />         <span style="color: #00aa55; font-weight: bold;">Set</span>&lt;Bar&gt; bars;<br />         <span style="color: #00aa55; font-weight: bold;">List</span>&lt;Car&gt; cars;<br />         <span style="color: #777777;">//构造器1<br /></span>         <span style="color: #008888; font-weight: bold;">private</span> Foo(<span style="color: #00aa55; font-weight: bold;">Set</span>&lt;Bar&gt; bars) {<br />                 <span style="color: #996633;">this</span>.bars = bars;<br />         }<br />         <span style="color: #777777;">//构造器2<br /></span>         <span style="color: #008888; font-weight: bold;">private</span> Foo(<span style="color: #00aa55; font-weight: bold;">List</span>&lt;Car&gt; cars) {<br />                 <span style="color: #996633;">this</span>.cars = cars;<br />         }<br />         <span style="color: #777777;">//构造器3<br /></span>         <span style="color: #008888; font-weight: bold;">private</span> Foo(<span style="color: #00aa55; font-weight: bold;">Set</span>&lt;Bar&gt; bars, <span style="color: #00aa55; font-weight: bold;">List</span>&lt;Car&gt; cars) {<br />                 <span style="color: #996633;">this</span>.bars = bars;<br />                 <span style="color: #996633;">this</span>.cars = cars;<br />         }<br />         <span style="color: #777777;">//静态工厂方法1<br /></span>         <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> Foo newInstanceByBar(){<br />                 <span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">new</span> Foo(<span style="color: #008800; font-weight: bold;">new</span> <span style="color: #00aa55; font-weight: bold;">HashSet</span>&lt;Bar&gt;());<br />         }<br />         <span style="color: #777777;">//静态工厂方法2<br /></span>         <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> Foo newInstanceByCar(){<br />                 <span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">new</span> Foo(<span style="color: #008800; font-weight: bold;">new</span> <span style="color: #00aa55; font-weight: bold;">ArrayList</span>&lt;Car&gt;());<br />         }<br />         <span style="color: #777777;">//静态工厂方法3<br /></span>         <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> Foo newInstanceByAll(){<br />                 <span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">new</span> Foo(<span style="color: #008800; font-weight: bold;">new</span> <span style="color: #00aa55; font-weight: bold;">HashSet</span>&lt;Bar&gt;(),<span style="color: #008800; font-weight: bold;">new</span> <span style="color: #00aa55; font-weight: bold;">ArrayList</span>&lt;Car&gt;());<br />         }<br />         <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #333399; font-weight: bold;">void</span> main(<span style="color: #00aa55; font-weight: bold;">String</span><span style="color: #333399; font-weight: bold;">[]</span> args) {<br />                 <span style="color: #777777;">// 通过构造器创建实例，不好区分容易使用错误<br /></span>                 Foo fbar = <span style="color: #008800; font-weight: bold;">new</span> Foo(<span style="color: #008800; font-weight: bold;">new</span> <span style="color: #00aa55; font-weight: bold;">HashSet</span>&lt;Bar&gt;());<br />                 Foo fcar = <span style="color: #008800; font-weight: bold;">new</span> Foo(<span style="color: #008800; font-weight: bold;">new</span> <span style="color: #00aa55; font-weight: bold;">ArrayList</span>&lt;Car&gt;());<br />                 Foo fall = <span style="color: #008800; font-weight: bold;">new</span> Foo(<span style="color: #008800; font-weight: bold;">new</span> <span style="color: #00aa55; font-weight: bold;">HashSet</span>&lt;Bar&gt;(),<span style="color: #008800; font-weight: bold;">new</span> <span style="color: #00aa55; font-weight: bold;">ArrayList</span>&lt;Car&gt;());<br />                  <span style="color: #777777;">// 通过静态工厂方法可以清晰的用方法名识别<br /></span>                 Foo fbar_static = Foo.newInstanceByBar();<br />                 Foo fcar_static = Foo.newInstanceByCar();<br />                 Foo fall_static = Foo.newInstanceByAll();<br />         }<br />  }<br />  <span style="color: #333399; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">Bar</span> {}<br />  <span style="color: #333399; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">Car</span> {} <br /></code></pre></div></div><div><p style="margin: 0px 0px 10px;">对于Guava，并没有提供创建静态工厂方法的工具，但整个Guava API到处都是静态方法的实现，我们以Guava Collections Framewrok举例说明。</p></div><div><p style="margin: 0px 0px 10px;">Guava对于第一大优势有很多实现：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #00aa55; font-weight: bold;">List</span>&lt;<span style="color: #00aa55; font-weight: bold;">Type</span>&gt; exactly100 = Lists.newArrayListWithCapacity(<span style="color: #0000dd;">100</span>);<br /><span style="color: #00aa55; font-weight: bold;">List</span>&lt;<span style="color: #00aa55; font-weight: bold;">Type</span>&gt; approx100 = Lists.newArrayListWithExpectedSize(<span style="color: #0000dd;">100</span>); <br /><span style="color: #00aa55; font-weight: bold;">Set</span>&lt;<span style="color: #00aa55; font-weight: bold;">Type</span>&gt; approx100Set = Sets.newHashSetWithExpectedSize(<span style="color: #0000dd;">100</span>);</code></pre></div></div></div><div><h4>第二大优势 - 不必在每次调用他们的时候都创建一个新对象。</h4><div><p style="margin: 0px 0px 10px;">方便对象重用，还可以确保不可变的不会存在两个相等的实例，如果<tt>a==b</tt>那么<tt>a.equals.(b)</tt>才会返回true ,如果能保证这一点，就可以使用<tt>==</tt>操作符来比较对象，会有很大的性能提升。</p></div></div><div><h4>第三大优势 - 他们可以返回原返回类型的任何子类型的对象。</h4><div><p style="margin: 0px 0px 10px;">这是一个非常强大的特性，&nbsp;<a href="http://book.jd.com/10058902.html" style="color: #0088cc; text-decoration: none;">Effective Java</a>中列举了API、SPI、服务提供框架的关系来说明：</p></div><div><p style="margin: 0px 0px 10px;"><strong>API</strong>(Service Interface): 服务公共接口&nbsp;<strong>SPI</strong>(Service Provider Interface)： 服务提供商接口&nbsp;<strong>SPF</strong>(Service Provider Framework): 服务提供框架</p></div><div><p style="margin: 0px 0px 10px;">看例子:</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #777777;">// 服务提供框架示意模型 - 服务API</span> <br /><span style="color: #008888; font-weight: bold;">public</span> <span style="color: #333399; font-weight: bold;">interface</span> <span style="color: #bb0066; font-weight: bold;">ServiceAPI</span> {<br />         <span style="color: #777777;">// 这里是服务指定的方法<br /></span> }<br /><span style="color: #777777;">// 服务提供框架示意模型 - 服务SPI</span> <br /><span style="color: #008888; font-weight: bold;">public</span> <span style="color: #333399; font-weight: bold;">interface</span> <span style="color: #bb0066; font-weight: bold;">ServiceSPI</span> {<br />         ServiceAPI newService();<br /> }  <br /><span style="color: #777777;">// 服务提供框架示意模型实现</span> <br /><span style="color: #777777;">// 不可实例化的类，用来注册创建和提供访问</span> <br /><span style="color: #008888; font-weight: bold;">public</span> <span style="color: #333399; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">ServiceFramework</span> {<br />         <span style="color: #008888; font-weight: bold;">private</span> ServiceFramework() {<br />         }<span style="color: #777777;">// 强制防止实例化（规则4）<br /><br /></span>         <span style="color: #777777;">// 映射服务名到服务<br /></span>         <span style="color: #008888; font-weight: bold;">private</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #008888; font-weight: bold;">final</span> <span style="color: #00aa55; font-weight: bold;">ConcurrentMap</span>&lt;<span style="color: #00aa55; font-weight: bold;">String</span>, ServiceSPI&gt; spis = <span style="color: #008800; font-weight: bold;">new</span> MapMaker().makeMap();<span style="color: #777777;">//使用Guava创建<br /></span>         <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #008888; font-weight: bold;">final</span> <span style="color: #00aa55; font-weight: bold;">String</span> DEFAULT_SPI_NAME = <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">&lt;def&gt;</span><span style="color: #771100;">"</span></span>;<br /><br />         <span style="color: #777777;">// 默认SPI注册API<br /></span>         <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #333399; font-weight: bold;">void</span> registerDefaultSPI(ServiceSPI spi) {<br />                 registerSPI(DEFAULT_SPI_NAME, spi);<br />         }<br /><br />         <span style="color: #777777;">// 指定SPI注册API<br /></span>         <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #333399; font-weight: bold;">void</span> registerSPI(<span style="color: #00aa55; font-weight: bold;">String</span> name, ServiceSPI spi) {<br />                 spis.put(name, spi);<br />         }<br /><br />         <span style="color: #777777;">// 服务访问API<br /></span>         <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> ServiceAPI newInstance() {<br />                 <span style="color: #008800; font-weight: bold;">return</span> newInstance(DEFAULT_SPI_NAME);<br />         }<br />         <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> ServiceAPI newInstance(<span style="color: #00aa55; font-weight: bold;">String</span> name) {<br />                 ServiceSPI spi = spis.get(name);<br />                 <span style="color: #008800; font-weight: bold;">if</span>(spi == <span style="color: #006699;">null</span>)<br />                         <span style="color: #008800; font-weight: bold;">throw</span> <span style="color: #008800; font-weight: bold;">new</span> <span style="color: #cc0000; font-weight: bold;">IllegalArgumentException</span>(<br />                                         <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">No provider registered with name: </span><span style="color: #771100;">"</span></span> + name);<br />                 <span style="color: #008800; font-weight: bold;">return</span> spi.newService();<br />         }<br /> }</code></pre></div></div><div style="padding-left: 15px; margin: 0px 0px 20px; border-left-width: 5px; border-left-style: solid; border-left-color: #eeeeee;"><table style="max-width: 100%; background-color: transparent; border-collapse: collapse; border-spacing: 0px;"><tbody><tr><td><div>Note</div></td><td><strong style="color: #333333;">静态工程方法返回的对象所属的类，在编写这个包含静态工厂方法的类时可以不必存在。上面的例子在编写ServiceFramework类时，ServiceAPI的实现类并不存在。这大大增加了框架的灵活性。</strong></td></tr></tbody></table></div><div><p style="margin: 0px 0px 10px;">现在编写客户端测试程序</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #777777;">// 简单的服务提供框架测试程序</span> <br /><span style="color: #008888; font-weight: bold;">public</span> <span style="color: #333399; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">Test</span> {<br />         <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #333399; font-weight: bold;">void</span> main(<span style="color: #00aa55; font-weight: bold;">String</span><span style="color: #333399; font-weight: bold;">[]</span> args) {<br />                 <span style="color: #777777;">// 服务提供商执行下面的注册<br /></span>                 ServiceFramework.registerDefaultSPI(DEFAULT_PROVIDER);<br />                 ServiceFramework.registerSPI(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">comp</span><span style="color: #771100;">"</span></span>, COMP_PROVIDER);<br />                 ServiceFramework.registerSPI(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">armed</span><span style="color: #771100;">"</span></span>, ARMED_PROVIDER);<br />                  <span style="color: #777777;">// 客户端执行下面的创建<br /></span>                 ServiceAPI s1 = ServiceFramework.newInstance();<br />                 ServiceAPI s2 = ServiceFramework.newInstance(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">comp</span><span style="color: #771100;">"</span></span>);<br />                 ServiceAPI s3 = ServiceFramework.newInstance(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">armed</span><span style="color: #771100;">"</span></span>);<br />                 <span style="color: #00aa55; font-weight: bold;">System</span>.out.printf(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">%s, %s, %s%n</span><span style="color: #771100;">"</span></span>, s1, s2, s3);<br />         }<br />          <span style="color: #008888; font-weight: bold;">private</span> <span style="color: #008888; font-weight: bold;">static</span> ServiceSPI DEFAULT_PROVIDER = <span style="color: #008800; font-weight: bold;">new</span> ServiceSPI() {<br />                 <span style="color: #008888; font-weight: bold;">public</span> ServiceAPI newService() {<br />                         <span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">new</span> ServiceAPI() {<br />                                 <span style="color: #000077;">@Override<br /></span>                                 <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #00aa55; font-weight: bold;">String</span> toString() {<br />                                         <span style="color: #008800; font-weight: bold;">return</span> <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">默认服务</span><span style="color: #771100;">"</span></span>;<br />                                 }<br />                         };<br />                 }<br />         };<br />          <span style="color: #008888; font-weight: bold;">private</span> <span style="color: #008888; font-weight: bold;">static</span> ServiceSPI COMP_PROVIDER = <span style="color: #008800; font-weight: bold;">new</span> ServiceSPI() {<br />                 <span style="color: #008888; font-weight: bold;">public</span> ServiceAPI newService() {<br />                         <span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">new</span> ServiceAPI() {<br />                                 <span style="color: #000077;">@Override<br /></span>                                 <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #00aa55; font-weight: bold;">String</span> toString() {<br />                                         <span style="color: #008800; font-weight: bold;">return</span> <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">Complementary 服务</span><span style="color: #771100;">"</span></span>;<br />                                 }<br />                         };<br />                 }<br />         };<br />          <span style="color: #008888; font-weight: bold;">private</span> <span style="color: #008888; font-weight: bold;">static</span> ServiceSPI ARMED_PROVIDER = <span style="color: #008800; font-weight: bold;">new</span> ServiceSPI() {<br />                 <span style="color: #008888; font-weight: bold;">public</span> ServiceAPI newService() {<br />                         <span style="color: #008800; font-weight: bold;">return</span> <span style="color: #008800; font-weight: bold;">new</span> ServiceAPI() {<br />                                 <span style="color: #000077;">@Override<br /></span>                                 <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #00aa55; font-weight: bold;">String</span> toString() {<br />                                         <span style="color: #008800; font-weight: bold;">return</span> <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">Armed 服务</span><span style="color: #771100;">"</span></span>;<br />                                 }<br />                         };<br />                 }<br />         };<br /> }<br />  <br /><span style="color: #777777;">//输出如下</span> <span style="color: #ff0000; background-color: #ffaaaa;">默</span><span style="color: #ff0000; background-color: #ffaaaa;">认</span><span style="color: #ff0000; background-color: #ffaaaa;">服</span><span style="color: #ff0000; background-color: #ffaaaa;">务</span>, Complementary <span style="color: #ff0000; background-color: #ffaaaa;">服</span><span style="color: #ff0000; background-color: #ffaaaa;">务</span>, Armed <span style="color: #ff0000; background-color: #ffaaaa;">服</span><span style="color: #ff0000; background-color: #ffaaaa;">务</span></code></pre></div></div></div><div><h4>第四大优势 - 在创建参数化类型实例的时候，他们使代码变得更加简洁。</h4><div><p style="margin: 0px 0px 10px;">在JDK7之前，我们创建一个Collections大致是这么做的：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #00aa55; font-weight: bold;">List</span>&lt;TypeThatsTooLongForItsOwnGood&gt; list = <span style="color: #008800; font-weight: bold;">new</span> <span style="color: #00aa55; font-weight: bold;">ArrayList</span>&lt;TypeThatsTooLongForItsOwnGood&gt;();</code></pre></div></div><div><p style="margin: 0px 0px 10px;">JDK7发布以后，我们可以简化成这样：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #00aa55; font-weight: bold;">List</span>&lt;TypeThatsTooLongForItsOwnGood&gt; list = <span style="color: #008800; font-weight: bold;">new</span> <span style="color: #00aa55; font-weight: bold;">ArrayList</span>&lt;&gt;();</code></pre></div></div><div><p style="margin: 0px 0px 10px;">但是Guava还是宁愿使用静态工程方法，因为真的非常方便：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #00aa55; font-weight: bold;">Set</span>&lt;<span style="color: #00aa55; font-weight: bold;">Type</span>&gt; copySet = Sets.newHashSet(elements); <br /><span style="color: #00aa55; font-weight: bold;">List</span>&lt;<span style="color: #00aa55; font-weight: bold;">String</span>&gt; theseElements = Lists.newArrayList(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">alpha</span><span style="color: #771100;">"</span></span>, <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">beta</span><span style="color: #771100;">"</span></span>, <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">gamma</span><span style="color: #771100;">"</span></span>);</code></pre></div></div></div><div><h4>静态工程方法的缺点</h4><div><ul style="padding: 0px; margin: 0px 0px 10px 25px;"><li><p style="margin: 0px 0px 10px;">类如果不含公有的或者受保护的构造器，就不能被子类化，这也许会因祸得福，因为它鼓励开发人员使用复合，而不是继承。</p></li><li><p style="margin: 0px 0px 10px;">他们与其他的静态方法实际上没有任何区别 如果API文档没有明确的说明这是一个静态工程方法，就会很难识别出来。遵循标准的命名规范习惯，可以弥补这一劣势，下面列出一些惯用命名：</p><div><ul style="padding: 0px; margin: 0px 0px 0px 25px;"><li><p style="margin: 0px 0px 10px;"><strong>valueOf</strong>&nbsp;- 这样的静态工厂方法实际上是类型转换</p></li><li><p style="margin: 0px 0px 10px;"><strong>of</strong>&nbsp;- valueOf的简洁方式</p></li><li><p style="margin: 0px 0px 10px;"><strong>getInstance</strong>&nbsp;- 返回实例通过方法参数描述，对于单例，该方法没有参数，并返回唯一的实例</p></li><li><p style="margin: 0px 0px 10px;"><strong>newInstance</strong>&nbsp;- 与getInstance不同的是，它返回的实例与所有其它实例都是不同的</p></li><li><p style="margin: 0px 0px 10px;"><strong>getType</strong>&nbsp;- 像getInstance一样，但是在工厂方法处于不同的类中的时候使用。Type表示i返回对象类型</p></li><li><p style="margin: 0px 0px 10px;"><strong>newType</strong>&nbsp;- 像newInstance一样，但是在工厂方法处于不同的类中的时候使用。Type表示i返回对象类型</p></li></ul></div></li></ul></div></div><p style="margin: 0px 0px 10px;"></p><div>2013-05-29</div></div></div><img src ="http://www.blogjava.net/kuuyee/aggbug/399987.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2013-05-30 17:09 <a href="http://www.blogjava.net/kuuyee/archive/2013/05/30/399987.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>当EffectiveJava遇见Guava - toString(规则10)</title><link>http://www.blogjava.net/kuuyee/archive/2013/05/29/399914.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Wed, 29 May 2013 03:40:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2013/05/29/399914.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/399914.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2013/05/29/399914.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/399914.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/399914.html</trackback:ping><description><![CDATA[<div style="float: left; min-height: 1px; margin-left: 30px; width: 870px; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px; background-color: #f0efe7;"><br /><div style="background-color: #fcfcfa; border: 1px solid #e2e0d8; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 22px; margin-bottom: 35px;"><h2><span style="font-size: 14px;">我们都知道Java书籍有四大名著，其中&nbsp;</span><a href="http://book.jd.com/10058902.html" style="font-size: 14px; color: #0088cc; text-decoration: none;">Effective Java</a><span style="font-size: 14px;">可以说是高手进阶必看的，作者&nbsp;</span><a href="http://en.wikipedia.org/wiki/Joshua_Bloch" style="font-size: 14px; color: #0088cc; text-decoration: none;">Joshua Bloch</a><span style="font-size: 14px;">是Google的首席Java架构师，如果把 James Gosling称为Java之父，那么Joshua Bloch就像是Java之母，是他把Java养育成人。之前曾有人讨论过Google有很多编码规范，为什么唯独没有Java版的问题，最终的结论就是：</span><strong style="font-size: 14px;">Google的Java编码规范就是 Effective Java一书</strong><span style="font-size: 14px;">，可见此书有多么重要。现在Google又推出了强大好用的Java通用类库&nbsp;</span><a href="https://code.google.com/p/guava-libraries/" style="font-size: 14px; color: #0088cc; text-decoration: none;">Guava</a><span style="font-size: 14px;">，公认为比Apache Common好用，因为Apache要兼容老版本，所以妨碍了很多Java的新特性的使用。</span></h2><div><p style="margin: 0px 0px 10px;">既然Effective Java和Guava都诞生于Google，那么当他们相遇会什么样呢，为此我决定重温Effective Java这部著作，并针对每一条规则寻找Guava给出的解决方案，希望能更深入的掌握Java。</p></div><div><p style="margin: 0px 0px 10px;"><a href="http://book.jd.com/10058902.html" style="color: #0088cc; text-decoration: none;">Effective Java</a>第10条规则：&nbsp;<strong>始终要覆盖</strong><tt>toString</tt><strong>方法</strong></p></div><div><p style="margin: 0px 0px 10px;"><a href="http://book.jd.com/10058902.html" style="color: #0088cc; text-decoration: none;">Effective Java</a>里指出，"建议所有的子类都覆盖这个<tt>toString</tt>方法"，这样可以使类用起来更加舒适。最重要的是这样的做法对调试非常有帮助，Guava通过&nbsp;<a href="http://docs.guava-libraries.googlecode.com/git-history/release/javadoc/com/google/common/base/Objects.html#toStringHelper" style="color: #0088cc; text-decoration: none;">Objects.toStringHelper</a>为我们提供了方便创建<tt>toString</tt>的方法。看下面的样例：<br /></p><pre class="highlight CodeRay" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code class="java" style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #777777;">// Returns "ClassName{x=1}"</span>
   Objects.toStringHelper(<span style="color: #996633;">this</span>)
       .add(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">x</span><span style="color: #771100;">"</span></span>, <span style="color: #0000dd;">1</span>)
       .toString();

   <span style="color: #777777;">// Returns "MyObject{x=1}"</span>
   Objects.toStringHelper(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">MyObject</span><span style="color: #771100;">"</span></span>)
       .add(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">x</span><span style="color: #771100;">"</span></span>, <span style="color: #0000dd;">1</span>)
       .toString();</code></pre><p style="margin: 0px 0px 10px;"><br />Guava关于toString的文档连接：&nbsp;<a href="https://code.google.com/p/guava-libraries/wiki/CommonObjectUtilitiesExplained" style="color: #0088cc; text-decoration: none;">https://code.google.com/p/guava-libraries/wiki/CommonObjectUtilitiesExplained</a></p></div><div><p style="margin: 0px 0px 10px;">下面我把Effective Java的样例代码列出，并用Guava重新了<tt>toString</tt>方法<br /></p><pre class="highlight CodeRay" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code class="java" style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #777777;">// 重写PhoneNumber的toString方法 - Effective Java中文第二版第44页</span>
<span style="color: #008800; font-weight: bold;">package</span> <span style="color: #770077; font-weight: bold;">org.effectivejava.examples.chapter03.item10</span>;

<span style="color: #008800; font-weight: bold;">import</span> <span style="color: #bb4444; font-weight: bold;">java.util.HashMap</span>;
<span style="color: #008800; font-weight: bold;">import</span> <span style="color: #bb4444; font-weight: bold;">java.util.Map</span>;

<span style="color: #008800; font-weight: bold;">import</span> <span style="color: #bb4444; font-weight: bold;">com.google.common.base.Objects</span>;

<span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">final</span> <span style="color: #333399; font-weight: bold;">class</span> <span style="color: #bb0066; font-weight: bold;">PhoneNumber</span> {
        <span style="color: #008888; font-weight: bold;">private</span> <span style="color: #008888; font-weight: bold;">final</span> <span style="color: #333399; font-weight: bold;">short</span> areaCode;
        <span style="color: #008888; font-weight: bold;">private</span> <span style="color: #008888; font-weight: bold;">final</span> <span style="color: #333399; font-weight: bold;">short</span> prefix;
        <span style="color: #008888; font-weight: bold;">private</span> <span style="color: #008888; font-weight: bold;">final</span> <span style="color: #333399; font-weight: bold;">short</span> lineNumber;

        <span style="color: #008888; font-weight: bold;">public</span> PhoneNumber(<span style="color: #333399; font-weight: bold;">int</span> areaCode, <span style="color: #333399; font-weight: bold;">int</span> prefix, <span style="color: #333399; font-weight: bold;">int</span> lineNumber) {
                rangeCheck(areaCode, <span style="color: #0000dd;">999</span>, <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">area code</span><span style="color: #771100;">"</span></span>);
                rangeCheck(prefix, <span style="color: #0000dd;">999</span>, <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">prefix</span><span style="color: #771100;">"</span></span>);
                rangeCheck(lineNumber, <span style="color: #0000dd;">9999</span>, <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">line number</span><span style="color: #771100;">"</span></span>);
                <span style="color: #996633;">this</span>.areaCode = (<span style="color: #333399; font-weight: bold;">short</span>) areaCode;
                <span style="color: #996633;">this</span>.prefix = (<span style="color: #333399; font-weight: bold;">short</span>) prefix;
                <span style="color: #996633;">this</span>.lineNumber = (<span style="color: #333399; font-weight: bold;">short</span>) lineNumber;
        }

        <span style="color: #008888; font-weight: bold;">private</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #333399; font-weight: bold;">void</span> rangeCheck(<span style="color: #333399; font-weight: bold;">int</span> arg, <span style="color: #333399; font-weight: bold;">int</span> max, <span style="color: #00aa55; font-weight: bold;">String</span> name) {
                <span style="color: #008800; font-weight: bold;">if</span> (arg &lt; <span style="color: #0000dd;">0</span> || arg &gt; max)
                        <span style="color: #008800; font-weight: bold;">throw</span> <span style="color: #008800; font-weight: bold;">new</span> <span style="color: #cc0000; font-weight: bold;">IllegalArgumentException</span>(name + <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">: </span><span style="color: #771100;">"</span></span> + arg);
        }

        <span style="color: #000077;">@Override</span>
        <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #333399; font-weight: bold;">boolean</span> equals(<span style="color: #00aa55; font-weight: bold;">Object</span> o) {
                <span style="color: #008800; font-weight: bold;">if</span> (o == <span style="color: #996633;">this</span>)
                        <span style="color: #008800; font-weight: bold;">return</span> <span style="color: #006699;">true</span>;
                <span style="color: #008800; font-weight: bold;">if</span> (!(o <span style="color: #008800; font-weight: bold;">instanceof</span> PhoneNumber))
                        <span style="color: #008800; font-weight: bold;">return</span> <span style="color: #006699;">false</span>;
                PhoneNumber pn = (PhoneNumber) o;
                <span style="color: #008800; font-weight: bold;">return</span> pn.lineNumber == lineNumber &amp;&amp; pn.prefix == prefix
                                &amp;&amp; pn.areaCode == areaCode;
        }

        <span style="color: #000077;">@Override</span>
        <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #333399; font-weight: bold;">int</span> hashCode() {
                <span style="color: #333399; font-weight: bold;">int</span> result = <span style="color: #0000dd;">17</span>;
                result = <span style="color: #0000dd;">31</span> * result + areaCode;
                result = <span style="color: #0000dd;">31</span> * result + prefix;
                result = <span style="color: #0000dd;">31</span> * result + lineNumber;
                <span style="color: #008800; font-weight: bold;">return</span> result;
        }

    <span style="color: #777777;">//Effective Java原有的toString方法</span>
        <span style="color: #777777;">/*
         * @Override public String toString() { return
         * String.format("(%03d) %03d-%04d", areaCode, prefix, lineNumber); }
         */</span>

        <span style="color: #777777;">/**
         * 采用Guava实现的toString
         *
         */</span>
        <span style="color: #000077;">@Override</span>
        <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #00aa55; font-weight: bold;">String</span> toString() {
                <span style="color: #008800; font-weight: bold;">return</span> Objects.toStringHelper(<span style="color: #996633;">this</span>)
                                .addValue(<span style="color: #00aa55; font-weight: bold;">String</span>.format(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">(%03d) %03d-%04d</span><span style="color: #771100;">"</span></span>, areaCode, prefix,lineNumber))
                                .add(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">areaCode</span><span style="color: #771100;">"</span></span>, areaCode)
                                .add(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">prefix</span><span style="color: #771100;">"</span></span>, prefix)
                                .add(<span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">lineNumber</span><span style="color: #771100;">"</span></span>, lineNumber)
                                .toString();
        }

        <span style="color: #008888; font-weight: bold;">public</span> <span style="color: #008888; font-weight: bold;">static</span> <span style="color: #333399; font-weight: bold;">void</span> main(<span style="color: #00aa55; font-weight: bold;">String</span><span style="color: #333399; font-weight: bold;">[]</span> args) {
                <span style="color: #00aa55; font-weight: bold;">Map</span>&lt;PhoneNumber, <span style="color: #00aa55; font-weight: bold;">String</span>&gt; m = <span style="color: #008800; font-weight: bold;">new</span> <span style="color: #00aa55; font-weight: bold;">HashMap</span>&lt;PhoneNumber, <span style="color: #00aa55; font-weight: bold;">String</span>&gt;();
                m.put(<span style="color: #008800; font-weight: bold;">new</span> PhoneNumber(<span style="color: #0000dd;">707</span>, <span style="color: #0000dd;">867</span>, <span style="color: #0000dd;">5309</span>), <span style="background-color: rgba(255, 0, 0, 0.0470588);"><span style="color: #771100;">"</span><span style="color: #dd2200;">Jenny</span><span style="color: #771100;">"</span></span>);

                <span style="color: #00aa55; font-weight: bold;">System</span>.out.println(m);
        }
}</code></pre><p style="margin: 0px 0px 10px;">输出对比</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"><span style="color: #777777;">//原输出<br /></span>{(<span style="color: #0000dd;">707</span>) <span style="color: #0000dd;">867</span>-<span style="color: #0000dd;">5309</span>=Jenny}  <br /><br /><span style="color: #777777;">//Guava实现输出</span> <br />{PhoneNumber{(<span style="color: #0000dd;">707</span>) <span style="color: #0000dd;">867</span>-<span style="color: #0000dd;">5309</span>, areaCode=<span style="color: #0000dd;">707</span>, prefix=<span style="color: #0000dd;">867</span>, lineNumber=<span style="color: #0000dd;">5309</span>}=Jenny}</code></pre></div></div><p style="margin: 0px 0px 10px;"></p><div>2013-05-24</div></div></div><img src ="http://www.blogjava.net/kuuyee/aggbug/399914.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2013-05-29 11:40 <a href="http://www.blogjava.net/kuuyee/archive/2013/05/29/399914.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CDI在JavaEE7中占据如此重要的地位！</title><link>http://www.blogjava.net/kuuyee/archive/2013/05/17/399413.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Fri, 17 May 2013 07:40:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2013/05/17/399413.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/399413.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2013/05/17/399413.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/399413.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/399413.html</trackback:ping><description><![CDATA[<header style="line-height: 20px;">
<div style="width: 1270px; margin-right: auto; margin-left: auto;">
<h1 style="color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif;"><span style="font-size: 21px; line-height: 30px;">从下面的JavaEE7新特性列表中，你会发现CDI是多么的重要，它无处不在！</span></h1><strong><span style="color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; font-size: 21px;">到处都标示着&#8220;</span><span style="color: #ff0066; font-family: adelle, Georgia, 'Times New Roman', serif; font-size: 21px;">CDI Integration</span><font color="#4e443c" face="adelle, Georgia, Times New Roman, serif"><span style="font-size: 21px;">&#8221;，本文摘自&nbsp;</span></font><a href="http://www.devx.com/Java/Article/47999" style="color: #0088cc; font-family: adelle, Georgia, 'Times New Roman', serif; font-size: 21px; text-decoration: none;">这里</a></strong><p>&nbsp;</p>
</div>
</header>
<div style="width: 1270px; margin-right: auto; margin-left: auto; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px;">
<div style="text-align: left; color: #5a5a5a;">
<div style="margin-left: -30px;">
<div style="float: left; min-height: 1px; margin-left: 30px; width: 370px;">
<h2><u>EJB 3.2</u></h2>
<p style="margin: 0px 0px 10px; font-size: 16px; line-height: 1.5;">Enterprise Java Bean 3.2&nbsp;<a href="http://jcp.org/en/jsr/detail?id=345" style="color: #0088cc; text-decoration: none;">(JSR 345)</a></p>
<ul clearfix"="" style="padding: 0px; margin: 0px 0px 10px; list-style: none;">
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Enhancing EJB architecture to enable the PaaS model with features such as multi-tenancy</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Factorization of container-managed transactions to use other component technologies of the Java EE platform</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Enhanced use of annotations to simplify EJB programming model</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Alignment and integration with other specifications related to JSRs within the Java EE 7 platform such as<code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 30px; color: #dd1144; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: nowrap; background-color: #f7f7f9; border: 1px solid #e1e1e8;">CDI</code>&nbsp;, JMS, Bean Validation, etc</li>
</ul>
<h2><u>EL 3.0</u></h2>
<p style="margin: 0px 0px 10px; font-size: 16px; line-height: 1.5;">Expression Language 3.0&nbsp;<a href="http://jcp.org/en/jsr/detail?id=341" style="color: #0088cc; text-decoration: none;">(JSR 341)</a></p>
<ul clearfix"="" style="padding: 0px; margin: 0px 0px 10px; list-style: none;">
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Separate expression language context into parsing and evaluation contexts independent of the JSP specification</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Introduction of new customizable expression language coercion rules</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Reference static methods and members directly in EL expressions without having to define them in Tag Library Descriptor, similar to instance method invocation</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Adding equality, string concatenation, and sizeof operators</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;<code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 30px; color: #dd1144; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: nowrap; background-color: #f7f7f9; border: 1px solid #e1e1e8;">CDI</code>&nbsp;Integration so that +events+ can be generated before/during/after the expressions are evaluated</li>
</ul>
<h2><u>JMS 2.0</u></h2>
<p style="margin: 0px 0px 10px; font-size: 16px; line-height: 1.5;">Java Messaging Service 2.0&nbsp;<a href="http://jcp.org/en/jsr/detail?id=343" style="color: #0088cc; text-decoration: none;">(JSR 343)&nbsp;</a>The new introduction will be an evolution of the previous version, JSR-914.</p>
<ul clearfix"="" style="padding: 0px; margin: 0px 0px 10px; list-style: none;">
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Enhanced JMS programming model to make application development easier, cleaning up ambiguities in the present specification</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Enhanced integration with&nbsp;<code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 30px; color: #dd1144; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: nowrap; background-color: #f7f7f9; border: 1px solid #e1e1e8;">CDI</code>&nbsp;for easier and more unified use of API</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Make necessary changes to API in allowing any JMS provider to integrate with any Java EE containerinvocation</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Make JSR more cloud-friendly, leveraging multi-tenancy and other cloud-related features from the platform</li>
</ul>
<h2><u>EL 3.0</u></h2>
<p style="margin: 0px 0px 10px; font-size: 16px; line-height: 1.5;">Expression Language 3.0&nbsp;<a href="http://jcp.org/en/jsr/detail?id=341" style="color: #0088cc; text-decoration: none;">(JSR 341)</a></p>
<ul clearfix"="" style="padding: 0px; margin: 0px 0px 10px; list-style: none;">
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Separate expression language context into parsing and evaluation contexts independent of the JSP specification</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Introduction of new customizable expression language coercion rules</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Reference static methods and members directly in EL expressions without having to define them in Tag Library Descriptor, similar to instance method invocation</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Adding equality, string concatenation, and sizeof operators</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;<code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 30px; color: #dd1144; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: nowrap; background-color: #f7f7f9; border: 1px solid #e1e1e8;">CDI</code>&nbsp;Integration so that events can be generated before/during/after the expressions are evaluated</li>
</ul>
</div>
<div style="float: left; min-height: 1px; margin-left: 30px; width: 370px;">
<h2><u>Servlet 3.1</u></h2>
<p style="margin: 0px 0px 10px; font-size: 16px; line-height: 1.5;">Java Servlet 3.2&nbsp;<a href="http://jcp.org/en/jsr/detail?id=340" style="color: #0088cc; text-decoration: none;">(JSR 340)&nbsp;</a>Servlet早在JavaEE6就已经无缝集成了&nbsp;<code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 30px; color: #dd1144; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: nowrap; background-color: #f7f7f9; border: 1px solid #e1e1e8;">CDI</code></p>
<ul clearfix"="" style="padding: 0px; margin: 0px 0px 10px; list-style: none;">
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Optimize Java EE PaaS model, leveraging the cloud for Web applications</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Optimizing PaaS model leveraging multi-tenancy. To support this into the Web container, the main areas of optimization will be security, session state, resources and</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;other multi-tenant awareness requirements for Web applications.</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Enhance the asynchronous support of Servlet 3.0 and simplify further in building asynchronous applications</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Utilize Java EE concurrency APIs for asynchronous support</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Enhance the Servlet 3.0 built-in security features</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Optimize the built-in plug-ability support of Servlet 3.0</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Focus on providing necessary functionality for building easier-to-use, high-level protocol support for Web Sockets and other protocols that work with HTTP in the Servlet API</li>
</ul>
<h2><u>JAX-RS 2.0</u></h2>
<p style="margin: 0px 0px 10px; font-size: 16px; line-height: 1.5;">Java API for RESTful Web Services 2.0&nbsp;<a href="http://jcp.org/en/jsr/detail?id=339" style="color: #0088cc; text-decoration: none;">(JSR 339)</a></p>
<ul clearfix"="" style="padding: 0px; margin: 0px 0px 10px; list-style: none;">
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Define two client APIs, both REST-compatible -- a low-level API using builder pattern and a higher-level API leveraging the low-level APIs</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Hypermedia, an important RESTful feature of Web applications, will be easy to create, and it will process links associated with resources in representation either as a header or as a links within the entity peripheral.</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Make it possible to validate parameters of forms or query using bean validation and return a meaningful response on failure to validate</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Closer integration&nbsp;<code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 30px; color: #dd1144; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: nowrap; background-color: #f7f7f9; border: 1px solid #e1e1e8;">CDI</code>&nbsp;@Inject</li>
</ul>
<h2><u>JSF 2.2</u></h2>
<p style="margin: 0px 0px 10px; font-size: 16px; line-height: 1.5;">Java Server Faces 2.2&nbsp;<a href="http://jcp.org/en/jsr/detail?id=344" style="color: #0088cc; text-decoration: none;">(JSR 344)</a></p>
<ul clearfix"="" style="padding: 0px; margin: 0px 0px 10px; list-style: none;">
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Making configuration options dynamic, eliminate tag handler class even for non-composite JSP components, introduce shorthand URLs for Facelet Tag Libraries, make cc:interface in composite components optional, enhance deployment, integrate with&nbsp;<code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 30px; color: #dd1144; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: nowrap; background-color: #f7f7f9; border: 1px solid #e1e1e8;">CDI</code></li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Component identification and Ajax</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Support implementation of Portlet Bridge 2.0</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Support for HTML5 features, such as Forms, Heading, Metadata and Section content model, Flow management, Listener for page navigation events, and new components like FileUpload and BackButton</li>
</ul>
<h2><u>CDI 1.1</u></h2>
<p style="margin: 0px 0px 10px; font-size: 16px; line-height: 1.5;">Context and Dependency Injection 1.1&nbsp;<a href="http://jcp.org/en/jsr/detail?id=346" style="color: #0088cc; text-decoration: none;">(JSR 346)</a></p>
<ul clearfix"="" style="padding: 0px; margin: 0px 0px 10px; list-style: none;">
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Global ordering of interceptors and decorators,</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;API for managing built-in context,</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Embedded mode to allow startup outside the Java EE container</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Declarative control over which packages/classes are scanned in a bean archive</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Bean declaration at constructor level</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Injection for static members, such as loggers</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Send&nbsp;<code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 30px; color: #dd1144; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: nowrap; background-color: #f7f7f9; border: 1px solid #e1e1e8;">CDI</code>&nbsp;events for Servlet events</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Better support for&nbsp;<code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 30px; color: #dd1144; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: nowrap; background-color: #f7f7f9; border: 1px solid #e1e1e8;">CDI</code>&nbsp;in libraries when used in the Java EE platform</li>
</ul>
</div>
<div style="float: left; min-height: 1px; margin-left: 30px; width: 370px;">
<h2><u>JPA 2.1</u></h2>
<p style="margin: 0px 0px 10px; font-size: 16px; line-height: 1.5;">Java Persistence API 2.1&nbsp;<a href="http://jcp.org/en/jsr/detail?id=338" style="color: #0088cc; text-decoration: none;">(JSR 338)</a></p>
<ul clearfix"="" style="padding: 0px; margin: 0px 0px 10px; list-style: none;">
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Addition of the javax.persistence.StoredProcedureQuery interface to control stored procedure query execution. &gt;Javax.persistence.EntityManager has added four variants of methods that return a StoredProcedureQuery for executing a stored procedure, including one allowing named stored procedure query. The newly introduced annotation @NamedStoredProcedureQuery can be specified on an entity or mapped class, similar to the @NamedQuery. The parameters IN, OUT and INOUT can be used to manipulate values from the stored procedure.</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;The javax.persistence.criteria.AbstractQuery interface has been refactored by CriteriaUpdate, CriteriaDelete and CommonAbstractQuery interfaces.</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Added new identifiers for persistence query language (JPQL), such as FUNCTION for supporting JPQL built-in functions, TREAT for down casting within path expressions in the FROM and WHERE clauses, and ON for specifying the relationship between the tables.</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;<code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 30px; color: #dd1144; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: nowrap; background-color: #f7f7f9; border: 1px solid #e1e1e8;">CDI</code>&nbsp;Integration Listener.The entity listeners can be annotated with @PostConstruct and @PostDestroy for their lifecycle. Also, the usual lifecycle callback methods, such as @PrePersist, @PostPersist, @PreUpdate and @PreRemove can be used for entities.</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Added support for unsynchronized persistence context to create container-managed unsynchronized persistence context. For example, @PersistenceContext (synchronization=SynchronizationType.UNSYNCHRONIZED)</li>
</ul>
<h2><u>Bean Validation 1.1</u></h2>
<p style="margin: 0px 0px 10px; font-size: 16px; line-height: 1.5;">Bean Validation 1.1&nbsp;<a href="http://jcp.org/en/jsr/detail?id=349" style="color: #0088cc; text-decoration: none;">(JSR 349)</a></p>
<ul clearfix"="" style="padding: 0px; margin: 0px 0px 10px; list-style: none;">
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Integration with other Java EE specs，&nbsp;<code style="padding: 2px 4px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 30px; color: #dd1144; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; white-space: nowrap; background-color: #f7f7f9; border: 1px solid #e1e1e8;">CDI</code>&nbsp;etc.</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;APIs to validate parameters and return values of method calls.</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Validate parameters and return values on HTTP calls</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Ability to translate a group into another group while cascading the validation</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;APIs to validate parameters and return values of method calls</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Apply constraints on group collection</li>
     <li style="line-height: 25px; float: left; width: 370px;"><em style="display: inline-block; width: 14px; height: 14px; margin-top: 1px; line-height: 14px; vertical-align: text-top; background-image: url(http://10.128.143.87:4242/images/glyphicons-halflings.png); background-position: -433px -96px; background-repeat: no-repeat no-repeat;"></em>&nbsp;Extend the model to support AND and OR style composition</li>
</ul>
</div>
</div>
</div>
</div>
&nbsp;<img src ="http://www.blogjava.net/kuuyee/aggbug/399413.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2013-05-17 15:40 <a href="http://www.blogjava.net/kuuyee/archive/2013/05/17/399413.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CDI(JSR-346)-JavaEE平台上下文依赖注入规范 1.1 新特性</title><link>http://www.blogjava.net/kuuyee/archive/2013/05/09/399037.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Thu, 09 May 2013 03:47:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2013/05/09/399037.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/399037.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2013/05/09/399037.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/399037.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/399037.html</trackback:ping><description><![CDATA[<div style="width: 1170px; margin-right: auto; margin-left: auto; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px;"><div style="margin-left: -30px;"><div style="float: left; min-height: 1px; margin-left: 30px; width: 870px;"><div style="background-color: #fcfcfa; border: 1px solid #e2e0d8; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 22px; margin-bottom: 35px;"><h2><span style="font-size: 14px;">主要功能改进</span></h2><div><div><p style="margin: 0px 0px 10px;">这些主要功能改变已经在CDI 1.1中引入：</p></div><div><ul style="padding: 0px; margin: 0px 0px 10px 25px;"><li><p style="margin: 0px 0px 10px;">加入全局拦截器 (参阅Java Interceptors Specification 1.2)， 全局装饰器 和使用<tt>@Priority</tt>注解实现替代选择</p></li><li><p style="margin: 0px 0px 10px;">给注解为<tt>@AroundConstruct</tt>的构造器加入生命周期回调支持 (参阅 Java Interceptors Specification 1.2)</p></li><li><p style="margin: 0px 0px 10px;">允许绑定拦截构造器</p></li><li><p style="margin: 0px 0px 10px;">拦截器绑定移入拦截器规范，以供其它规范使用</p></li><li><p style="margin: 0px 0px 10px;">Beans内建支持装饰器&nbsp;</p></li><li><p style="margin: 0px 0px 10px;">加入<tt>EventMetadata</tt>允许事件元数据检查</p></li><li><p style="margin: 0px 0px 10px;">加入&nbsp;<tt>@Vetoed</tt>&nbsp;注解让Classes失去原有程序能力</p></li><li><p style="margin: 0px 0px 10px;">很多改进来强化beans功能，包括&nbsp;<tt>@TransientReference</tt>&nbsp;注解允许保留实力给调用它的方法或构造函数&nbsp;</p></li><li><p style="margin: 0px 0px 10px;">加入激活和销毁周期的事件回调&nbsp;</p></li><li><p style="margin: 0px 0px 10px;">加入&nbsp;<tt>AlterableContext</tt>&nbsp;允许bean实例被明确的销毁</p></li><li><p style="margin: 0px 0px 10px;">给bean在周期注解、EJB、在JavaEE中自启动CDI功能&nbsp;</p></li><li><p style="margin: 0px 0px 10px;">在&nbsp;<tt>bean.xml</tt>中加入class过滤排除，以防止扫描classes和package&nbsp;</p></li><li><p style="margin: 0px 0px 10px;">加入&nbsp;<tt>Unmanaged</tt>&nbsp;允许方便的访问无上下文的bean实例</p></li><li><p style="margin: 0px 0px 10px;">加入&nbsp;<tt>CDI</tt>&nbsp;以方便的访问当前的CDI容器</p></li><li><p style="margin: 0px 0px 10px;">加入&nbsp;<tt>AfterTypeDiscovery</tt>事件，允许在类型发现之后扩展附加注册</p></li><li><p style="margin: 0px 0px 10px;">加入&nbsp;<tt>@WithAnnotation</tt>&nbsp;注解作为一种改善负载性能的方式</p></li><li><p style="margin: 0px 0px 10px;">在便携的扩展加入很多次要的改进</p></li></ul></div></div><p style="margin: 0px 0px 10px;"></p><div>2013-05-09</div></div></div></div></div><footer style="text-align: center; padding: 20px 0px; margin-top: 20px; border-top-width: 1px; border-top-style: solid; border-top-color: #e5e5e5; background-color: #f5f5f5; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px;"><div style="width: 1170px; margin-right: auto; margin-left: auto;"></div></footer><img src ="http://www.blogjava.net/kuuyee/aggbug/399037.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2013-05-09 11:47 <a href="http://www.blogjava.net/kuuyee/archive/2013/05/09/399037.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse配色方案插件 真漂亮！</title><link>http://www.blogjava.net/kuuyee/archive/2013/02/26/395728.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Tue, 26 Feb 2013 02:43:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2013/02/26/395728.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/395728.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2013/02/26/395728.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/395728.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/395728.html</trackback:ping><description><![CDATA[<p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">最近发现了一个Eclipse配色方案插件，这回给Eclipse配色太方便了。</p><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">插件主页：<a href="http://eclipsecolorthemes.org/" style="color: #0088cc; text-decoration: initial;">http://eclipsecolorthemes.org/</a></p><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">插件提供了上万种配色方案，非常漂亮，上图看下：</p><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;"><img src="http://www.blogjava.net/images/blogjava_net/kuuyee/53349/o_eclipse_theme_04.jpg" title="找不到方法异常" alt="找不到方法异常" style="max-width: 100%; height: 754px; vertical-align: middle; border-width: 0px; width: 937px;" width="937" height="754" /></p><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">安装很简单，打开&nbsp;<strong>Eclipse Marketplace</strong></p><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;"><img src="http://www.blogjava.net/images/blogjava_net/kuuyee/53349/o_eclipse_theme_01.jpg" title="找不到方法异常" alt="找不到方法异常" style="max-width: 100%; height: 372px; vertical-align: middle; border-width: 0px; width: 343px;" width="343" height="372" /></p><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">查找&nbsp;<strong>Eclipse Color Theme</strong>，会找到这个插件。</p><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;"><img src="http://www.blogjava.net/images/blogjava_net/kuuyee/53349/o_eclipse_theme_02.jpg" border="0" alt="" width="608" height="326" /><br /></p><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">安装完成后进入&nbsp;<strong>Preferences &#8212;&gt; Appearance &#8212;&gt; Color Theme</strong>&nbsp;就可选择主题了</p><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;"><img src="http://www.blogjava.net/images/blogjava_net/kuuyee/53349/o_eclipse_theme_03.jpg" title="找不到方法异常" alt="找不到方法异常" style="max-width: 100%; height: 656px; vertical-align: middle; border-width: 0px; width: 793px;" width="793" height="656" /></p><img src ="http://www.blogjava.net/kuuyee/aggbug/395728.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2013-02-26 10:43 <a href="http://www.blogjava.net/kuuyee/archive/2013/02/26/395728.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Jboss Seam2.3.0.BETA1发布</title><link>http://www.blogjava.net/kuuyee/archive/2012/04/08/373585.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Sun, 08 Apr 2012 12:00:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2012/04/08/373585.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/373585.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2012/04/08/373585.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/373585.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/373585.html</trackback:ping><description><![CDATA[<div><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25px; text-align: left; background-color: #f7f7f7; ">Jboss在3月30号发布了</span><span>Seam2.3.0.BETA1，</span><span>Release Notes如下：<br /><ul><li>修正了大量的Bug</li><li>全面支持JSF2</li><li>加入&nbsp;bean validation 和 EJB 3.1 的支持</li><li>升级Drools版本至5.1</li><li>升级Junit版本至4</li><li>更新大量例子支持JSF2</li></ul></span><div><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25px; text-align: left; background-color: #f7f7f7; ">Jboss Seam计划在这个月发布另一个里程碑 2.3.0.Beta2，逐步完善 Arquillian 和 Seam Gen 特性。其后就集中在 2.3.0 的BUG 修复上。&nbsp;</span></div><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25px; text-align: left; background-color: #f7f7f7; "><br />下载：</span><a target="_blank" href="http://www.seamframework.org/Seam2/Downloads" style="color: #006699; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25px; text-align: left; background-color: #f7f7f7; ">http://www.seamframework.org/Seam2/Downloads</a>&nbsp;<br style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25px; text-align: left; background-color: #f7f7f7; " /><span style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25px; text-align: left; background-color: #f7f7f7; ">文档：</span><a target="_blank" href="http://docs.jboss.org/seam/2.3.0.Beta1/html/" style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25px; text-align: left; background-color: #f7f7f7; color: #006699; ">http://www.seamframework.org/Seam2/Seam2Documentation.</a>&nbsp;</div><img src ="http://www.blogjava.net/kuuyee/aggbug/373585.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2012-04-08 20:00 <a href="http://www.blogjava.net/kuuyee/archive/2012/04/08/373585.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用Weblogic WLST脚本 远程部署Web应用</title><link>http://www.blogjava.net/kuuyee/archive/2011/10/13/361213.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Thu, 13 Oct 2011 15:46:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/10/13/361213.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/361213.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/10/13/361213.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/361213.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/361213.html</trackback:ping><description><![CDATA[废话少说 直接上代码<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; ">&nbsp;1</span>&nbsp;<span style="color: #0000FF; ">import</span><span style="color: #000000; ">&nbsp;re<br /></span><span style="color: #008080; ">&nbsp;2</span>&nbsp;<span style="color: #000000; ">&nbsp;<br /></span><span style="color: #008080; ">&nbsp;3</span>&nbsp;<span style="color: #000000; ">warPath&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #800000; ">'</span><span style="color: #800000; ">helloWebApp</span><span style="color: #800000; ">'</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">&nbsp;4</span>&nbsp;<span style="color: #000000; ">serverUrl&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #800000; ">'</span><span style="color: #800000; ">t3://192.168.1.100:7001</span><span style="color: #800000; ">'</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">&nbsp;5</span>&nbsp;<span style="color: #000000; ">username&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #800000; ">'</span><span style="color: #800000; ">weblogic</span><span style="color: #800000; ">'</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">&nbsp;6</span>&nbsp;<span style="color: #000000; ">password&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #800000; ">'</span><span style="color: #800000; ">weblogic</span><span style="color: #800000; ">'</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">&nbsp;7</span>&nbsp;<span style="color: #000000; ">targetServer</span><span style="color: #000000; ">=</span><span style="color: #800000; ">"</span><span style="color: #800000; ">examplesServer</span><span style="color: #800000; ">"</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">&nbsp;8</span>&nbsp;<span style="color: #000000; ">deployAppName</span><span style="color: #000000; ">=</span><span style="color: #800000; ">'</span><span style="color: #800000; ">DeployExample2</span><span style="color: #800000; ">'</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">&nbsp;9</span>&nbsp;<span style="color: #000000; "><br /></span><span style="color: #008080; ">10</span>&nbsp;<span style="color: #000000; ">&nbsp;<br /></span><span style="color: #008080; ">11</span>&nbsp;<span style="color: #000000; ">connect(username,&nbsp;password,&nbsp;serverUrl)<br /></span><span style="color: #008080; ">12</span>&nbsp;<span style="color: #000000; ">&nbsp;<br /></span><span style="color: #008080; ">13</span>&nbsp;<span style="color: #000000; ">appList&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;re.findall(deployAppName,&nbsp;ls(</span><span style="color: #800000; ">'</span><span style="color: #800000; ">/AppDeployments</span><span style="color: #800000; ">'</span><span style="color: #000000; ">))<br /></span><span style="color: #008080; ">14</span>&nbsp;<span style="color: #000000; "></span><span style="color: #0000FF; ">print</span><span style="color: #000000; ">&nbsp;</span><span style="color: #800000; ">"</span><span style="color: #800000; ">=========================</span><span style="color: #800000; ">"</span><span style="color: #000000; "><br /></span><span style="color: #008080; ">15</span>&nbsp;<span style="color: #000000; "></span><span style="color: #0000FF; ">print</span><span style="color: #000000; ">&nbsp;len(appList)<br /></span><span style="color: #008080; ">16</span>&nbsp;<span style="color: #000000; "></span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">&nbsp;len(appList)&nbsp;</span><span style="color: #000000; ">&gt;</span><span style="color: #000000; ">&nbsp;0:<br /></span><span style="color: #008080; ">17</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000; ">#</span><span style="color: #008000; ">oldestArchiveVersion&nbsp;=&nbsp;min(map(int,&nbsp;appList))</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">18</span>&nbsp;<span style="color: #008000; "></span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000FF; ">print</span><span style="color: #000000; ">&nbsp;</span><span style="color: #800000; ">'</span><span style="color: #800000; ">come&nbsp;in!!!</span><span style="color: #800000; ">'</span><span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /></span><span style="color: #008080; ">19</span>&nbsp;<span style="color: #000000; ">&nbsp;&nbsp;&nbsp;&nbsp;undeploy(deployAppName)<br /></span><span style="color: #008080; ">20</span>&nbsp;<span style="color: #000000; ">&nbsp;<br /></span><span style="color: #008080; ">21</span>&nbsp;<span style="color: #000000; "></span><span style="color: #008000; ">#</span><span style="color: #008000; ">deploy(appName='DeployExample',&nbsp;path&nbsp;=&nbsp;'helloWebApp',&nbsp;targets&nbsp;=&nbsp;'examplesServer',timeout=600000,&nbsp;block&nbsp;=&nbsp;'true')</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">22</span>&nbsp;<span style="color: #008000; "></span><span style="color: #000000; "><br /></span><span style="color: #008080; ">23</span>&nbsp;<span style="color: #000000; ">deploy(deployAppName,&nbsp;warPath,&nbsp;targets</span><span style="color: #000000; ">=</span><span style="color: #000000; ">targetServer,&nbsp;securityModel&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #800000; ">"</span><span style="color: #800000; ">Advanced</span><span style="color: #800000; ">"</span><span style="color: #000000; ">,timeout</span><span style="color: #000000; ">=</span><span style="color: #000000; ">600000</span><span style="color: #000000; ">,&nbsp;block&nbsp;</span><span style="color: #000000; ">=</span><span style="color: #000000; ">&nbsp;</span><span style="color: #800000; ">"</span><span style="color: #800000; ">true</span><span style="color: #800000; ">"</span><span style="color: #000000; ">)<br /></span><span style="color: #008080; ">24</span>&nbsp;<span style="color: #000000; ">exit()</span></div>Ok<img src ="http://www.blogjava.net/kuuyee/aggbug/361213.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-10-13 23:46 <a href="http://www.blogjava.net/kuuyee/archive/2011/10/13/361213.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JBoss AS7配置MySQL数据源</title><link>http://www.blogjava.net/kuuyee/archive/2011/07/19/354598.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Tue, 19 Jul 2011 02:49:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/07/19/354598.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/354598.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/07/19/354598.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/354598.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/354598.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: AS7默​认​的​数​据​源​是​H2，虽​然​H2方​便​，但​是​一​般​的​生​产​环​境​都​是​MySQL、​ORACLE、​SQLServer居​多​，本​文​描​述​如​何​在​AS7配​置​MySQL数​据​源​。&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/07/19/354598.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/354598.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-07-19 10:49 <a href="http://www.blogjava.net/kuuyee/archive/2011/07/19/354598.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JBoss AS7 发布</title><link>http://www.blogjava.net/kuuyee/archive/2011/07/13/354224.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Wed, 13 Jul 2011 01:43:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/07/13/354224.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/354224.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/07/13/354224.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/354224.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/354224.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 今天登陆jboss官网,结果一个巨幅的JBoss AS7的发布宣传广告呈现在眼前!&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/07/13/354224.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/354224.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-07-13 09:43 <a href="http://www.blogjava.net/kuuyee/archive/2011/07/13/354224.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JavaEE6 FAQs 之@Model</title><link>http://www.blogjava.net/kuuyee/archive/2011/07/12/354161.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Tue, 12 Jul 2011 06:14:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/07/12/354161.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/354161.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/07/12/354161.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/354161.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/354161.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: JavaEE6 FAQs @Model注​解​的​用​途​&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/07/12/354161.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/354161.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-07-12 14:14 <a href="http://www.blogjava.net/kuuyee/archive/2011/07/12/354161.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(翻译)JavaEE6规范 CDI教程第五部分</title><link>http://www.blogjava.net/kuuyee/archive/2011/07/12/354145.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Tue, 12 Jul 2011 02:38:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/07/12/354145.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/354145.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/07/12/354145.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/354145.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/354145.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本​部​分​讲​述​使​用​多​个​@Qualifiers来​进​一​步​区​分​注​入​类​型&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/07/12/354145.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/354145.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-07-12 10:38 <a href="http://www.blogjava.net/kuuyee/archive/2011/07/12/354145.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(翻译)JavaEE6规范 CDI教程第四部分</title><link>http://www.blogjava.net/kuuyee/archive/2011/06/28/353291.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Tue, 28 Jun 2011 10:26:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/06/28/353291.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/353291.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/06/28/353291.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/353291.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/353291.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本​部​分​讲​述​@Producer&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/06/28/353291.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/353291.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-06-28 18:26 <a href="http://www.blogjava.net/kuuyee/archive/2011/06/28/353291.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Maven项目常见问题实战(一) 解决相互依赖</title><link>http://www.blogjava.net/kuuyee/archive/2011/06/28/353158.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Tue, 28 Jun 2011 04:40:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/06/28/353158.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/353158.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/06/28/353158.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/353158.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/353158.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 很​多​时​候​随​着​项​目​的​膨​胀​，模​块​会​越​来​越​多​，如​果​设​计​上​ 稍​有​不​慎​就​会​出​现​模​块​之​间​相​互​依​赖​的​情​况​。​这​对​于​使​用​Maven的​用​户​是​比​较​痛​苦​的​，因​为​出​现​模​块​之​间​相​互​依​赖​的​话​在​构​建​的​时​候​就​会​失​败​，Maven通​常​要​先​编​译​被​依​赖​的​模​块​，如​果​出​现​相​互​依​赖​Maven就​不​知​道​该​怎​么​办​了​。​本文讲述如何解决Maven项目间的相互依赖.&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/06/28/353158.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/353158.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-06-28 12:40 <a href="http://www.blogjava.net/kuuyee/archive/2011/06/28/353158.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(翻译)JavaEE6规范 CDI教程第三部分</title><link>http://www.blogjava.net/kuuyee/archive/2011/06/20/352650.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Mon, 20 Jun 2011 03:43:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/06/20/352650.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/352650.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/06/20/352650.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/352650.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/352650.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本​部​分​讲​述​@Alternative和​@Qualfiers&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/06/20/352650.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/352650.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-06-20 11:43 <a href="http://www.blogjava.net/kuuyee/archive/2011/06/20/352650.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(翻译)JavaEE6规范 CDI教程第二部分</title><link>http://www.blogjava.net/kuuyee/archive/2011/06/17/352490.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Fri, 17 Jun 2011 03:10:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/06/17/352490.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/352490.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/06/17/352490.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/352490.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/352490.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 本​部​分​讲​述​@Inject和​@Produces<br>&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/06/17/352490.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/352490.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-06-17 11:10 <a href="http://www.blogjava.net/kuuyee/archive/2011/06/17/352490.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>(翻译)JavaEE6规范 CDI教程第一部分</title><link>http://www.blogjava.net/kuuyee/archive/2011/06/16/352421.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Thu, 16 Jun 2011 06:03:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/06/16/352421.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/352421.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/06/16/352421.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/352421.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/352421.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 此​教​程​讲​述​DI(依​赖​注​入​)，并​且​涵​盖​了​CDI(上​下​文​依​赖​注​入​)的​一​些​特​性​，比​如​类​型​安​全​注​解​配​置​、​替​换​选​择​等​内​容​。​<br>CDI是​依​赖​注​入​(DI)和​拦​截​(AOP)的​Java标​准​规​范​。​DI和​AOP有​着​很​高​的​知​名​度​，Java需​要​处​理​DI和​AOP以​便​在​此​之​上​构​建​其​它​的​标​准​。​DI和​AOP是​很​多​Java框​架​的​基​础​。​<br>CDI是​JavaEE 6的​基​础​。​它​很​快​就​得​到​了​Caucho's Resin、​IBM's WebSphere、​Oracle's Glassfish、​Red Hat's JBoss和​众​多​应​用​服​务​器​的​支​持​。​CDI与​Spring和​Guice框​架​非​常​相​似​，就​像​JPA很​像​ORM。​CDI简​化​了​对​于​DI和​AOP的​API。​如​果​你​使​用​过​Spring或​者​Guice，你​会​发​现​CDI更​容​易&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/06/16/352421.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/352421.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-06-16 14:03 <a href="http://www.blogjava.net/kuuyee/archive/2011/06/16/352421.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ceylon语言介绍第一部分（翻译）——Hibernate之父的又一力作</title><link>http://www.blogjava.net/kuuyee/archive/2011/05/24/350885.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Mon, 23 May 2011 23:25:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/05/24/350885.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/350885.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/05/24/350885.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/350885.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/350885.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Hibernate之父闭关两年后推出的又一力作——JVM语言 Ceylon<br>Ceylon是一门新的语言，它运行在Java虚拟机上，目前正有我所在的小组开发，它隶属于RedHat。我们都是Java和Java生态系统的粉丝，因为它的实用性、广阔的文化氛围和开发社区、天生适用于商业应用以及可移植性。然而我们必须承认这门语言和其现有的类库，已经过了15年的发展，它不能再提供更好的功能来解决现在的商业问题。&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/05/24/350885.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/350885.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-05-24 07:25 <a href="http://www.blogjava.net/kuuyee/archive/2011/05/24/350885.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>XSL入门(翻译)</title><link>http://www.blogjava.net/kuuyee/archive/2011/03/09/345993.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Wed, 09 Mar 2011 00:58:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/03/09/345993.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/345993.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/03/09/345993.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/345993.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/345993.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 最近经常用到Docbook,所以突击一下XSL,<DocBook XSL: The Complete Guide>本书不错,所以翻译了一下XSL的入门部分.<br>XSL是​一​个​模​板​语​言​，而​不​是​一​个​程​序​语​言​。​这​意​味​着​stylesheet制​定​了​一​个​输​出​样​本​，而​不​是​使​用​程​序​按​步​骤​生​成​。​一​个​stylesheet包​含​了​一​个​混​合​的​输​出​样​本​，并​且​为​每​个​样​本​佩​戴​了​输​出​指​令​。​每​一​个​晓​得​输​出​样​本​加​上​处​理​指​令​就​构​成​了​一​个​模​板​。​<br>&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/03/09/345993.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/345993.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-03-09 08:58 <a href="http://www.blogjava.net/kuuyee/archive/2011/03/09/345993.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>装载嵌入式JBoss到Tomat中</title><link>http://www.blogjava.net/kuuyee/archive/2011/03/08/345915.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Tue, 08 Mar 2011 01:19:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/03/08/345915.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/345915.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/03/08/345915.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/345915.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/345915.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 最​近​准​备​研​究​下​Seam框​架​，主​要​是​专​注​一​下​JBPM集​成​部​分​的​内​容​。​由​于​Seam是​Jboss的​产​品​，所​以​官​方​推​荐​使​用​JBoss应​用​服​务​器​。​个​人​认​为​那​东​西​太​大​有​100多​MB，懒​得​下​载​！ 查​看​了​下​Seam文​档​，上​面​说​可​以​使​用​Tomcat+嵌​入​式​JBoss，这​个​比​较​爽​，嵌​入​式​JBoss才​20MB。​下​面​记​录​一​下​配​置​过​程​。​<br>	&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/03/08/345915.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/345915.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-03-08 09:19 <a href="http://www.blogjava.net/kuuyee/archive/2011/03/08/345915.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Jenkins文档翻译(1)-管理</title><link>http://www.blogjava.net/kuuyee/archive/2011/03/07/345864.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Mon, 07 Mar 2011 02:54:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/03/07/345864.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/345864.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/03/07/345864.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/345864.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/345864.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Jenkins官方文档翻译之Jenkins管理.<br>Jenkins需​要​一​些​磁​盘​空​间​来​执​行​构​建​和​归​档​。​你​可​以​在​Jenkins的​配​置​页​面​查​看​磁​盘​所​在​的​路​径​。​默​认​情​况​下​是​~/.jenkins，你​可​以​通​过​如​下​的​方​法​来​改​变​设​置​： &nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/03/07/345864.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/345864.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-03-07 10:54 <a href="http://www.blogjava.net/kuuyee/archive/2011/03/07/345864.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>远程调试Tomcat7下的应用</title><link>http://www.blogjava.net/kuuyee/archive/2010/12/03/339730.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Fri, 03 Dec 2010 09:46:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2010/12/03/339730.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/339730.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2010/12/03/339730.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/339730.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/339730.html</trackback:ping><description><![CDATA[<p>&nbsp;</p><div style="width: 1170px; margin-right: auto; margin-left: auto; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px;"><div style="margin-left: -30px;"><div style="float: left; min-height: 1px; margin-left: 30px; width: 870px;"><div style="background-color: #fcfcfa; border: 1px solid #e2e0d8; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 22px; margin-bottom: 35px;"><h2>远程调试Tomcat7下的应用</h2><div><a href="http://10.128.143.87:4242/2010/12/03/tomcat-remote-debug/author.primary_page.url" style="color: #0088cc; text-decoration: none;">kuuyee&nbsp;</a>&nbsp;|&nbsp; 2010-12-03 &nbsp;|&nbsp;&nbsp;<a href="http://10.128.143.87:4242/2010/12/03/tomcat-remote-debug/tag.primary_page.url" style="color: #ffffff; text-decoration: none; display: inline-block; padding: 2px 4px; font-size: 11.844px; font-weight: bold; line-height: 14px; text-shadow: rgba(0, 0, 0, 0.247059) 0px -1px 0px; white-space: nowrap; vertical-align: baseline; background-color: #999999; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">Tomcat</a>&nbsp;&nbsp;&nbsp;<a href="http://10.128.143.87:4242/2010/12/03/tomcat-remote-debug/tag.primary_page.url" style="color: #ffffff; text-decoration: none; display: inline-block; padding: 2px 4px; font-size: 11.844px; font-weight: bold; line-height: 14px; text-shadow: rgba(0, 0, 0, 0.247059) 0px -1px 0px; white-space: nowrap; vertical-align: baseline; background-color: #999999; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;">debug</a>&nbsp;&nbsp;</div><p style="margin: 0px 0px 10px;"></p><div><p style="margin: 0px 0px 10px;">首先在Tomcat的bin目录下修改catalina.sh,加入JAVA_OPTS参数:</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">JPDA_ADDRESS=20777 JAVA_OPTS='-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=20777'</code></pre></div></div><div><p style="margin: 0px 0px 10px;">其中JPDA_ADDRESS要指定一个没有被占用的端口,如果不指定,默认值是8000</p></div><div><p style="margin: 0px 0px 10px;">然后用下面的方式启动tomcat：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">catalina.sh jpda start</code></pre></div></div><div><p style="margin: 0px 0px 10px;">最后启动Eclipse，选择你想要Debug的类并设置断点，然后选择Debug工具栏下的Debug子菜单(Debug&#8230;)，在弹出的Debug窗口中，在左边的菜单项中选择远程调试(Remote Java Application)，然后输入机器名和端口，比如说192.168.1.1和20777，然后Apply并且开始Debug</p></div><p style="margin: 0px 0px 10px;"></p><div>2010-12-03</div></div></div></div></div><footer style="text-align: center; padding: 20px 0px; margin-top: 20px; border-top-width: 1px; border-top-style: solid; border-top-color: #e5e5e5; background-color: #f5f5f5; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px;"><div style="width: 1170px; margin-right: auto; margin-left: auto;"></div></footer><p>&nbsp;</p><img src ="http://www.blogjava.net/kuuyee/aggbug/339730.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2010-12-03 17:46 <a href="http://www.blogjava.net/kuuyee/archive/2010/12/03/339730.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JDK7 第四个里程碑版本放出（译）</title><link>http://www.blogjava.net/kuuyee/archive/2009/08/04/289693.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Mon, 03 Aug 2009 18:20:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2009/08/04/289693.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/289693.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2009/08/04/289693.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/289693.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/289693.html</trackback:ping><description><![CDATA[原文：http://blogs.sun.com/mr/entry/jdk7_m4<br />
<br />
7月30号Sun放出了JDK7的第4个里程碑版本<a href="http://java.sun.com/javase/downloads/ea.jsp">JDK Milestone 4</a>，Sun计划在2010年2月放出第8个里程碑版本，届时也是最后一个里程碑版本，也就是说我们至少要在2010年3月后才能看到JDK7的最终版本，而且前提是Sun不跳票。<br />
<br />
查看详细的JDK里程碑版本计划请看http://openjdk.java.net/projects/jdk7/milestones/<br />
<br />
这个里程碑版本添加了如下新特性：<br />
<ol>
    <li>
    兼容JDK6u10的新特性：<a href="http://java.sun.com/javase/6/docs/technotes/guides/jweb/applet/applet_dev_guide.html">Java Plug-In</a>技术（主要是针对Applet的）；<a href="http://java.sun.com/javase/6/6u10faq.jsp#JKernel">Java Kernel</a>（精简的JRE）以及<a href="http://java.sun.com/javase/6/docs/technotes/guides/jweb/otherFeatures/jqs.html">Quick Starter</a>(快速启动，据说能把内存使用控制在20MB内)</li>
    <li>
    JSR 308：<a href="http://openjdk.java.net/projects/jdk7/features/#f619">Annotations on Java types</a>,对Java注解语法的扩展，使注解能够用在Java类型上，始而能够检查各种各样的编译时错误（<a href="http://groups.csail.mit.edu/pag/jsr308/current/checkers-manual.html">compile-time
    error checkers</a>）。</li>
</ol>
<br />
计划更新的<a href="http://openjdk.java.net/projects/jdk7/features/#f568">XML stack</a>并没有出现在M4中，我们只能期待M5来兑现了。<br />
<br />
完整的更新列表请看<a href="http://cr.openjdk.java.net/jdk7/m4/changes/">这里</a><img src ="http://www.blogjava.net/kuuyee/aggbug/289693.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2009-08-04 02:20 <a href="http://www.blogjava.net/kuuyee/archive/2009/08/04/289693.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用maven-jdocbook-plugin简单配置docbook5.0环境</title><link>http://www.blogjava.net/kuuyee/archive/2009/07/27/288613.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Mon, 27 Jul 2009 09:24:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2009/07/27/288613.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/288613.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2009/07/27/288613.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/288613.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/288613.html</trackback:ping><description><![CDATA[很多人都说docbook配置环境比较繁琐,今天看了一下docbook5的文档,5.0不再使用旧的SGML DTD，转而使用XML，感觉配置相对容易多了,网上有篇<a href="http://blog.zdnet.com.cn/html/30/422230-2881239.html">文章</a>介绍5.0的编译环境,真的比较简单.不过我今天看了看jboss seam的文档构建过程,构建环境搭建真是简单的不能再简单了,jboss seam使用maven来发布docbook文档,用到了maven-jdocbook-plugin,我把jboss seam的构建提取出来,大家可以参考来方便构建自己的docbook.<br />
<br />
创建一个最最简单的maven空项目,pom.xml内容如下:<br />
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><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 />
</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">project&nbsp;</span><span style="color: #ff0000;">xmlns</span><span style="color: #0000ff;">="http://maven.apache.org/POM/4.0.0"</span><span style="color: #ff0000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xmlns:xsi</span><span style="color: #0000ff;">="http://www.w3.org/2001/XMLSchema-instance"</span><span style="color: #ff0000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xsi:schemaLocation</span><span style="color: #0000ff;">="http://maven.apache.org/POM/4.0.0&nbsp;http://maven.apache.org/xsd/maven-4.0.0.xsd"</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">modelVersion</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">4.0.0</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">modelVersion</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">org.kuuyee</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">first-docbook</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">packaging</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">jar</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">packaging</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">version</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">1.0-SNAPSHOT</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">version</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">name</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">first-docbook</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">name</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">build</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">plugins</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">&lt;!--</span><span style="color: #008000;">&nbsp;the&nbsp;docbook&nbsp;generation&nbsp;plugin&nbsp;for&nbsp;the&nbsp;user&nbsp;guide&nbsp;</span><span style="color: #008000;">--&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">plugin</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">org.jboss.maven.plugins</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">maven-jdocbook-plugin</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">version</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">2.1.1</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">version</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">extensions</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">true</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">extensions</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">dependencies</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">dependency</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">org.jboss</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">jbossorg-docbook-xslt</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">version</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">1.1.0</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">version</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">dependency</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">dependency</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">org.jboss</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">jbossorg-jdocbook-style</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">version</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">1.1.0</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">version</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">type</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">jdocbook-style</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">type</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">dependency</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">dependencies</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">executions</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">execution</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">id</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">tutorial_zh_CN</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">id</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">phase</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">package</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">phase</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">goals</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">goal</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">resources</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">goal</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">goal</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">generate</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">goal</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">goals</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">configuration</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">sourceDocumentName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">master.xml</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">sourceDocumentName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">sourceDirectory</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">${basedir}/src/main/docbook/zh_CN</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">sourceDirectory</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">imageResource</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">directory</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">${basedir}/src/main/docbook/images</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">directory</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">imageResource</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">cssResource</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">directory</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">${basedir}/src/main/docbook/css</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">directory</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">cssResource</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">targetDirectory</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">${basedir}/target/docbook/zh_CN</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">targetDirectory</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">formats</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">format</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">formatName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">pdf</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">formatName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">stylesheetResource</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">classpath:/xslt/org/jboss/pdf.xsl</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">stylesheetResource</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">finalName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">zh_CN.pdf</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">finalName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">format</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">format</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">formatName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">html</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">formatName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">stylesheetResource</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">classpath:/xslt/org/jboss/xhtml.xsl</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">stylesheetResource</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">finalName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">index.html</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">finalName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">format</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">format</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">formatName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">html_single</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">formatName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">stylesheetResource</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">classpath:/xslt/org/jboss/xhtml-single.xsl</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">stylesheetResource</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">finalName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">index.html</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">finalName</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">format</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">formats</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">options</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">xincludeSupported</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">true</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">xincludeSupported</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">options</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">configuration</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">execution</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">executions</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">plugin</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">plugins</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">build</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">&lt;!--</span><span style="color: #008000;">&nbsp;basic&nbsp;JBoss&nbsp;repository&nbsp;so&nbsp;that&nbsp;the&nbsp;common&nbsp;parent&nbsp;POM&nbsp;in&nbsp;jbosscache-support&nbsp;can&nbsp;be&nbsp;found&nbsp;</span><span style="color: #008000;">--&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">repositories</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">repository</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">id</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">snapshots.jboss.org</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">id</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">url</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">http://snapshots.jboss.org/maven2</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">url</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">repository</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">repository</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">id</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">repository.jboss.org</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">id</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">url</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">http://repository.jboss.org/maven2</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">url</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">repository</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">repositories</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">project</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
</span></div>
<br />
在src/main/docbook/zh_CN下新建两个xml文件master.xml,chap1.xml.这里用到了docbook的物理分割概念,就是把单个文档拆分文档为多个文件,这在文档比较巨大的时候很实用.<br />
master.xml是文档主文件,内容如下:<br />
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><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 />
</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">book&nbsp;</span><span style="color: #ff0000;">xmlns</span><span style="color: #0000ff;">="http://docbook.org/ns/docbook"</span><span style="color: #ff0000;">&nbsp;version</span><span style="color: #0000ff;">="5.0"</span><span style="color: #ff0000;">&nbsp;xml:lang</span><span style="color: #0000ff;">="zh-CN"</span><span style="color: #ff0000;">&nbsp;xmlns:xlink</span><span style="color: #0000ff;">="http://www.w3.org/1999/xlink"</span><span style="color: #ff0000;">&nbsp;xmlns:xi</span><span style="color: #0000ff;">="http://www.w3.org/2001/XInclude"</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">title</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">光子的第一本Docbook书</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">title</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">xi:include&nbsp;</span><span style="color: #ff0000;">href</span><span style="color: #0000ff;">="chap1.xml"</span><span style="color: #0000ff;">/&gt;</span><span style="color: #000000;"><br />
</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">book</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
</span></div>
<br />
chap1.xml是文档的第一章,内容如下:<br />
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><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 />
</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">chapter&nbsp;</span><span style="color: #ff0000;">xmlns</span><span style="color: #0000ff;">="http://docbook.org/ns/docbook"</span><span style="color: #ff0000;">&nbsp;version</span><span style="color: #0000ff;">="5.0"</span><span style="color: #ff0000;">&nbsp;xml:lang</span><span style="color: #0000ff;">="zh-CN"</span><span style="color: #ff0000;"><br />
&nbsp;&nbsp;xmlns:xlink</span><span style="color: #0000ff;">="http://www.w3.org/1999/xlink"</span><span style="color: #ff0000;">&nbsp;id</span><span style="color: #0000ff;">="ch1"</span><span style="color: #ff0000;">&nbsp;xmlns:xi</span><span style="color: #0000ff;">="http://www.w3.org/2001/XInclude"</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">title</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">光子的第一篇Docbook&nbsp;5.0文档</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">title</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">section</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">title</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">第一章标题</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">title</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">para</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;这是光子的第一篇Docbook&nbsp;5.0文档，我的BLOG</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">link&nbsp;</span><span style="color: #ff0000;">xlink:href</span><span style="color: #0000ff;">='http://www.blogjava.net/kuuyee/'&gt;光子CI之旅&lt;/link&gt;。<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #ff0000;">&lt;/para</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">section</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">chapter</span><span style="color: #0000ff;">&gt;</span></div>
<br />
ok,我们可以发布文档了,没错!就是这么简单,在项目根目录运行命令<br />
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000;">mvn&nbsp;clean&nbsp;</span><span style="color: #0000ff;">package</span></div>
<br />
如果大家不明白可以下载附件源码看看!样式还是使用jboss的,不过可以自己修改xsl!<br />
<a href="/Files/kuuyee/docbook_sample.zip" title="样例代码">样例代码</a><br />
<br />
贴张图看看生成的文档,呵呵!<br />
<br />
<img alt="" src="http://www.blogjava.net/images/blogjava_net/kuuyee/docbook02.GIF" height="434" width="699" /><br />
<br />
<img alt="" src="http://www.blogjava.net/images/blogjava_net/kuuyee/docbook01.GIF" height="452" width="716" /><br />
<br />
<br /><img src ="http://www.blogjava.net/kuuyee/aggbug/288613.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2009-07-27 17:24 <a href="http://www.blogjava.net/kuuyee/archive/2009/07/27/288613.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>maven-tomcat-plugin试用</title><link>http://www.blogjava.net/kuuyee/archive/2009/07/21/287639.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Tue, 21 Jul 2009 06:13:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2009/07/21/287639.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/287639.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2009/07/21/287639.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/287639.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/287639.html</trackback:ping><description><![CDATA[maven-tomcat-plugin能够方便的部署war应用到本地或远程的tomcat上,废话少说,看代码,下面是带有maven-tomcat-plugin配置的pom.xml<br />
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">properties</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">&lt;!--</span><span style="color: #008000;">&nbsp;Cargo&nbsp;settings&nbsp;</span><span style="color: #008000;">--&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">cargo</span><span style="color: #ff0000;">.container.manager.url</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">http://192.168.1.107/manager</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">cargo.container.manager.url</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">cargo</span><span style="color: #ff0000;">.container.username</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">admin</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">cargo.container.username</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">cargo</span><span style="color: #ff0000;">.container.password</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">123456</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">cargo.container.password</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">cargo</span><span style="color: #ff0000;">.wait</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">false</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">cargo.wait</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">properties</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">build</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">plugins</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">plugin</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">org.codehaus.mojo</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">groupId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">tomcat-maven-plugin</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">artifactId</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">version</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">1.0-beta-1</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">version</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">configuration</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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;">/runes</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">path</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">url</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">${cargo.container.manager.url}</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">url</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">username</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">${cargo.container.username}</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">username</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">password</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">${cargo.container.password}</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">password</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">warDirectory</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">${basedir}/src/main/webapp</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">warDirectory</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">configuration</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">executions</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">execution</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">id</span><span style="color: #0000ff;">&gt;tomcat-</span><span style="color: #000000;">deploy</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">id</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">phase</span><span style="color: #0000ff;">&gt;deploy</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">phase</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">goals</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><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;</span><span style="color: #0000ff;">&lt;</span><span style="color: #800000;">goal</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;">deploy</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">goal</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">goals</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">execution</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">&lt;!--</span><span style="color: #008000;">execution&gt;<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;&lt;id&gt;undeploy&lt;/id&gt;<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;&lt;phase&gt;deploy&lt;/phase&gt;<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;&lt;goals&gt;<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;&lt;goal&gt;start&lt;/goal&gt;<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;&lt;/goals&gt;<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;&lt;/execution</span><span style="color: #008000;">--&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">executions</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">plugin</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">plugins</span><span style="color: #0000ff;">&gt;</span><span style="color: #000000;"><br />
</span><span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">build</span><span style="color: #0000ff;">&gt;</span></div>
maven-tomcat-plugin通过tomcat的manager控制台来deploy或undeploy应用,所以要把你的tomcat的相关信息配置上,包括manager url,用户名及密码等!<img src ="http://www.blogjava.net/kuuyee/aggbug/287639.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2009-07-21 14:13 <a href="http://www.blogjava.net/kuuyee/archive/2009/07/21/287639.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>