??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美日韩一区二区三区四区 ,亚洲第一免费播放区,伊人一区二区三区久久精品http://www.aygfsteel.com/naruke/category/23270.htmlzh-cnWed, 25 Jul 2007 17:29:48 GMTWed, 25 Jul 2007 17:29:48 GMT60SiteMesh qo(h)不装饰的面http://www.aygfsteel.com/naruke/archive/2007/07/25/132335.html扭曲的铅W?/dc:creator>扭曲的铅W?/author>Wed, 25 Jul 2007 08:25:00 GMThttp://www.aygfsteel.com/naruke/archive/2007/07/25/132335.htmlhttp://www.aygfsteel.com/naruke/comments/132335.htmlhttp://www.aygfsteel.com/naruke/archive/2007/07/25/132335.html#Feedback0http://www.aygfsteel.com/naruke/comments/commentRss/132335.htmlhttp://www.aygfsteel.com/naruke/services/trackbacks/132335.html阅读全文

]]>
SiteMesh~码http://www.aygfsteel.com/naruke/archive/2007/06/11/123336.html扭曲的铅W?/dc:creator>扭曲的铅W?/author>Mon, 11 Jun 2007 03:19:00 GMThttp://www.aygfsteel.com/naruke/archive/2007/06/11/123336.htmlhttp://www.aygfsteel.com/naruke/comments/123336.htmlhttp://www.aygfsteel.com/naruke/archive/2007/06/11/123336.html#Feedback0http://www.aygfsteel.com/naruke/comments/commentRss/123336.htmlhttp://www.aygfsteel.com/naruke/services/trackbacks/123336.html阅读全文

]]>
SiteMesh常用标签?/title><link>http://www.aygfsteel.com/naruke/archive/2007/06/11/123334.html</link><dc:creator>扭曲的铅W?/dc:creator><author>扭曲的铅W?/author><pubDate>Mon, 11 Jun 2007 02:58:00 GMT</pubDate><guid>http://www.aygfsteel.com/naruke/archive/2007/06/11/123334.html</guid><wfw:comment>http://www.aygfsteel.com/naruke/comments/123334.html</wfw:comment><comments>http://www.aygfsteel.com/naruke/archive/2007/06/11/123334.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/naruke/comments/commentRss/123334.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/naruke/services/trackbacks/123334.html</trackback:ping><description><![CDATA[     摘要: SiteMesh有两个标{ֺ分别为sitemesh-decorator.tld、sitemesh-page.tld <br>  <a href='http://www.aygfsteel.com/naruke/archive/2007/06/11/123334.html'>阅读全文</a><img src ="http://www.aygfsteel.com/naruke/aggbug/123334.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/naruke/" target="_blank">扭曲的铅W?/a> 2007-06-11 10:58 <a href="http://www.aygfsteel.com/naruke/archive/2007/06/11/123334.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SiteMesh介绍Q{Q?/title><link>http://www.aygfsteel.com/naruke/archive/2007/06/11/123313.html</link><dc:creator>扭曲的铅W?/dc:creator><author>扭曲的铅W?/author><pubDate>Mon, 11 Jun 2007 02:36:00 GMT</pubDate><guid>http://www.aygfsteel.com/naruke/archive/2007/06/11/123313.html</guid><wfw:comment>http://www.aygfsteel.com/naruke/comments/123313.html</wfw:comment><comments>http://www.aygfsteel.com/naruke/archive/2007/06/11/123313.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/naruke/comments/commentRss/123313.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/naruke/services/trackbacks/123313.html</trackback:ping><description><![CDATA[<p>以前我通常使用旧式的方法来建立自己的web应用Q手工排版,仔细使用每一个字节其工作在<strong>Unicode</strong>下,同时使用make文g来适应不同的CPU……</p> <p>或许现在我们可以换一U方式?/p> <p>管我从没有感觉到需要用assembly (CISC or RISC)来徏立web应用Q但也会(x)偶尔觉得我的开发伙伴的工作相当J琐。特别是我发现很多的开发者在痛苦的寻求一U比较好的方式来控制web应用的基本模块:(x)例如那些</p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080">1</span> <img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <span style="COLOR: #000000">头<br></span><span style="COLOR: #008080">2</span> <span style="COLOR: #000000"><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>尾<br></span><span style="COLOR: #008080">3</span> <span style="COLOR: #000000"><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>D?br></span><span style="COLOR: #008080">4</span> <span style="COLOR: #000000"><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>打印面<br></span><span style="COLOR: #008080">5</span> <span style="COLOR: #000000"><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>手持讑֤的轻量面</span> </div> <p>以及(qing)其他更多的问题。到?jin)最后,令h惊异的是大部分h都采用了(jin)落后的includes和复制粘贴方式?/p> <p>Ҏ(gu)l验Q我可以采用?java.net 上开源的servlet qo(h)?SiteMeshn来简单明?jin)ƈ优雅的解册些问题。作ZU替代新的templating语言QXSLTQ或部v(zhn)的面到新的系l的解决Ҏ(gu)Q应用SiteMesh可以相当Ҏ(gu)处理你的面Q这一切只需要普通的HTMLQJSPQservlet(包括Struts)Q以?qing)其他常用的技术?/p> <p><font color=#0000ff><strong>一 Q工作原?/strong> </font><br><br>SiteMesh利用?jin)一U?font color=#0000ff>很少人知道的servlet规范</font>实现?jin)一U页面过滤器。设想一下,现在有一个简单的jsp面用来q回当前的日期和旉。通常q个面h来到应用服务器,面被处理,最后处理结果返回到web览器。SiteMesh作ؓ(f)一个页面过滤器Q在面被处理之后,q回web览器之前,寚w面做?jin)一些附加的操作。这个变化简单描qCؓ(f)图一和图二所C的附加步骤?br><br><img src="http://today.java.net/images/2004/03/sitemesh_fig1.gif"><br><br><img src="http://today.java.net/images/2004/03/sitemesh_fig2.gif"><br><br><font size=1><em>图二QSiteMesh寚w面处理情?/em></font></p> <p>现在看一个简单的例子?/p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">html</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">head</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">title</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">Simple Document</span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">title</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">head</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">body</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        Hello World</span> <span style="COLOR: #000000">!</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">br </span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><%=</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">+</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">%></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">body</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> </span><span style="COLOR: #000000"></</span> <span style="COLOR: #000000">html</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> </span> </div> <p>你会(x)发现q个面有一个title和bodyQ类似普通的HTML面Q。你也会(x)发现一段JSP代码——它?yu)?x)如同你期望的那样被处理。同时你可以使用M你想使用的JSP语法和特性来替换q一段代码?</p> <p>现在来看一个简单的SiteMesh "装饰QdecoratorQ?面。列?昄?jin)一个被SiteMesh调用的JSP面?/p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <span style="COLOR: #000000"><%</span> <span style="COLOR: #000000">@ taglib uri</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">sitemesh-decorator</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> prefix</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">decorator</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">%></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> </span><span style="COLOR: #000000"><</span> <span style="COLOR: #000000">html</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">head</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">title</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>            My Site </span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000"> </span> <strong><span style="COLOR: #000000"><</span> <span style="COLOR: #000000">decorator:title </span> <span style="COLOR: #0000ff">default</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Welcome!</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">/></span> </strong><span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">title</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">decorator:head </span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">head</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">body</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">h1</span> <span style="COLOR: #000000">> <strong><</strong></span> <strong><span style="COLOR: #000000">decorator:title </span> <span style="COLOR: #0000ff">default</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Welcome!</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> </strong><span style="COLOR: #000000"><strong>/></strong> </</span> <span style="COLOR: #000000">h1</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">p</span> <span style="COLOR: #000000">> <strong><</strong></span> <strong><span style="COLOR: #000000">decorator:body </span> </strong><span style="COLOR: #000000"><strong>/></strong> </</span> <span style="COLOR: #000000">p</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">p</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>            </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">small</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>                (</span> <strong><span style="COLOR: #000000"><</span> <span style="COLOR: #000000">a href</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/?printable=true</span> </strong><span style="COLOR: #000000">"</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">printable version</span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">a</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">)<br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>            </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">small</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">p</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">body</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> </span><span style="COLOR: #000000"></</span> <span style="COLOR: #000000">html</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> </span> </div> <p>查看q个装饰器(decoratorQ,我们能看C些有的东西。首先,在第一行申明了(jin)一个SiteMesh标签库。这个标{ֺ包含?jin)与原始面一起工作时所需的所有东ѝ你能看到我们用了(jin)两个SiteMesh的装饰标{(declared tagsQ, </p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 12pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #008080">1</span> <img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">decorator:title</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br></span><span style="COLOR: #008080">2</span> <span style="COLOR: #000000"><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> </span><span style="COLOR: #000000"><</span> <span style="COLOR: #000000">decorator:body</span> <span style="COLOR: #000000">></span> </div> <p> 不要惊讶于标{?lt;decorator:title>在原始页面中昄<title>标签中的内容Q?<decorator:body> 中的内容也是如此。我们在q个面的HEAD和BODY元素都用了(jin)同一个title标签,同时Q我们还增加?jin)一个到可打印版本页面的链接?/p> <p>作ؓ(f)对照Q图三显CZ(jin)原始处理面Q图四显CZ(jin)被修饰过的处理页面。留意被装饰面在浏览器H口昄的标题文字和HTML内容。同时也可以看到增加?jin)一个可打印面的链接——这个我们回头再说?</p> <p><img src="http://today.java.net/images/2004/03/sitemesh_fig3.gif"> <br><em><font size=1>图三Q原始未修饰面<br></font><br><img src="http://today.java.net/images/2004/03/sitemesh_fig4.gif"> <br></em><br><font size=1>囑֛Q被修饰面</font> </p> <p>很明显,Ҏ(gu)起用include </p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <span style="COLOR: #000000">例如</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">jsp:include page</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">foo.jsp</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> flush</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">true</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">/></span> </div> <p>来说Q以q样的方式用页头、页l结构要清晰得多。这U方式更易移植、更易理解,同时也鼓׃(jin)JSP面不再使用D或其他类似的表现层代码。我发现在JSP面中用装饰器和CSS的组合比标准HTML的标{更Ҏ(gu)去除格式信息?/p> <p><font color=#0000ff><strong>?Q?安装SiteMesh</strong> </font><br><br>注意下面的屏q截图是ZWindows XP ProfessionalQ?Tomcat 5.0.19Q和Java 2 SDK 1.4.2_03的环境之上的。在q里我假定你的Tomcat已经安装完毕q且可以正常工作?jin)。你或许?x)有一些؜淆,但我们已l成功地在Tomcat 4.1 ?WebLogic 试q,同时 SiteMesh 也支持大部分的web应用服务器?</p> <p>本文描述的SiteMesh 2.0.1可以?下蝲到?在java.net 上SiteMesh's 的项目库中有四个文g可以下蝲。sitemesh-2.0.1.jar 是其核心(j) JAR 文gQ?sitemesh-2.0.1-sources.zip 的作用正如同其名字所qͼ sitemesh-example.war 则提供了(jin)一个复杂的例子用来昄一些SiteMesh的高U特性?/p> <p>Z(jin)使描q更加简单,我们从sitemesh-blank.war 文g开始。将该WAR文g攑օTomcat 的webapps 目录QW(xu)AR包将自动解压昄内容QSoSo注:(x)q里的前提是你的tomcat已经开始工作)(j)Q如图五所C?/p> <p><img src="http://today.java.net/images/2004/03/sitemesh_fig5.gif"> <br><br><em><font size=1>图五Q?SiteMesh_blank.WAR解开后的内容</font> </em></p> <p>我们q旉描述一下这些文件的作用?/p> <p><strong>1  :  web.xml </strong></p> <p>首先Q?em>WEB-INF/web.xml</em> 文g昄如列?Q这些语句用来安装SiteMesh qo(h)器和标签库。如果你军_在一个已有的Web应用中用SiteMeshQ你必须把这些语句添加到你的<em>WEB-INF/web.xml</em> 文g中?/p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <span style="COLOR: #000000"><?</span> <span style="COLOR: #000000">xml version</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">1.0</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> encoding</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">ISO-8859-1</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">?></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> </span><span style="COLOR: #000000"><!</span> <span style="COLOR: #000000">DOCTYPE web</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">app PUBLIC </span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top></span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">http://java.sun.com/dtd/web-app_2_3.dtd</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top></span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">web</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">app</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">filter</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">filter</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">name</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">sitemesh</span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">filter</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">name</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">filter</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">com.opensymphony.module.sitemesh.filter.PageFilter</span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">filter</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">filter</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">filter</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">mapping</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">filter</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">name</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">sitemesh</span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">filter</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">name</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>       <strong> </strong></span> <strong><span style="COLOR: #000000"><</span> <span style="COLOR: #000000">url</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">pattern</span> <span style="COLOR: #000000">>*</span> <span style="COLOR: #000000">.jsp</span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">url</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">pattern</span> <span style="COLOR: #000000">></span> </strong><span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">filter</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">mapping</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">uri</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">sitemesh</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">page</span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">uri</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">location</span> <span style="COLOR: #000000">>/</span> <span style="COLOR: #000000">WEB</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">INF</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">sitemesh</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">page.tld</span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">location</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">uri</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">sitemesh</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">decorator</span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">uri</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">location</span> <span style="COLOR: #000000">>/</span> <span style="COLOR: #000000">WEB</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">INF</span> <span style="COLOR: #000000">/</span> <span style="COLOR: #000000">sitemesh</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">decorator.tld</span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">location</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">taglib</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top></span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">web</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">app</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> </span> </div> <p>注意Q这里需要注意一下url-pattern的写?- 如果使用的是Tomcat 5Q而不?Tomcat 4 Q,需要将默认?修改?.jsp的Ş式。最新的servlet规范不再支持*样式?/p> <p><strong>2 : decorators.xml</strong> </p> <p><em>WEB-INF/decorators.xml</em> 文g用来一个装饰器名字同一个专门的JSP装饰文gl定</p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">decorators defaultdir</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/decorators</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">decorator name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">main</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> page</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">main.jsp</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">pattern</span> <span style="COLOR: #000000">>*</</span> <span style="COLOR: #000000">pattern</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">decorator</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">decorator name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">panel</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> page</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">panel.jsp</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">decorator name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">printable</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> page</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">printable.jsp</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> </span><span style="COLOR: #000000"></</span> <span style="COLOR: #000000">decorators</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> </span> </div> <p>正如我们在代码列表里看到的一P我们定义?jin)三个装饰器Q他们分别绑定了(jin)三个cM的JSP面。我们可以看C个默认装饰器Qmain.jspQ,它将被默认运用于所有文件?/p> <p>2.1  :   ~省的,SiteMesh使用下面的逻辑来选择使用哪一个装饰器Q?/p> <p> </p> <p>q个逻辑?em>sitemesh-2.0.1.jar</em> 包的 <em>\com\opensymphony\module\sitemesh\factor\sitemesh-default.xml</em> 文g里被描述?br><br><font size=1>sitemesh-default.xml  : <br><br></font></p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 10pt; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">sitemesh</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">property name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">decorators-file</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> value</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/WEB-INF/decorators.xml</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">excludes file</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">${decorators-file}</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> <br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">page</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">parsers</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">parser content</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">type</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">text/html</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">com.opensymphony.module.sitemesh.parser.FastPageParser</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">page</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">parsers</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">decorator</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">mappers</span> <span style="COLOR: #000000">><br></span><span style="COLOR: #000000"><br>            //面是否使用meta装饰器标{(meta decorator tagQ特别指定了(jin)一个装饰器Q?br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">mapper </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">com.opensymphony.module.sitemesh.mapper.PageDecoratorMapper</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>            </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">param name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">property.1</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> value</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">meta.decorator</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>            </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">param name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">property.2</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> value</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">decorator</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">mapper</span> <span style="COLOR: #000000">><br></span><span style="COLOR: #000000"><br>            //面是否是一个框枉Q是的话则不应用装饰器)(j)Q?<br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">mapper </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">com.opensymphony.module.sitemesh.mapper.FrameSetDecoratorMapper</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/><br></span><span style="COLOR: #000000"><br>            //面是否使用?jin)printable=true 参数Q是的话则用打印装饰器Q?br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">mapper </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">com.opensymphony.module.sitemesh.mapper.PrintableDecoratorMapper</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>            </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">param name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">decorator</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> value</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">printable</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>            </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">param name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">parameter.name</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> value</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">printable</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>            </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">param name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">parameter.value</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> value</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">true</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">mapper</span> <span style="COLOR: #000000">><br></span><span style="COLOR: #000000"><br>            //面时候用装饰器文g名特别指定了(jin)一个装饰器<br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">mapper </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">com.opensymphony.module.sitemesh.mapper.FileDecoratorMapper</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/><br></span><span style="COLOR: #000000"><br>            //面是否匚w <em>decorators.xml</em> 文g里描q的样式Q?br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">mapper </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">com.opensymphony.module.sitemesh.mapper.ConfigDecoratorMapper</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>            </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">param name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">config</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> value</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">${decorators-file}</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>        </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">mapper</span> <span style="COLOR: #000000">><br></span><span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top>    </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">decorator</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">mappers</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"><br><img src="http://www.aygfsteel.com/Images/OutliningIndicators/None.gif" align=top> </span><span style="COLOR: #000000"></</span> <span style="COLOR: #000000">sitemesh</span> <span style="COLOR: #000000">></span> </div> <p><br>你可以针对诸如:(x)客户端操作系l,web览器,用户代理{在<em>WEB-INF\sitemesh.xml</em>文g里,通过一个变量覆盖这个行? 可以?em>sitemesh-example.war</em> 扑ֈ例子?</p> <p>通常W一条规则仅用来定该装饰器是否被用(Conceptually, the first rule that evaluates to true determines the decorator that is used. Q在上面的例子中Q当出现printable=true 参数的时候,装饰器printable.jsp Q规?#3Q替代了(jin) main.jsp Q规?#5Q。在SiteMesh中,q些规则被描qCؓ(f) <em>mappers?/em></p> <p><strong>3 :  decorators/*.jsp</strong> </p> <p>q三个decorators目录下的文g?em>decorators.xml</em>文g中描q的不同装饰器JSP文g。上面是一个简单的装饰器例子,在后面我们将讨论更复杂的CZ?/p> <p><strong><br>4 :  sitemesh-2.0.1.jar</strong> </p> <p>q是SiteMesh最主要的二q制文gQ通常被安装在 <em>WEB-INF/lib</em> 目录下。可以在<a ><font color=#004377>www.opensymphony.com/sitemesh/api</font></a> 扑ֈq个库的javadoc?/p> <p><em>*.tld</em> </p> <p>SiteMesh使用两个标签库,但大多数人都只需?em>sitemesh-decorator.tld</em>。还有一个是 Qsitemesh-page.tld 你可以在 <a ><font color=#004377>www.opensymphony.com/sitemesh/tags.html</font></a> 扑ֈ相应的文档。我们已l讲qC(jin)最主要的标{:(x)headQtitle和body。在下一章我们来讨论剩下的标{:(x)getProperty?/p> <img src ="http://www.aygfsteel.com/naruke/aggbug/123313.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/naruke/" target="_blank">扭曲的铅W?/a> 2007-06-11 10:36 <a href="http://www.aygfsteel.com/naruke/archive/2007/06/11/123313.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> վ֩ģ壺 <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ξ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">뵺</a>| <a href="http://" target="_blank">ˮ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ɳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">¡</a>| <a href="http://" target="_blank">ʯ</a>| <a href="http://" target="_blank">³</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">˶</a>| <a href="http://" target="_blank">ν</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">°</a>| <a href="http://" target="_blank">ƽ</a>| <a href="http://" target="_blank">ͼľ</a>| <a href="http://" target="_blank">ѳ</a>| <a href="http://" target="_blank">³</a>| <a href="http://" target="_blank">ͩ</a>| <a href="http://" target="_blank">ɳ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">㺺</a>| <a href="http://" target="_blank">ҵ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank">ͬ</a>| <a href="http://" target="_blank"></a>| <a href="http://" target="_blank"></a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>