Modified: websites/production/tapestry/content/switching-cases.html
==============================================================================
--- websites/production/tapestry/content/switching-cases.html (original)
+++ websites/production/tapestry/content/switching-cases.html Sun Nov 8
17:21:51 2015
@@ -67,7 +67,30 @@
</div>
<div id="content">
-<div id="ConfluenceContent"><h1 id="SwitchingCases-SwitchingCases">Switching
Cases</h1><p>With Tapestry's <code>If</code> component you can only test one
condition at a time. In order to distinguish multiple cases, you'd have to
write complex nested if/else constructs in your page template and have a
checker method for each test inside your page class.</p><div class="navmenu"
style="float:right; background:#eee; margin:3px; padding:0 1em">
+<div id="ConfluenceContent">
+<div class="atb-scrollbar-macro">
+ <div class="prev">
+ <a shape="rect" href="component-libraries.html" rel="prev">
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-left">Previous</span>
+ <span class="title">Component Libraries</span>
+ </a>
+
+ </div>
+ <div class="parent">
+ <a shape="rect" href="cookbook.html" rel="parent">
+ <span class="aui-icon
aui-icon-small atb-icon-arrow-up">Up</span>
+ <span class="title">Cookbook</span>
+ </a>
+
+ </div>
+ <div class="next">
+ <a shape="rect" href="enum-parameter-recipe.html" rel="next">
+ <span class="title">Enum Parameter Recipe</span>
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-right">Next</span>
+ </a>
+
+ </div>
+</div><h1 id="SwitchingCases-SwitchingCases">Switching Cases</h1><p>With
Tapestry's <code>If</code> component you can only test one condition at a time.
In order to distinguish multiple cases, you'd have to write complex nested
if/else constructs in your page template and have a checker method for each
test inside your page class.</p><div class="navmenu" style="float:right;
background:#eee; margin:3px; padding:0 1em">
<p> <strong>JumpStart Demo:</strong><br clear="none">
<a shape="rect" class="external-link"
href="http://jumpstart.doublenegative.com.au/jumpstart/examples/lang/ifnotnegateswitchelseunless"
>If, Not, Negate, Switch, Else, Unless</a></p></div><p>In cases where you have
to distinguish multiple cases, the <code>Delegate</code> component comes in. It
delegates rendering to some other component, for example a <code>Block</code>.
For each case you have, you basically wrap the content inside a
<code>Block</code> that doesn't get rendered by default. You then place a
Delegate component on your page and point it to a method inside your page class
that will decide which of your Blocks should be rendered.</p><p>Imagine for
example a use case, where you want to distinguish between 4 cases and you have
an int property called <code>whichCase</code> that should be tested against.
Your page template would look as follows:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeHeader panelHeader pdl"
style="border-bottom-width: 1
px;"><b>SwitchMe.tml</b></div><div class="codeContent panelContent pdl">
<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><html
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd">
Modified:
websites/production/tapestry/content/tapestry-inversion-of-control-faq.html
==============================================================================
--- websites/production/tapestry/content/tapestry-inversion-of-control-faq.html
(original)
+++ websites/production/tapestry/content/tapestry-inversion-of-control-faq.html
Sun Nov 8 17:21:51 2015
@@ -67,7 +67,30 @@
</div>
<div id="content">
-<div id="ConfluenceContent"><h2
id="TapestryInversionofControlFAQ-TapestryInversionofControlContainer">Tapestry
Inversion of Control Container</h2><p>Main article: <a shape="rect"
href="ioc.html">Tapestry IoC</a></p><p> </p><div class="aui-label"
style="float:right" title="Related Articles">
+<div id="ConfluenceContent"><p>
+</p><div class="atb-scrollbar-macro">
+ <div class="prev">
+ <a shape="rect" href="injection-faq.html" rel="prev">
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-left">Previous</span>
+ <span class="title">Injection FAQ</span>
+ </a>
+
+ </div>
+ <div class="parent">
+ <a shape="rect" href="frequently-asked-questions.html"
rel="parent">
+ <span class="aui-icon
aui-icon-small atb-icon-arrow-up">Up</span>
+ <span class="title">Frequently Asked
Questions</span>
+ </a>
+
+ </div>
+ <div class="next">
+ <a shape="rect" href="security-faq.html" rel="next">
+ <span class="title">Security FAQ</span>
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-right">Next</span>
+ </a>
+
+ </div>
+</div><h2
id="TapestryInversionofControlFAQ-TapestryInversionofControlContainer">Tapestry
Inversion of Control Container</h2><p>Main article: <a shape="rect"
href="ioc.html">Tapestry IoC</a></p><p> </p><div class="aui-label"
style="float:right" title="Related Articles">
@@ -144,7 +167,30 @@
}
}
</pre>
-</div></div><p>After Tapestry invokes the constructor of the service
implementation, and after it performs any field injections, it invokes post
injection methods. The methods must be public and return void. Parameters to a
post injection method represent further injections ... in the above example,
the RegistryShutdownHub is injected into the PostInjection method, since it is
only used inside that one method.</p><div class="confluence-information-macro
confluence-information-macro-warning"><span class="aui-icon aui-icon-small
aui-iconfont-error confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>It is <strong>not</strong>
recommended that MyServiceImpl take RegistryShutdownHub as a constructor
parameter and register itself as a listener inside the constructor. Doing so is
an example of <a shape="rect" class="external-link"
href="http://www.ibm.com/developerworks/java/library/j-jtp0618.html" >unsafe
publishing</a>, a remote but potential threa
d safety issue.</p></div></div><p>This same technique will work for any kind
of resource that must be cleaned up or destroyed when the registry shuts
down.</p><div class="confluence-information-macro
confluence-information-macro-note"><span class="aui-icon aui-icon-small
aui-iconfont-warning confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>Be careful not to invoke methods
on any service proxy objects as they will also be shutting down with the
Registry. A RegistryShutdownListener should not be reliant on anything outside
of itself.</p></div></div><h3
id="TapestryInversionofControlFAQ-HowdoImakemyservicestartupwiththerestoftheapplication,ratherthanlazily?">How
do I make my service startup with the rest of the application, rather than
lazily?</h3><p>Tapestry services are designed to be <em>lazy</em>; they are
only fully realized when needed: when the first method on the service interface
is invoked.</p><p>Sometimes a service does extra work t
hat is desirable at application startup: examples may be registering message
handlers with a JMS implementation, or setting up indexing. Since the service's
constructor (or <a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/PostInjection.html">@PostInjection</a>
methods) are not invoked until the service is realized.</p><p>The solution is
the <a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/EagerLoad.html">@EagerLoad</a>
annotation; service implementation classes marked with this annotation are
loaded when the Registry is first startup, rather than lazily.</p></div>
+</div></div><p>After Tapestry invokes the constructor of the service
implementation, and after it performs any field injections, it invokes post
injection methods. The methods must be public and return void. Parameters to a
post injection method represent further injections ... in the above example,
the RegistryShutdownHub is injected into the PostInjection method, since it is
only used inside that one method.</p><div class="confluence-information-macro
confluence-information-macro-warning"><span class="aui-icon aui-icon-small
aui-iconfont-error confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>It is <strong>not</strong>
recommended that MyServiceImpl take RegistryShutdownHub as a constructor
parameter and register itself as a listener inside the constructor. Doing so is
an example of <a shape="rect" class="external-link"
href="http://www.ibm.com/developerworks/java/library/j-jtp0618.html" >unsafe
publishing</a>, a remote but potential threa
d safety issue.</p></div></div><p>This same technique will work for any kind
of resource that must be cleaned up or destroyed when the registry shuts
down.</p><div class="confluence-information-macro
confluence-information-macro-note"><span class="aui-icon aui-icon-small
aui-iconfont-warning confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><p>Be careful not to invoke methods
on any service proxy objects as they will also be shutting down with the
Registry. A RegistryShutdownListener should not be reliant on anything outside
of itself.</p></div></div><h3
id="TapestryInversionofControlFAQ-HowdoImakemyservicestartupwiththerestoftheapplication,ratherthanlazily?">How
do I make my service startup with the rest of the application, rather than
lazily?</h3><p>Tapestry services are designed to be <em>lazy</em>; they are
only fully realized when needed: when the first method on the service interface
is invoked.</p><p>Sometimes a service does extra work t
hat is desirable at application startup: examples may be registering message
handlers with a JMS implementation, or setting up indexing. Since the service's
constructor (or <a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/PostInjection.html">@PostInjection</a>
methods) are not invoked until the service is realized.</p><p>The solution is
the <a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/EagerLoad.html">@EagerLoad</a>
annotation; service implementation classes marked with this annotation are
loaded when the Registry is first startup, rather than lazily.
+</p><div class="atb-scrollbar-macro">
+ <div class="prev">
+ <a shape="rect" href="injection-faq.html" rel="prev">
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-left">Previous</span>
+ <span class="title">Injection FAQ</span>
+ </a>
+
+ </div>
+ <div class="parent">
+ <a shape="rect" href="frequently-asked-questions.html"
rel="parent">
+ <span class="aui-icon
aui-icon-small atb-icon-arrow-up">Up</span>
+ <span class="title">Frequently Asked
Questions</span>
+ </a>
+
+ </div>
+ <div class="next">
+ <a shape="rect" href="security-faq.html" rel="next">
+ <span class="title">Security FAQ</span>
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-right">Next</span>
+ </a>
+
+ </div>
+</div></div>
</div>
<div class="clearer"></div>
Modified: websites/production/tapestry/content/templating-and-markup-faq.html
==============================================================================
--- websites/production/tapestry/content/templating-and-markup-faq.html
(original)
+++ websites/production/tapestry/content/templating-and-markup-faq.html Sun Nov
8 17:21:51 2015
@@ -67,7 +67,30 @@
</div>
<div id="content">
-<div id="ConfluenceContent"><h2
id="TemplatingandMarkupFAQ-TemplatingandMarkup">Templating and
Markup</h2><p>Main Article: <a shape="rect"
href="component-templates.html">Component Templates</a></p><h3
id="TemplatingandMarkupFAQ-WhydoIgetaSAXParseExceptionwhenIuseanHTMLentity,suchas&nbsp;inmytemplate?">Why
do I get a SAXParseException when I use an HTML entity, such as
<code>&nbsp;</code> in my template?</h3><p>Tapestry uses a standard SAX
parser to read your templates. This means that your templates must be <em>well
formed</em>: open and close tags must balance, attribute values must be quoted,
and entities must be declared. The easiest way to accomplish this is to add a
DOCTYPE to your the top of your template:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<div id="ConfluenceContent">
+<div class="atb-scrollbar-macro">
+ <div class="prev">
+ <a shape="rect" href="general-questions.html" rel="prev">
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-left">Previous</span>
+ <span class="title">General Questions</span>
+ </a>
+
+ </div>
+ <div class="parent">
+ <a shape="rect" href="frequently-asked-questions.html"
rel="parent">
+ <span class="aui-icon
aui-icon-small atb-icon-arrow-up">Up</span>
+ <span class="title">Frequently Asked
Questions</span>
+ </a>
+
+ </div>
+ <div class="next">
+ <a shape="rect" href="page-and-component-classes-faq.html" rel="next">
+ <span class="title">Page And Component Classes FAQ</span>
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-right">Next</span>
+ </a>
+
+ </div>
+</div><h2 id="TemplatingandMarkupFAQ-TemplatingandMarkup">Templating and
Markup</h2><p>Main Article: <a shape="rect"
href="component-templates.html">Component Templates</a></p><h3
id="TemplatingandMarkupFAQ-WhydoIgetaSAXParseExceptionwhenIuseanHTMLentity,suchas&nbsp;inmytemplate?">Why
do I get a SAXParseException when I use an HTML entity, such as
<code>&nbsp;</code> in my template?</h3><p>Tapestry uses a standard SAX
parser to read your templates. This means that your templates must be <em>well
formed</em>: open and close tags must balance, attribute values must be quoted,
and entities must be declared. The easiest way to accomplish this is to add a
DOCTYPE to your the top of your template:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
</pre>
@@ -111,7 +134,30 @@
return isUrgent() ? "urgent" : null;
}
</pre>
-</div></div><p>When an informal parameter is bound to null, then the attribute
is not written out at all.</p><p>You can verify which components support
informal parameters by checking the component reference, or looking for the @<a
shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/SupportsInformalParameters.html">SupportsInformalParameters</a>
annotation in the components' source
file.</p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p></p><p><table
class="Footnotes" style="width: 100%; border:none;" cellspacing="0"
cellpadding="0" summary="This table contains one or more notes for references
made elsewhere on the page."><caption
class="accessibility">Footnotes</caption><thead class="accessibility"><tr
class="accessibility"><th colspan="1" rowspan="1" class="accessibility"
id="footnote-th1">Reference</th><th colspan="1" rowspan="1"
class="accessibility" id="footnote-th2">Notes</th></t
r></thead><tbody></tbody></table></p><p></p><p> </p><p> </p><p> </p><p> </p></div>
+</div></div><p>When an informal parameter is bound to null, then the attribute
is not written out at all.</p><p>You can verify which components support
informal parameters by checking the component reference, or looking for the @<a
shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/SupportsInformalParameters.html">SupportsInformalParameters</a>
annotation in the components' source file.</p>
+<div class="atb-scrollbar-macro">
+ <div class="prev">
+ <a shape="rect" href="general-questions.html" rel="prev">
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-left">Previous</span>
+ <span class="title">General Questions</span>
+ </a>
+
+ </div>
+ <div class="parent">
+ <a shape="rect" href="frequently-asked-questions.html"
rel="parent">
+ <span class="aui-icon
aui-icon-small atb-icon-arrow-up">Up</span>
+ <span class="title">Frequently Asked
Questions</span>
+ </a>
+
+ </div>
+ <div class="next">
+ <a shape="rect" href="page-and-component-classes-faq.html" rel="next">
+ <span class="title">Page And Component Classes FAQ</span>
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-right">Next</span>
+ </a>
+
+ </div>
+</div><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p></p><p><table
class="Footnotes" style="width: 100%; border:none;" cellspacing="0"
cellpadding="0" summary="This table contains one or more notes for references
made elsewhere on the page."><caption
class="accessibility">Footnotes</caption><thead class="accessibility"><tr
class="accessibility"><th colspan="1" rowspan="1" class="accessibility"
id="footnote-th1">Reference</th><th colspan="1" rowspan="1"
class="accessibility"
id="footnote-th2">Notes</th></tr></thead><tbody></tbody></table></p><p></p><p> </p><p> </p><p> </p><p> </p></div>
</div>
<div class="clearer"></div>
Modified: websites/production/tapestry/content/test-page-2.html
==============================================================================
--- websites/production/tapestry/content/test-page-2.html (original)
+++ websites/production/tapestry/content/test-page-2.html Sun Nov 8 17:21:51
2015
@@ -69,11 +69,11 @@
<div id="content">
<div id="ConfluenceContent"><p>
<style type="text/css">/*<![CDATA[*/
-div.rbtoc1437340833548 {padding: 0px;}
-div.rbtoc1437340833548 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1437340833548 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1447003244665 {padding: 0px;}
+div.rbtoc1447003244665 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1447003244665 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1437340833548">
+/*]]>*/</style></p><div class="toc-macro rbtoc1447003244665">
<ul class="toc-indentation"><li><a shape="rect"
href="#TestPage2-Generalquestions">General questions</a>
<ul class="toc-indentation"><li><a shape="rect"
href="#TestPage2-HowdoIgetstartedwithTapestry?">How do I get started with
Tapestry?</a></li><li><a shape="rect"
href="#TestPage2-WhydoesTapestryusePrototype?WhynotinsertfavoriteJavaScriptlibraryhere?">Why
does Tapestry use Prototype? Why not insert favorite JavaScript library
here?</a></li><li><a shape="rect"
href="#TestPage2-WhydoesTapestryhaveitsownInversionofControlContainer?WhynotSpringorGuice?">Why
does Tapestry have its own Inversion of Control Container? Why not Spring or
Guice?</a></li><li><a shape="rect"
href="#TestPage2-HowdoIupgradefromTapestry4toTapestry5?">How do I upgrade from
Tapestry 4 to Tapestry 5?</a></li><li><a shape="rect"
href="#TestPage2-WhyaretherebothRequestandHttpServletRequest?">Why are there
both Request and HttpServletRequest?</a></li></ul>
</li></ul>
Modified: websites/production/tapestry/content/using-select-with-a-list.html
==============================================================================
--- websites/production/tapestry/content/using-select-with-a-list.html
(original)
+++ websites/production/tapestry/content/using-select-with-a-list.html Sun Nov
8 17:21:51 2015
@@ -67,7 +67,30 @@
</div>
<div id="content">
-<div id="ConfluenceContent"><h1
id="UsingSelectWithaList-UsingSelectWithaList">Using Select With a
List</h1><p>The documentation for the <a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Select.html">Select
Component</a> and the <a shape="rect" href="tutorial.html">Tapestry
Tutorial</a> provide simplistic examples of populating a drop-down menu (as the
(X)HTML <em>Select</em> element) using comma-delimited strings and enums.
However, most real-world Tapestry applications need to populate such menus
using values from a database, commonly in the form of java.util.List objects.
Doing so generally requires a <a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/SelectModel.html">SelectModel</a>
and a <a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ValueEncoder.html">ValueEncoder</a>
bound to the Sel
ect component with its "model" and "encoder" parameters:</p><div class="code
panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<div id="ConfluenceContent">
+<div class="atb-scrollbar-macro">
+ <div class="prev">
+ <a shape="rect" href="meta-programming-page-content.html" rel="prev">
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-left">Previous</span>
+ <span class="title">Meta-Programming Page
Content</span>
+ </a>
+
+ </div>
+ <div class="parent">
+ <a shape="rect" href="cookbook.html" rel="parent">
+ <span class="aui-icon
aui-icon-small atb-icon-arrow-up">Up</span>
+ <span class="title">Cookbook</span>
+ </a>
+
+ </div>
+ <div class="next">
+ <a shape="rect" href="ioc-cookbook.html" rel="next">
+ <span class="title">IoC cookbook</span>
+ <span class="aui-icon aui-icon-small
atb-icon-arrow-right">Next</span>
+ </a>
+
+ </div>
+</div><h1 id="UsingSelectWithaList-UsingSelectWithaList">Using Select With a
List</h1><p>The documentation for the <a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Select.html">Select
Component</a> and the <a shape="rect" href="tutorial.html">Tapestry
Tutorial</a> provide simplistic examples of populating a drop-down menu (as the
(X)HTML <em>Select</em> element) using comma-delimited strings and enums.
However, most real-world Tapestry applications need to populate such menus
using values from a database, commonly in the form of java.util.List objects.
Doing so generally requires a <a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/SelectModel.html">SelectModel</a>
and a <a shape="rect" class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ValueEncoder.html">ValueEncoder</a>
bound to the Select component with its
"model" and "encoder" parameters:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"><t:select t:id="colorMenu" value="selectedColor"
model="ColorSelectModel" encoder="colorEncoder" />
</pre>
</div></div><p>In the above example, ColorSelectModel must be of type
SelectModel, or anything that Tapestry knows how to <a shape="rect"
href="parameter-type-coercion.html">coerce</a> into a SelectModel, such as a
List or a Map or a "value=label,value=label,..." delimited string, or anything
Tapestry knows how to coerce into a List or Map, such as an Array or a
comma-delimited String.</p><h2
id="UsingSelectWithaList-SelectModel">SelectModel</h2><div class="navmenu"
style="float:right; background:#eee; margin:3px; padding:0 1em">