﻿<?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-Jelver'Sky-文章分类-Tapestry</title><link>http://www.blogjava.net/jelver/category/7669.html</link><description>“一直很多人说我是天才，但我却相信这个世界没有天才。如果没有卓越的努力和娴熟的球性，你永远不会踢出精彩的足球。我从3岁开始踢球，7岁进入格雷米奥少年队开始接受系统训练，至今为止已经踢了20年的球。如果你认为这纯粹是天才，那为什么我14岁时没有现在这种天才呢？我从来不会低估努力的重要性，而这正是我对自己的要求。”
---------罗纳尔迪尼奥(Ronaldinho)</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 20:26:26 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 20:26:26 GMT</pubDate><ttl>60</ttl><item><title>Tapestry总架构</title><link>http://www.blogjava.net/jelver/articles/34771.html</link><dc:creator>冰河快狼</dc:creator><author>冰河快狼</author><pubDate>Sat, 11 Mar 2006 00:50:00 GMT</pubDate><guid>http://www.blogjava.net/jelver/articles/34771.html</guid><wfw:comment>http://www.blogjava.net/jelver/comments/34771.html</wfw:comment><comments>http://www.blogjava.net/jelver/articles/34771.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/jelver/comments/commentRss/34771.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/jelver/services/trackbacks/34771.html</trackback:ping><description><![CDATA[<DIV class=node>原文：<A href="http://bilang.rocklv.net/Tapestry.html">http://bilang.rocklv.net/Tapestry.html</A><BR><IMG class=hideshow id=imgN65543 onclick='toggle("N65543")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_656091790FM></A>Tapestry 
<DIV class=content id=N65543>
<DIV class=node><IMG class=hideshow id=imgN65549 onclick='toggle("N65549")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_86015472FM></A>开发调试 
<DIV class=content id=N65549>
<DIV class=node><IMG class=hideshow id=imgN65556 onclick='toggle("N65556")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1967306874FM></A>禁止缓存参数 
<DIV class=content id=N65556>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_44050682FM></A>-Dorg.apache.tapestry.disable-caching=true -Dorg.apache.tapestry.enable-reset-service=true </DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65569 onclick='toggle("N65569")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1189993318FM></A>调试参数 
<DIV class=content id=N65569>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1273604967FM></A>set JAVA_OPTS="-Dorg.apache.tapestry.disable-caching=true" set JPDA_ADDRESS=8000 set JPDA_TRANSPORT=dt_socket catalina jpda start</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65583 onclick='toggle("N65583")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_272358071FM></A>表单验证 
<DIV class=content id=N65583>
<DIV class=node><IMG class=hideshow id=imgN65590 onclick='toggle("N65590")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1571902157FM></A>delegate 
<DIV class=content id=N65590>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_34817953FM></A>方案1：打印出错信息需要new一个ValidationDelegate。</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_516741943FM></A>方案2：.page文件中配置&lt;bean&gt;标签</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_771700785FM></A>方案3：.page中不配置&lt;bean&gt;，抽象方法上使用元数据@Bean</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65615 onclick='toggle("N65615")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1865860326FM></A>validators 
<DIV class=content id=N65615>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1335279814FM></A>.page文件中每个需要验证的表单元素组件绑定一个validators</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_112953387FM></A>表达式：validators:+判断条件+[错误提示]</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65634 onclick='toggle("N65634")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_495280474FM></A>空输入问题 
<DIV class=content id=N65634>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_570899651FM></A>t4默认空都可以验证通过</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1748807316FM></A>通过[value="validators:required"]来保证输入不为空</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1214793620FM></A>Fieldlable可以与TextField绑定显示错误信息</DIV>
<DIV class=node><IMG class=hideshow id=imgN65659 onclick='toggle("N65659")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1715894989FM></A>客户端验证 
<DIV class=content id=N65659>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_668257938FM></A>在Form组件中绑定&lt;binding name="clientValidationEnabled" value="true"/&gt;</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65672 onclick='toggle("N65672")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_221698144FM></A>若表单输入验证正确，逻辑上的验证应该在监听方法中进行 
<DIV class=content id=N65672>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_287107441FM></A>例如：苹果库存只有20，用户买进50，这是非法的</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1969034272FM></A>验证时应向ValidationDelegate记录出错信息</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65691 onclick='toggle("N65691")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1022920618FM></A>创建delegate 
<DIV class=content id=N65691>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_752260607FM></A>delegate.setFormComponent((IFormComponent) getComponent("XXX")); </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1327093143FM></A>delegate.recordFieldInputValue(Integer.toString(XXXX)); </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_215368946FM></A>delegate.record("XXX must be &gt;=0",ValidationConstraint.TOO_SMALL);</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65717 onclick='toggle("N65717")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><IMG alt=idea src="http://bilang.rocklv.net/imgs/icons/idea.png"><A id=FMFreemind_Link_678131755FM></A>组件复用 
<DIV class=content id=N65717>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1577818169FM></A>t4中一个组件不能用两次，即一个jwcid不能在.html中重复出现</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_861524045FM></A>解决方案：组件重命名。&lt;compoment id="rename" copy-of="name"&gt;</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_139506972FM></A>“@Class@XXX”表示访问一个class的XXX静态方法或静态变量. 其中Class为完整路径（既包括包名）</DIV>
<DIV class=node><IMG class=hideshow id=imgN65747 onclick='toggle("N65747")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_834935443FM></A>判断按钮是否clicked三种方式 
<DIV class=content id=N65747>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><IMG alt=full-1 src="http://bilang.rocklv.net/imgs/icons/full-1.png"><A id=FMFreemind_Link_1168494920FM></A>对每个button使用一个Form组件</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><IMG alt=full-2 src="http://bilang.rocklv.net/imgs/icons/full-2.png"><A id=FMFreemind_Link_1295678732FM></A>给每个button添加一个“tag”，通过tag值判断which按钮be clicked</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><IMG alt=full-3 src="http://bilang.rocklv.net/imgs/icons/full-3.png"><A id=FMFreemind_Link_1637914540FM></A>为每个button添加一个listener（简单、面向对象，推荐使用）</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65785 onclick='toggle("N65785")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><IMG alt=idea src="http://bilang.rocklv.net/imgs/icons/idea.png"><A id=FMFreemind_Link_1581448524FM></A>submit提交原理 
<DIV class=content id=N65785>
<DIV class=node><IMG class=hideshow id=imgN65795 onclick='toggle("N65795")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1900552477FM></A>监听方法获得参数的方式 
<DIV class=content id=N65795>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1715107495FM></A>1、实现IRequestCycle会的监听方法的参数</DIV>
<DIV class=node><IMG class=hideshow id=imgN65807 onclick='toggle("N65807")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_237279891FM></A>2、声明带正确参数顺序的监听方法，t4自动boxing 
<DIV class=content id=N65807>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1191794556FM></A>* public type method(parameters) </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_449046097FM></A>* public type method(IRequestCycle cycle, parameters)</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1312144373FM></A> * public type method() </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1442889653FM></A>* public type method(IRequestCycle cycle) </DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65838 onclick='toggle("N65838")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_524342319FM></A>3、实现提交后转页 
<DIV class=content id=N65838>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_785350227FM></A>public void listener(IRequestCycle cycle) { return cycle.active("PageName");}</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1334927253FM></A>public String listener(IRequestCycle cycle) {return "PageName";}</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_496890871FM></A>public IPage Listener(IRequestCycle cycle) {return (IPage)pageName;}</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1059249648FM></A>页面提交后，t4会从页面pool重新获得或创建page object。因此提交前后同一页面的页面对象引用是不一样的，实例变量可能会一样也不可能一样。</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><IMG alt=button_ok src="http://bilang.rocklv.net/imgs/icons/button_ok.png"><A id=FMFreemind_Link_1229433715FM></A>因此不要在页面对象在定义成员变量（包括页面组件对应的成员变量），因为跨页面访问他们总是无效的有潜在危险。</DIV>
<DIV class=node><IMG class=hideshow id=imgN65880 onclick='toggle("N65880")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_235176810FM></A>上面问题的解决方案 
<DIV class=content id=N65880>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_211058946FM></A>1、使用客户端持久化需要访问的持久化成员变量，声明get、set抽象方法，用@Persist("client")注释。 使用时应判断get方法是否为null，因为这种持久化方式不会初始化变量</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_341559665FM></A>2、使用抽象get、set方法，由t4来实现。</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65900 onclick='toggle("N65900")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_731773306FM></A>HiveMind模块 
<DIV class=content id=N65900>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_819723297FM></A>session对象可以在hivemodule.xml中配置</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1396404390FM></A>hivemodule.xml存放于WEB-INF/classes/META-INF 目录下。或.jar文件的META-INF目录下</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_882648187FM></A>hivemodule.xml每个模块的id必须唯一，一般以模块包名作为id</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65926 onclick='toggle("N65926")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><IMG alt=idea src="http://bilang.rocklv.net/imgs/icons/idea.png"><A id=FMFreemind_Link_1488105950FM></A>session 
<DIV class=content id=N65926>
<DIV class=node><IMG class=hideshow id=imgN65936 onclick='toggle("N65936")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_835284251FM></A>获得方式 
<DIV class=content id=N65936>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_638173696FM></A>1、声明抽象方法，通过元数据injectState("ObjectName")注释</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_214232089FM></A>2、声明抽象方法，在.page中&lt;inject&gt;对象</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65955 onclick='toggle("N65955")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1513533039FM></A>判断存在方式 
<DIV class=content id=N65955>
<DIV class=node><IMG class=hideshow id=imgN65961 onclick='toggle("N65961")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1640909210FM></A>annotation 
<DIV class=content id=N65961>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1136900078FM></A>1、声明抽象方法，该方法命名格式为getXXX()或者isXXX()</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1001394476FM></A>2、使用元数据注释@InjectStateFlag("sessionObj")</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_883348447FM></A>.page声明&lt;inject type="state-flag" property="userExists" object="sessionObj"/&gt;</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_590429493FM></A>注销：使用Servicelink组件的restart service。该service删除sessionObj，并且从定向到首页。</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN65994 onclick='toggle("N65994")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_462259468FM></A>安全处理 
<DIV class=content id=N65994>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1865202687FM></A>1、关键性页面应该在页面中进行用户验证，防止匿名用户访问。页面对象实现PageValidateListener接口。</DIV>
<DIV class=node><IMG class=hideshow id=imgN66007 onclick='toggle("N66007")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1737409985FM></A>2、htmlA-〉login-〉htmlA方式解决方案 
<DIV class=content id=N66007>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_41728131FM></A>该页面类实现IExternalPage，该接口可接受参数</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66021 onclick='toggle("N66021")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1453303334FM></A>参数维护 
<DIV class=content id=N66021>
<DIV class=node><IMG class=hideshow id=imgN66028 onclick='toggle("N66028")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><IMG alt=idea src="http://bilang.rocklv.net/imgs/icons/idea.png"><A id=FMFreemind_Link_522121556FM></A>客户端保存参数（推荐） 
<DIV class=content id=N66028>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_716257629FM></A>1、使用Hidden组件，并提供该属的get、set方法实现</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_247181051FM></A>2、使用元数据@Persist("client")，不能够声明abstract的set、get方法</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_100756126FM></A>session保存参数</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66057 onclick='toggle("N66057")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1864936680FM></A>snippets 
<DIV class=content id=N66057>
<DIV class=node><IMG class=hideshow id=imgN66064 onclick='toggle("N66064")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1474765656FM></A>默认表达式 
<DIV class=content id=N66064>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1676313564FM></A>.html中为literal</DIV>
<DIV class=node><IMG class=hideshow id=imgN66076 onclick='toggle("N66076")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1959223048FM></A>.page中为OGNL 
<DIV class=content id=N66076>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_211276309FM></A>property access</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_337942847FM></A>mathematical expressions </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_145712835FM></A>method invocations</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1437567259FM></A>reference static fields of public classes</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_66229247FM></A>create new objects, including lists and maps</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1598167819FM></A>URL中的sp，t3叫服务参数、t4叫监听参数</DIV>
<DIV class=node><IMG class=hideshow id=imgN66120 onclick='toggle("N66120")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1990607001FM></A>page对象查询 
<DIV class=content id=N66120>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_655228135FM></A>1、.page中声明</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_33180414FM></A>2、在.application声明org.apache.tapestry.page-class-packages中查找(推荐)</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66139 onclick='toggle("N66139")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_645791292FM></A>特殊页面组件 
<DIV class=content id=N66139>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1843451851FM></A>1、$remove$，删除该html元素（即仅去掉某元素）</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1932480774FM></A>2、$content$，只生成该元素标签间的的html code， 该元素以外其它元素忽略去掉（即仅保留某元素标签内的内容）</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><IMG alt=idea src="http://bilang.rocklv.net/imgs/icons/idea.png"><A id=FMFreemind_Link_1723184324FM></A>t4通过无参的构造器来创建对象</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66169 onclick='toggle("N66169")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1683234198FM></A>国际化 
<DIV class=content id=N66169>
<DIV class=node><IMG class=hideshow id=imgN66176 onclick='toggle("N66176")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1076609236FM></A>html中使用技巧 
<DIV class=content id=N66176>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1333861919FM></A>1、&lt;span key="hello"&gt;Hello&lt;/span&gt;指名说用字典key</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1753798441FM></A>2、必须为&lt;span&gt;标签，且key自不必加前缀（如message：，OGNL：）</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_439186165FM></A>3、组件需要国际化，组件的参数（具体看文档）使用“massage:key”表达式。</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_328179240FM></A>不同地区的页面风格，以XXX_CN.html这种方式命名</DIV>
<DIV class=node><IMG class=hideshow id=imgN66207 onclick='toggle("N66207")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1504394366FM></A>字典文件 
<DIV class=content id=N66207>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1461448554FM></A>1、每个page可以拥有一个poperties</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_2441937FM></A>2、在WEB-INF下建立${servletname}.properties，所有page共享</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66227 onclick='toggle("N66227")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1693725711FM></A>自定义组件 
<DIV class=content id=N66227>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_340226015FM></A>组件配置.jwc文件推荐最合理是放在WEB-INF下</DIV>
<DIV class=node><IMG class=hideshow id=imgN66240 onclick='toggle("N66240")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_89091592FM></A>contrib中的控件的使用 
<DIV class=content id=N66240>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_505150586FM></A>&lt;library id="contrib" specification-path="/org/apache/tapestry/contrib/Contrib.library"/&gt;</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66253 onclick='toggle("N66253")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1130921422FM></A>input校验 
<DIV class=content id=N66253>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_954395760FM></A>推荐使用writer.beginEmpty("input")</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1060635857FM></A>使用writer.begin("input")和writer.end()</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66272 onclick='toggle("N66272")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1880689599FM></A>rewinding（重绕），可以理解为刷新 
<DIV class=content id=N66272>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1757161094FM></A>form.isRewinding()</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_727684691FM></A>cycle.isRewinding()</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66291 onclick='toggle("N66291")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1254550449FM></A>参数 
<DIV class=content id=N66291>
<DIV class=node><IMG class=hideshow id=imgN66297 onclick='toggle("N66297")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1524114659FM></A>组件参数初始化 
<DIV class=content id=N66297>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1573609532FM></A>.jwc中&lt;parameter&gt;设置初始化</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1581829947FM></A>finishLoad()方法中初始化</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66316 onclick='toggle("N66316")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_845206655FM></A>参数类型 
<DIV class=content id=N66316>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_74925449FM></A>formal：是被定义在组件规范中的组件参数。每个formal parameter有一个特定（区分大小写）的名称，并且被标为required或者optional。</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_772074322FM></A>informa：是Html元素的属性参数。（支持ognl表达式）</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1476775654FM></A>名字唯一，且通过抽象set、get方法访问</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66342 onclick='toggle("N66342")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_660351734FM></A>两种自定义组件方式 
<DIV class=content id=N66342>
<DIV class=node><IMG class=hideshow id=imgN66348 onclick='toggle("N66348")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1314121391FM></A>1、使用模版 
<DIV class=content id=N66348>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1219102994FM></A>其类应继承自BaseComponent</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66361 onclick='toggle("N66361")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_21867656FM></A>2、使用java code render（无模版） 
<DIV class=content id=N66361>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1436891762FM></A>其类应继承自AbstractComponent实现renderComponent()</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1583315501FM></A>在renderComponent()中应合理调用renderInformalParameters() 、 renderBody()等，来render组件标签的informal参数 和body。</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1539321709FM></A>在renderComponent()中设置属性，应检查该属性参数是否绑定if (isParameterBound("title"))writer.attribute("title", getTitle());</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66387 onclick='toggle("N66387")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_391390206FM></A>.jwc应指明的5个特征 
<DIV class=content id=N66387>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1695614560FM></A>1、组件类（无，这表明已在.library中申明）</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_51131391FM></A>2、该组件是否能使用body（必须） </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1879037770FM></A>3、参数的名称和类型</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1645582254FM></A>4、是否允许informal参数（必须）</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_655906746FM></A>5、保留参数（即informal参数不能用的参数名）</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66424 onclick='toggle("N66424")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_889616030FM></A>引用组件方式 
<DIV class=content id=N66424>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1963641612FM></A>1.在html总使用“@XXX” </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_187797729FM></A>2、在.page或.jwc中使用&lt;component&gt;将组件类型和jwcid绑定</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66443 onclick='toggle("N66443")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1079690995FM></A>组件.jwc查询先后路径 
<DIV class=content id=N66443>
<DIV class=node><IMG class=hideshow id=imgN66449 onclick='toggle("N66449")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_906891781FM></A>1、.application的&lt;component-type&gt;指定的路径 
<DIV class=content id=N66449>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1565808364FM></A>适合无模板组件</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66462 onclick='toggle("N66462")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_898266264FM></A>2、.application所在文件夹，一般就是WEB-INF（推荐，无须配置） 
<DIV class=content id=N66462>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1812653315FM></A>适合所有组件</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66476 onclick='toggle("N66476")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_721405891FM></A>3、WEB-INF下的t4的servlet-name文件夹（无须配置） 
<DIV class=content id=N66476>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1020371607FM></A>若在servlet-name文件夹，适合所有组件</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_946536761FM></A>若在servlet-name文件夹的子文件夹，仅适合无模板组件</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66495 onclick='toggle("N66495")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_574497089FM></A>4、context的根目录（无须配置） 
<DIV class=content id=N66495>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_548540250FM></A>适合所有组件</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66509 onclick='toggle("N66509")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1287724121FM></A>组件.html查询路径（与.jwc同一目录） 
<DIV class=content id=N66509>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_96688143FM></A>1、WEB-INF目录</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_683257778FM></A>2、context根目录</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66528 onclick='toggle("N66528")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1340542093FM></A>如何使用组件库 
<DIV class=content id=N66528>
<DIV class=node><IMG class=hideshow id=imgN66534 onclick='toggle("N66534")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1085796272FM></A>通过library引用 
<DIV class=content id=N66534>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_343981280FM></A>1、.application的&lt;library&gt;指明.library“相对”于.application的路径，以及libID。例如classes/com/aaa/bbb/XXX.library</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_61114006FM></A>2、.library中指明组件类的包名 &lt;meta key="org.apache.tapestry.component-class-packages" value="aa.bb.cc"/&gt;</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1831564999FM></A>3、.library的&lt;component-type&gt;指明.jwc“相对”于.library的路径，以及设置组件类型XXX(即组件别名);若.jwc，.library作同一目录跳过此步骤(默认为.jwc文件名).</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1925283433FM></A>4、在html通过@libID:XXX调用，在.page中通过&lt;component id="box" type="libID:XXX"/&gt;</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66565 onclick='toggle("N66565")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_247450324FM></A>通过application引用 
<DIV class=content id=N66565>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1643692803FM></A>1、.application中&lt;component-type〉指明.jwc“相对”于.application的路径，以及设置组件类型XXX(即组件别名);</DIV></DIV></DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66580 onclick='toggle("N66580")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1704458754FM></A>页面 
<DIV class=content id=N66580>
<DIV class=node><IMG class=hideshow id=imgN66587 onclick='toggle("N66587")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1005828FM></A>页面html模版 
<DIV class=content id=N66587>
<DIV class=node><IMG class=hideshow id=imgN66593 onclick='toggle("N66593")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1960201985FM></A>搜索路径 
<DIV class=content id=N66593>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_315535602FM></A>1、.page同一目录</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1283386235FM></A>2、context根目录</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66613 onclick='toggle("N66613")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_829379430FM></A>页面配置 
<DIV class=content id=N66613>
<DIV class=node><IMG class=hideshow id=imgN66619 onclick='toggle("N66619")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1000537971FM></A>绑定方式 
<DIV class=content id=N66619>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_493804923FM></A>1、静态绑定：即只读，绑定的值在组件规范中指定</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1104865714FM></A>2、动态绑定：组件需要的时候，动态绑定通过其指定的JavaBean获得值</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66639 onclick='toggle("N66639")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_665573448FM></A>页面对象 
<DIV class=content id=N66639>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FM_FM></A>在page文件中声明属性，可以不必在java文件中声明以及其get、set方法</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1904138565FM></A>t4默认getXXX()抽象方法中的XXX为页面属性，.page不用声明，并使用@InitialValue("value")赋初值.</DIV>
<DIV class=node><IMG class=hideshow id=imgN66657 onclick='toggle("N66657")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_286254482FM></A>页面对象实例会被缓存（有潜在非法访问问题），解决方法： 
<DIV class=content id=N66657>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_539111708FM></A>覆盖initialize()方法，初始化实例变量。（在放入缓存池时天会调用initialize()）</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_2957178FM></A>在.page中声明实例变量,.java声明get\set方法(可有可无)，t4自动生成代码初始化</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_378369181FM></A>实现PageBeginRenderListener接口，在页面render之前初始化参数，可防止空指针异常</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66682 onclick='toggle("N66682")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1028630923FM></A>获得转页页面对象 
<DIV class=content id=N66682>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1180909567FM></A>.page不用任何声明，.java提供抽象方法和元数据</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_485692557FM></A>.page中inject页面属性，.java中提供抽象方法</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66701 onclick='toggle("N66701")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_917876749FM></A>查找class顺序 
<DIV class=content id=N66701>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><IMG alt=full-1 src="http://bilang.rocklv.net/imgs/icons/full-1.png"><A id=FMFreemind_Link_513648787FM></A>As indicated in the page specification </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><IMG alt=full-2 src="http://bilang.rocklv.net/imgs/icons/full-2.png"><A id=FMFreemind_Link_560733898FM></A>searching the packages listed in the application specification </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><IMG alt=full-3 src="http://bilang.rocklv.net/imgs/icons/full-3.png"><A id=FMFreemind_Link_1863395779FM></A>The application specification's org.apache.tapestry.default-page-class property </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><IMG alt=full-4 src="http://bilang.rocklv.net/imgs/icons/full-4.png"><A id=FMFreemind_Link_360344997FM></A>The global property org.apache.tapestry.default-page-class </DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66748 onclick='toggle("N66748")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1167329600FM></A>4种监听方法 
<DIV class=content id=N66748>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1934838313FM></A>public type method(parameters) </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1811237368FM></A>public type method(IRequestCycle cycle, parameters)</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_311508941FM></A>public type method() </DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1169675571FM></A>public type method(IRequestCycle cycle) </DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66780 onclick='toggle("N66780")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1780209325FM></A>snippets 
<DIV class=content id=N66780>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_740608594FM></A>activate()不会立即转页，它仅保存页面对象引用在IRequestCycle中。listener执行结束后才会转业。</DIV>
<DIV class=node><IMG class=hideshow id=imgN66792 onclick='toggle("N66792")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1907699626FM></A>使用元数据inject页面和属性，可以不用在.page中进行声明 
<DIV class=content id=N66792>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1711284277FM></A>获得页面使用@injectPage("pageName")</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1347170857FM></A>t4中若发现该类包含一个未实现的“getXXX”方法，会默认产生一个实例变量XXX。该实例变量没有初始化方法，可以在getXXX()声明@InitialValue("literal:initValue")解决</DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_931355784FM></A>每个页面对象都报含一个Map，保存bean。（没有则自动创建，返回页面池时bean自动销毁1）若要在.page中获得一个已定义的Bean，使用beans前缀调用。例如：beans.beanId.beanProperty。</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1775302633FM></A>For、Foreach使用时，要在.page中对&lt;source&gt;集合对象内的元素声明&lt;property&gt;。以方便t4，生成get、set方法。</DIV></DIV></DIV></DIV></DIV>
<DIV class=node><IMG class=hideshow id=imgN66825 onclick='toggle("N66825")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1272286676FM></A>tapestry组件 
<DIV class=content id=N66825>
<DIV class=node><IMG class=hideshow id=imgN66832 onclick='toggle("N66832")' alt=hide src="http://bilang.rocklv.net/imgs/hide.png"><A id=FMFreemind_Link_1246312953FM></A>DrectLink与ExternalLink区别 
<DIV class=content id=N66832>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_756409925FM></A>1.DirectLink涉及session,它有一个布尔型参数stateful来选择stateful 和 stateless，默认为true即stateful，而ExternalLink仅仅是stateless，不能选择</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_1877399278FM></A>2.DirectLink通过Listener监听方法将参数“扔”给下一个页面，只要定义了跳转页面就OK，参数自动扔到跳转页面里。而ExternalLink通过下一个页面实现IExternalPage接口及activateExternalPage方法接收参数 DirectLink接收参数时要注意，返回值是Void，要符合监听方法规则</DIV>
<DIV class=node><IMG class=hideshow alt=leaf src="http://bilang.rocklv.net/imgs/leaf.png"><A id=FMFreemind_Link_638818591FM></A>3.DirectLink用DirectService，ExternalLink用ExternalService。另外Form提交用的是DirectService。</DIV></DIV></DIV></DIV></DIV></DIV></DIV><img src ="http://www.blogjava.net/jelver/aggbug/34771.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/jelver/" target="_blank">冰河快狼</a> 2006-03-11 08:50 <a href="http://www.blogjava.net/jelver/articles/34771.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>