Author: buildbot Date: Tue Mar 7 03:12:12 2023 New Revision: 1082448 Log: Production update by buildbot for tapestry
Modified: websites/production/tapestry/content/ajax-and-zones.html websites/production/tapestry/content/cache/main.pageCache websites/production/tapestry/content/component-events-faq.html websites/production/tapestry/content/configuration.html websites/production/tapestry/content/ioc-cookbook-basic-services-and-injection.html websites/production/tapestry/content/ioc-cookbook-overriding-ioc-services.html websites/production/tapestry/content/ioc-cookbook-patterns.html websites/production/tapestry/content/ioc-cookbook-service-configurations.html websites/production/tapestry/content/javascript-faq.html websites/production/tapestry/content/meta-programming-page-content.html websites/production/tapestry/content/page-navigation.html websites/production/tapestry/content/persistent-page-data.html websites/production/tapestry/content/release-notes-50.html websites/production/tapestry/content/release-notes-51.html websites/production/tapestry/content/release-notes-52.html websites/production/tapestry/content/release-upgrade-faq.html websites/production/tapestry/content/security-faq.html websites/production/tapestry/content/security.html websites/production/tapestry/content/templating-and-markup-faq.html websites/production/tapestry/content/using-select-with-a-list.html Modified: websites/production/tapestry/content/ajax-and-zones.html ============================================================================== --- websites/production/tapestry/content/ajax-and-zones.html (original) +++ websites/production/tapestry/content/ajax-and-zones.html Tue Mar 7 03:12:12 2023 @@ -142,114 +142,7 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><div class="aui-label" style="float:right" title="Related Articles"> - - - - - - - - - - -<h3>Related Articles</h3> - -<ul class="content-by-label"><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="ajax-and-zones.html">Ajax and Zones</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="legacy-javascript.html">Legacy JavaScript</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="typescript.html">TypeScript</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="javascript-modules.html">JavaScript Modules</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="client-side-javascript.html">Client-Side JavaScript</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="coffeescript.html">CoffeeScript</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="javascript-faq.html">JavaScript FAQ</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="ajax-components-faq.html">Ajax Components FAQ</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="component-cheat-sheet.html">Component Cheat Sheet</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="assets.html">Assets</a> - - - </div> - </li></ul> -</div> - - -<p>Tapestry provides easy-to-use support for <strong>Ajax</strong>, the technique of using JavaScript to dynamically update parts of a web page with content from the server without redrawing the whole page. With Tapestry, you can do simple Ajax updates without having to write any JavaScript code at all.</p><p>Ajax support is included in many <a href="component-reference.html">built-in components</a> and <a href="component-mixins.html">component mixins</a> via the <code>async</code> parameter (in Tapestry 5.4+) and the <code>zone</code> parameter (for earlier versions). Here we use an EventLink component to trigger an Ajax update of another area of the page:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Page or component template (partial)</b></div><div class="codeContent panelContent pdl"> + <div id="ConfluenceContent"><img class="wysiwyg-unknown-macro" src="https://cwiki.apache.org/confluence/plugins/servlet/confluence/placeholder/unknown-macro?name=div&locale=en_GB&version=2"><p>Tapestry provides easy-to-use support for <strong>Ajax</strong>, the technique of using JavaScript to dynamically update parts of a web page with content from the server without redrawing the whole page. With Tapestry, you can do simple Ajax updates without having to write any JavaScript code at all.</p><p>Ajax support is included in many <a href="component-reference.html">built-in components</a> and <a href="component-mixins.html">component mixins</a> via the <code>async</code> parameter (in Tapestry 5.4+) and the <code>zone</code> parameter (for earlier versions). Here we use an EventLink component to trigger an Ajax update of another area of the page:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pd l" style="border-bottom-width: 1px;"><b>Page or component template (partial)</b></div><div class="codeContent panelContent pdl"> <pre><code class="language-xml"><t:eventlink event="updateTime" async="true">update</t:eventlink> ... <t:zone t:id="timeArea" id="timeArea"> Modified: websites/production/tapestry/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/tapestry/content/component-events-faq.html ============================================================================== --- websites/production/tapestry/content/component-events-faq.html (original) +++ websites/production/tapestry/content/component-events-faq.html Tue Mar 7 03:12:12 2023 @@ -142,35 +142,12 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><p> -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - <a href="link-components-faq.html" rel="prev"> - <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span> - <span class="title">Link Components FAQ</span> - </a> - - </div> - <div class="parent"> - <a 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 id="ConfluenceContent"><h1 id="ComponentEventsFAQ-ComponentEvents">Component Events</h1><p>Main Article: <a href="component-events.html">Component Events</a></p><h2 id="ComponentEventsFAQ-Contents">Contents</h2><p><style type="text/css">/*<![CDATA[*/ +div.rbtoc1678158725459 {padding: 0px;} +div.rbtoc1678158725459 ul {margin-left: 0px;} +div.rbtoc1678158725459 li {margin-left: 0px;padding-left: 0px;} - </div> - <div class="next"> - <a href="javascript-faq.html" rel="next"> - <span class="title">JavaScript FAQ</span> - <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span> - </a> - - </div> -</div><h1 id="ComponentEventsFAQ-ComponentEvents">Component Events</h1><p>Main Article: <a href="component-events.html">Component Events</a></p><h2 id="ComponentEventsFAQ-Contents">Contents</h2><p><style type="text/css">/*<![CDATA[*/ -div.rbtoc1672423922438 {padding: 0px;} -div.rbtoc1672423922438 ul {margin-left: 0px;} -div.rbtoc1672423922438 li {margin-left: 0px;padding-left: 0px;} - -/*]]>*/</style></p><div class="toc-macro rbtoc1672423922438"> +/*]]>*/</style></p><div class="toc-macro rbtoc1678158725459"> <ul class="toc-indentation"><li><a href="#ComponentEventsFAQ-WhydoesTapestrysendaredirectafteraformissubmitted?">Why does Tapestry send a redirect after a form is submitted?</a></li><li><a href="#ComponentEventsFAQ-IspecifiedazoneinmyActionLink/EventLink,sowhydoesn'tmyeventfireviaajax(request.isXHR()isfalse)?">I specified a zone in my ActionLink/EventLink, so why doesn't my event fire via ajax (request.isXHR() is false)?</a></li></ul> </div><h2 id="ComponentEventsFAQ-WhydoesTapestrysendaredirectafteraformissubmitted?">Why does Tapestry send a redirect after a form is submitted?</h2><p>This is an extension of the <a class="external-link" href="http://en.wikipedia.org/wiki/Post/Redirect/Get" rel="nofollow">Post/Redirect/Get</a> approach. It ensures that after an operation that updates server-side state, such as a form submission, if the user resubmits the resulting page, the operation is <strong>not</strong> performed a second time; instead just the results of the operation, reflecting the changed server-side state, is re-rendered.</p><p>This has the unwanted requirement that any data needed to render the response must persist between the event request (the form submission) and the render request; this often means that fields must be annotated with @<a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Persist.html">Persist</a>. @@ -186,30 +163,7 @@ div.rbtoc1672423922438 li {margin-left: <div class="param-body">Starting in release 5.4, Forms (by default) will NOT redirect after post if there are validation errors. This makes it possible to re-render the page, with error decorations, without requiring that the validation errors be stored in the session between requests ... and that means that the application can remain stateless much longer.</div> -</div><h2 id="ComponentEventsFAQ-IspecifiedazoneinmyActionLink/EventLink,sowhydoesn'tmyeventfireviaajax(request.isXHR()isfalse)?">I specified a zone in my ActionLink/EventLink, so why doesn't my event fire via ajax (request.isXHR() is false)?</h2><p>Check your browser's JavaScript console for errors. It's likely that a JavaScript error has prevented Tapestry from transforming your ActionLink/EventLink from a page render action to an ajax action. -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - <a href="link-components-faq.html" rel="prev"> - <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span> - <span class="title">Link Components FAQ</span> - </a> - - </div> - <div class="parent"> - <a 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 href="javascript-faq.html" rel="next"> - <span class="title">JavaScript FAQ</span> - <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span> - </a> - - </div> -</div></div> +</div><h2 id="ComponentEventsFAQ-IspecifiedazoneinmyActionLink/EventLink,sowhydoesn'tmyeventfireviaajax(request.isXHR()isfalse)?">I specified a zone in my ActionLink/EventLink, so why doesn't my event fire via ajax (request.isXHR() is false)?</h2><p>Check your browser's JavaScript console for errors. It's likely that a JavaScript error has prevented Tapestry from transforming your ActionLink/EventLink from a page render action to an ajax action.</p></div> </div> <!-- /// Content End --> </div> Modified: websites/production/tapestry/content/configuration.html ============================================================================== --- websites/production/tapestry/content/configuration.html (original) +++ websites/production/tapestry/content/configuration.html Tue Mar 7 03:12:12 2023 @@ -142,83 +142,12 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><div class="aui-label" style="float:right" title="Related Articles"> + <div id="ConfluenceContent"><img class="wysiwyg-unknown-macro" src="https://cwiki.apache.org/confluence/plugins/servlet/confluence/placeholder/unknown-macro?name=div&locale=en_GB&version=2"><h1 id="Configuration-ConfiguringTapestry">Configuring Tapestry</h1><p>This page discusses all the ways in which Tapestry can be configured. Tapestry applications are configured almost entirely using Java, with very little XML at all.</p><p><strong>Contents</strong></p><p><style type="text/css">/*<![CDATA[*/ +div.rbtoc1678158706991 {padding: 0px;} +div.rbtoc1678158706991 ul {margin-left: 0px;} +div.rbtoc1678158706991 li {margin-left: 0px;padding-left: 0px;} - - - - - - - - - -<h3>Related Articles</h3> - -<ul class="content-by-label"><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="tapestry-ioc-configuration.html">Tapestry IoC Configuration</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="response-compression.html">Response Compression</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="symbols.html">Symbols</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="application-module-class-cheat-sheet.html">Application Module Class Cheat Sheet</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="ioc-cookbook-service-configurations.html">IoC cookbook - Service Configurations</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="configuration.html">Configuration</a> - - - </div> - </li></ul> -</div> - - -<h1 id="Configuration-ConfiguringTapestry">Configuring Tapestry</h1><p>This page discusses all the ways in which Tapestry can be configured. Tapestry applications are configured almost entirely using Java, with very little XML at all.</p><p><strong>Contents</strong></p><p><style type="text/css">/*<![CDATA[*/ -div.rbtoc1672423904953 {padding: 0px;} -div.rbtoc1672423904953 ul {margin-left: 0px;} -div.rbtoc1672423904953 li {margin-left: 0px;padding-left: 0px;} - -/*]]>*/</style></p><div class="toc-macro rbtoc1672423904953"> +/*]]>*/</style></p><div class="toc-macro rbtoc1678158706991"> <ul class="toc-indentation"><li><a href="#Configuration-XMLconfiguration(web.xml)">XML configuration (web.xml)</a></li><li><a href="#Configuration-YourApplication'sModuleClass">Your Application's Module Class</a></li><li><a href="#Configuration-ConfigurationSymbolNames">Configuration Symbol Names</a></li><li><a href="#Configuration-SettingComponentParameterDefaults">Setting Component Parameter Defaults</a></li><li><a href="#Configuration-ConfiguringIgnoredPaths">Configuring Ignored Paths</a></li><li><a href="#Configuration-ConfiguringContentTypeMapping">Configuring Content Type Mapping</a></li><li><a href="#Configuration-SettingExecutionModes">Setting Execution Modes</a></li><li><a href="#Configuration-SegregatingApplicationsIntoFolders">Segregating Applications Into Folders</a></li></ul> </div><h2 id="Configuration-XMLconfiguration(web.xml)">XML configuration (web.xml)</h2><p>Tapestry runs on top of the standard Java Servlet API. To the servlet container, such as Tomcat, Tapestry appears as a <em>servlet filter</em>. This gives Tapestry great flexibility in matching URLs without requiring lots of XML configuration.</p><p>Although most configuration is done with Java, a small but necessary amount of configuration occurs inside the servlet deployment descriptor, WEB-INF/web.xml. Most of the configuration is boilerplate, nearly the same for all applications.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>web.xml (partial)</b></div><div class="codeContent panelContent pdl"> <pre><code class="language-xml"><!DOCTYPE web-app Modified: websites/production/tapestry/content/ioc-cookbook-basic-services-and-injection.html ============================================================================== --- websites/production/tapestry/content/ioc-cookbook-basic-services-and-injection.html (original) +++ websites/production/tapestry/content/ioc-cookbook-basic-services-and-injection.html Tue Mar 7 03:12:12 2023 @@ -142,26 +142,7 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><p> -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - - </div> - <div class="parent"> - <a href="ioc-cookbook.html" rel="parent"> - <span class="aui-icon aui-icon-small atb-icon-arrow-up">Up</span> - <span class="title">IoC cookbook</span> - </a> - - </div> - <div class="next"> - <a href="ioc-cookbook-overriding-ioc-services.html" rel="next"> - <span class="title">IoC Cookbook - Overriding IoC Services</span> - <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span> - </a> - - </div> -</div>The starting point for Tapestry IOC services and injection is knowing a few conventions: what to name your classes, what packages to put them in and so forth.<p>In many cases, these conventions are just a little stronger: you may have to do some amount of extra configuration if you choose to go your own way.</p><h1 id="IoCCookbookBasicServicesandInjection-GettingStarted">Getting Started</h1><p>As always, you'll first need to choose a package for your application, such as org.example.myapp.</p><p>By convention, services go in a sub-package named "services". Tapestry IOC Module class names have a "Module" suffix. Thus, you might start with a module class org.example.myapp.services.MyAppModule.</p><h1 id="IoCCookbookBasicServicesandInjection-SimpleServices">Simple Services</h1><p>The simplest services don't have any special configuration or dependencies. They are defined as services so that they can be shared.</p><p>For example, the <a class="external-link" href="http://tapestry. apache.org/current/apidocs/org/apache/tapestry5/ioc/services/PropertyAccess.html">PropertyAccess</a> service is used in multiple places around the framework to access properties of objects (its a wrapper around the Java Beans Introspector and a bit of reflection). This is defined in the <a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/TapestryIOCModule.html">TapestryIOCModule</a>.</p><p>It's useful to share PropertyAccess, because it does a lot of useful caching internally.</p><p>The PropertyAccess service is defined inside TapestryIOCModule's bind() method:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> + <div id="ConfluenceContent"><p>The starting point for Tapestry IOC services and injection is knowing a few conventions: what to name your classes, what packages to put them in and so forth.</p><p>In many cases, these conventions are just a little stronger: you may have to do some amount of extra configuration if you choose to go your own way.</p><h1 id="IoCCookbookBasicServicesandInjection-GettingStarted">Getting Started</h1><p>As always, you'll first need to choose a package for your application, such as org.example.myapp.</p><p>By convention, services go in a sub-package named "services". Tapestry IOC Module class names have a "Module" suffix. Thus, you might start with a module class org.example.myapp.services.MyAppModule.</p><h1 id="IoCCookbookBasicServicesandInjection-SimpleServices">Simple Services</h1><p>The simplest services don't have any special configuration or dependencies. They are defined as services so that they can be shared.</p><p>For exa mple, the <a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/PropertyAccess.html">PropertyAccess</a> service is used in multiple places around the framework to access properties of objects (its a wrapper around the Java Beans Introspector and a bit of reflection). This is defined in the <a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/TapestryIOCModule.html">TapestryIOCModule</a>.</p><p>It's useful to share PropertyAccess, because it does a lot of useful caching internally.</p><p>The PropertyAccess service is defined inside TapestryIOCModule's bind() method:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <pre><code class="language-java"> public static void bind(ServiceBinder binder) { . . . @@ -209,26 +190,7 @@ configuration.add("context", contextAssetFactory); configuration.add("classpath", classpathAssetFactory); }</code></pre> -</div></div><p>This is far from the final word on injection and disambiguation; we'll be coming back to this concept repeatedly. And in later chapters of the cookbook, we'll also go into more detail about the many other concepts present in this example. The important part is that Tapestry <em>primarily</em> works off the parameter type (at the point of injection), but when that is insufficient (you'll know ... there will be an error) you can provide additional information, in the form of annotations, to straighten things out. -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - - </div> - <div class="parent"> - <a href="ioc-cookbook.html" rel="parent"> - <span class="aui-icon aui-icon-small atb-icon-arrow-up">Up</span> - <span class="title">IoC cookbook</span> - </a> - - </div> - <div class="next"> - <a href="ioc-cookbook-overriding-ioc-services.html" rel="next"> - <span class="title">IoC Cookbook - Overriding IoC Services</span> - <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span> - </a> - - </div> -</div></div> +</div></div><p>This is far from the final word on injection and disambiguation; we'll be coming back to this concept repeatedly. And in later chapters of the cookbook, we'll also go into more detail about the many other concepts present in this example. The important part is that Tapestry <em>primarily</em> works off the parameter type (at the point of injection), but when that is insufficient (you'll know ... there will be an error) you can provide additional information, in the form of annotations, to straighten things out.</p></div> </div> <!-- /// Content End --> </div> Modified: websites/production/tapestry/content/ioc-cookbook-overriding-ioc-services.html ============================================================================== --- websites/production/tapestry/content/ioc-cookbook-overriding-ioc-services.html (original) +++ websites/production/tapestry/content/ioc-cookbook-overriding-ioc-services.html Tue Mar 7 03:12:12 2023 @@ -142,30 +142,7 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><p> -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - <a href="ioc-cookbook-basic-services-and-injection.html" rel="prev"> - <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span> - <span class="title">IoC Cookbook - Basic Services and Injection</span> - </a> - - </div> - <div class="parent"> - <a href="ioc-cookbook.html" rel="parent"> - <span class="aui-icon aui-icon-small atb-icon-arrow-up">Up</span> - <span class="title">IoC cookbook</span> - </a> - - </div> - <div class="next"> - <a href="ioc-cookbook-patterns.html" rel="next"> - <span class="title">IoC Cookbook - Patterns</span> - <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span> - </a> - - </div> -</div><h1 id="IoCCookbookOverridingIoCServices-OverridingTapestryIoCServices">Overriding Tapestry IoC Services</h1><p>Tapestry is designed to be easy to customize, and the IoC container is the key to that customizability.</p><p>One of Tapestry's most important activities is resolving injected objects; that is, when Tapestry is building an object or service and sees a constructor parameter or a field, it must decide what value to plug in. Most of the time, the injected object is a service defined elsewhere within the Tapestry IoC container.</p><p>However, there are cases where you might want to override how Tapestry operates in some specific way.</p><p>The strategy used to determine what object gets injected is <a href="injection-in-detail.html">defined inside Tapestry IoC itself</a>; thus we can take advantage of several features of the Tapestry IoC container in order to take control over specific injections.</p><h2 id="IoCCookbookOverridingIoCServices-ContributingaServiceOverride"> Contributing a Service Override</h2><p>In most cases, services are injected by matching just the type; there is no @<a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/InjectService.html">InjectService</a> annotation, just a method or constructor parameter whose type matches the service's interface.</p><p>In this case, it is very easy to supply your own alternate implementation of a service, by <em>contributing</em><em> a Service Override</em> in your module class (usually AppModule.java), like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>AppModule.java (partial)</b></div><div class="codeContent panelContent pdl"> + <div id="ConfluenceContent"><h1 id="IoCCookbookOverridingIoCServices-OverridingTapestryIoCServices">Overriding Tapestry IoC Services</h1><p>Tapestry is designed to be easy to customize, and the IoC container is the key to that customizability.</p><p>One of Tapestry's most important activities is resolving injected objects; that is, when Tapestry is building an object or service and sees a constructor parameter or a field, it must decide what value to plug in. Most of the time, the injected object is a service defined elsewhere within the Tapestry IoC container.</p><p>However, there are cases where you might want to override how Tapestry operates in some specific way.</p><p>The strategy used to determine what object gets injected is <a href="injection-in-detail.html">defined inside Tapestry IoC itself</a>; thus we can take advantage of several features of the Tapestry IoC container in order to take control over specific injections.</p><h2 id="IoCCookbookOv erridingIoCServices-ContributingaServiceOverride">Contributing a Service Override</h2><p>In most cases, services are injected by matching just the type; there is no @<a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/InjectService.html">InjectService</a> annotation, just a method or constructor parameter whose type matches the service's interface.</p><p>In this case, it is very easy to supply your own alternate implementation of a service, by <em>contributing</em><em> a Service Override</em> in your module class (usually AppModule.java), like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>AppModule.java (partial)</b></div><div class="codeContent panelContent pdl"> <pre><code class="language-java"> @Contribute(ServiceOverride.class) public static void setupApplicationServiceOverrides(MappedConfiguration<Class,Object> configuration) { @@ -190,30 +167,7 @@ return new SomeServiceType() { . . . }; } </code></pre> -</div></div><p>This decorate method is invoked because its name matches the service id of the original service, "SomeServiceType" (you have to adjust the name to match the service id).</p><p>The method is passed the original service and its job it to return an <em>interceptor</em>, an object that implements the same interface, wrapping around the original service. In many cases, your code will simply re-invoke methods on the delegate, passing the same parameters. However, an interceptor can decide to not invoke methods, or it can change parameters, or change return values, or catch or throw exceptions.</p><p>Note that the object passed in as <code>delegate</code> may be the core service implementation, or it may be some other interceptor from some other decorator for the same service.</p><hr><p>  -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - <a href="ioc-cookbook-basic-services-and-injection.html" rel="prev"> - <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span> - <span class="title">IoC Cookbook - Basic Services and Injection</span> - </a> - - </div> - <div class="parent"> - <a href="ioc-cookbook.html" rel="parent"> - <span class="aui-icon aui-icon-small atb-icon-arrow-up">Up</span> - <span class="title">IoC cookbook</span> - </a> - - </div> - <div class="next"> - <a href="ioc-cookbook-patterns.html" rel="next"> - <span class="title">IoC Cookbook - Patterns</span> - <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span> - </a> - - </div> -</div></div> +</div></div><p>This decorate method is invoked because its name matches the service id of the original service, "SomeServiceType" (you have to adjust the name to match the service id).</p><p>The method is passed the original service and its job it to return an <em>interceptor</em>, an object that implements the same interface, wrapping around the original service. In many cases, your code will simply re-invoke methods on the delegate, passing the same parameters. However, an interceptor can decide to not invoke methods, or it can change parameters, or change return values, or catch or throw exceptions.</p><p>Note that the object passed in as <code>delegate</code> may be the core service implementation, or it may be some other interceptor from some other decorator for the same service.</p><hr></div> </div> <!-- /// Content End --> </div> Modified: websites/production/tapestry/content/ioc-cookbook-patterns.html ============================================================================== --- websites/production/tapestry/content/ioc-cookbook-patterns.html (original) +++ websites/production/tapestry/content/ioc-cookbook-patterns.html Tue Mar 7 03:12:12 2023 @@ -142,83 +142,7 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><p> -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - <a href="ioc-cookbook-overriding-ioc-services.html" rel="prev"> - <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span> - <span class="title">IoC Cookbook - Overriding IoC Services</span> - </a> - - </div> - <div class="parent"> - <a href="ioc-cookbook.html" rel="parent"> - <span class="aui-icon aui-icon-small atb-icon-arrow-up">Up</span> - <span class="title">IoC cookbook</span> - </a> - - </div> - <div class="next"> - <a href="ioc-cookbook-service-configurations.html" rel="next"> - <span class="title">IoC cookbook - Service Configurations</span> - <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span> - </a> - - </div> -</div>Tapestry IoC has support for implementing several of the <a class="external-link" href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)" rel="nofollow">Gang Of Four Design Patterns</a>. In fact, the IoC container itself is a pumped up version of the Factory pattern.<div class="aui-label" style="float:right" title="Related Articles"> - - - - - - - - - - -<h3>Related Articles</h3> - -<ul class="content-by-label"><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="pipelinebuilder-service.html">PipelineBuilder Service</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="strategybuilder-service.html">StrategyBuilder Service</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="ioc-cookbook-patterns.html">IoC Cookbook - Patterns</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="chainbuilder-service.html">ChainBuilder Service</a> - - - </div> - </li></ul> -</div> - - -<p>The basis for these patterns is often the use of <em>service builder methods</em>, where a <a href="ioc-cookbook-service-configurations.html">configuration</a> for the service is combined with a factory to produce the service implementation on the fly.</p><p><span class="confluence-anchor-link" id="IoCCookbookPatterns-chainofcommand"></span></p><h1 id="IoCCookbookPatterns-ChainofCommandPattern">Chain of Command Pattern</h1><p>Main Article: <a href="chainbuilder-service.html">Chain of Command</a></p><p>Let's look at another example, again from the Tapestry code base. The <a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/InjectionProvider.html">InjectProvider</a> interface is used to process the @Inject annotation on the fields of a Tapestry page or component. Many different instances are combined together to form a <em>chain of command</em>.</p><p>The interface has only a single method (this is far from uncommon):</p><div class ="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> + <div id="ConfluenceContent"><p>Tapestry IoC has support for implementing several of the <a class="external-link" href="http://en.wikipedia.org/wiki/Design_pattern_(computer_science)" rel="nofollow">Gang Of Four Design Patterns</a>. In fact, the IoC container itself is a pumped up version of the Factory pattern.</p><img class="wysiwyg-unknown-macro" src="https://cwiki.apache.org/confluence/plugins/servlet/confluence/placeholder/unknown-macro?name=div&locale=en_GB&version=2"><p>The basis for these patterns is often the use of <em>service builder methods</em>, where a <a href="ioc-cookbook-service-configurations.html">configuration</a> for the service is combined with a factory to produce the service implementation on the fly.</p><p><span class="confluence-anchor-link" id="IoCCookbookPatterns-chainofcommand"></span></p><h1 id="IoCCookbookPatterns-ChainofCommandPattern">Chain of Command Pattern</h1><p>Main Article: <a href="chainbuilder-service.html"> Chain of Command</a></p><p>Let's look at another example, again from the Tapestry code base. The <a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/InjectionProvider.html">InjectProvider</a> interface is used to process the @Inject annotation on the fields of a Tapestry page or component. Many different instances are combined together to form a <em>chain of command</em>.</p><p>The interface has only a single method (this is far from uncommon):</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <pre><code class="language-java">public interface InjectionProvider { boolean provideInjection(String fieldName, Class fieldType, ObjectLocator locator, @@ -293,30 +217,7 @@ } } }</code></pre> -</div></div><p>Reducing the chain to a single object vastly simplifies the code: we've <em>factored out</em> the loop implicit in the chain of command. That eliminates a lot of code, and that's less code to test, and fewer paths through InjectWorker, which lowers its complexity further. We don't have to test the cases where the list of injection providers is empty, or consists of only a single object, or where it's the third object in that returns true: it looks like a single object, it acts like a single object ... but its implementation uses many objects. -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - <a href="ioc-cookbook-overriding-ioc-services.html" rel="prev"> - <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span> - <span class="title">IoC Cookbook - Overriding IoC Services</span> - </a> - - </div> - <div class="parent"> - <a href="ioc-cookbook.html" rel="parent"> - <span class="aui-icon aui-icon-small atb-icon-arrow-up">Up</span> - <span class="title">IoC cookbook</span> - </a> - - </div> - <div class="next"> - <a href="ioc-cookbook-service-configurations.html" rel="next"> - <span class="title">IoC cookbook - Service Configurations</span> - <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span> - </a> - - </div> -</div></div> +</div></div><p>Reducing the chain to a single object vastly simplifies the code: we've <em>factored out</em> the loop implicit in the chain of command. That eliminates a lot of code, and that's less code to test, and fewer paths through InjectWorker, which lowers its complexity further. We don't have to test the cases where the list of injection providers is empty, or consists of only a single object, or where it's the third object in that returns true: it looks like a single object, it acts like a single object ... but its implementation uses many objects.</p></div> </div> <!-- /// Content End --> </div> Modified: websites/production/tapestry/content/ioc-cookbook-service-configurations.html ============================================================================== --- websites/production/tapestry/content/ioc-cookbook-service-configurations.html (original) +++ websites/production/tapestry/content/ioc-cookbook-service-configurations.html Tue Mar 7 03:12:12 2023 @@ -142,26 +142,7 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><p> -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - <a href="ioc-cookbook-patterns.html" rel="prev"> - <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span> - <span class="title">IoC Cookbook - Patterns</span> - </a> - - </div> - <div class="parent"> - <a href="ioc-cookbook.html" rel="parent"> - <span class="aui-icon aui-icon-small atb-icon-arrow-up">Up</span> - <span class="title">IoC cookbook</span> - </a> - - </div> - <div class="next"> - - </div> -</div><h1 id="IoCcookbookServiceConfigurations-ServiceConfigurations">Service Configurations</h1><p>This is an area of Tapestry IoC that is often least well understood. Tapestry services often must have some configuration to fine tune exactly what they do. One of the interactions between modules is that these service configurations are shared: they may be contributed into by any module.</p><p>Let's start with the most basic kind, the unordered configuration.</p><h1 id="IoCcookbookServiceConfigurations-UnorderedServiceConfigurations">Unordered Service Configurations</h1><p>One of Tapestry's features is the ability to package assets (images, style sheets, JavaScript libraries, etc.) inside JAR files and expose those to the client. For example, an application URL /assets/org/example/mylib/mylib.js would refer to a file, myllib.js, stored on the classpath in the /org/example/mylib folder.</p><p>That's fine for most cases, but for certain file extensions, we don't want to allow a client browser to "troll" for the files, as the contents could compromise security. For example, downloading a .class file is bad: a clever client might download one that contains a hard-coded user name or password.</p><p>Thus, for certain file extensions, Tapestry guards the resource by attaching an MD5 digest for the resource to the URL. The checksum is derived from the file contents; thus it can't be spoofed from the client unless the client already has the file contents.</p><p>This is controlled by the <a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/ResourceDigestGenerator.html">ResourceDigestGenerator</a> service, which uses its configuration to determine which file extensions require an MD5 digest.</p><h2 id="IoCcookbookServiceConfigurations-ContributingtoaService">Contributing to a Service</h2><p>Main Article: <a href="tapestry-ioc-configuration.html">Tapestry IoC Configuration</a></p><p>The Tapestry module makes a contribution into the service configuration:</p><div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div class="codeContent panelContent pdl"> + <div id="ConfluenceContent"><h1 id="IoCcookbookServiceConfigurations-ServiceConfigurations">Service Configurations</h1><p>This is an area of Tapestry IoC that is often least well understood. Tapestry services often must have some configuration to fine tune exactly what they do. One of the interactions between modules is that these service configurations are shared: they may be contributed into by any module.</p><p>Let's start with the most basic kind, the unordered configuration.</p><h1 id="IoCcookbookServiceConfigurations-UnorderedServiceConfigurations">Unordered Service Configurations</h1><p>One of Tapestry's features is the ability to package assets (images, style sheets, JavaScript libraries, etc.) inside JAR files and expose those to the client. For example, an application URL /assets/org/example/mylib/mylib.js would refer to a file, myllib.js, stored on the classpath in the /org/example/mylib folder.</p><p>That's fine for most cases, but for certain file extensions, we don't want to allow a client browser to "troll" for the files, as the contents could compromise security. For example, downloading a .class file is bad: a clever client might download one that contains a hard-coded user name or password.</p><p>Thus, for certain file extensions, Tapestry guards the resource by attaching an MD5 digest for the resource to the URL. The checksum is derived from the file contents; thus it can't be spoofed from the client unless the client already has the file contents.</p><p>This is controlled by the <a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/ResourceDigestGenerator.html">ResourceDigestGenerator</a> service, which uses its configuration to determine which file extensions require an MD5 digest.</p><h2 id="IoCcookbookServiceConfigurations-ContributingtoaService">Contributing to a Service</h2><p>Main Article: <a href="tapestry-ioc-configuration.html">Tapestry IoC Configuration< /a></p><p>The Tapestry module makes a contribution into the service configuration:</p><div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div class="codeContent panelContent pdl"> <pre><code class="language-java"> public static void contributeResourceDigestGenerator(Configuration<String> configuration) { configuration.add("class"); @@ -226,26 +207,7 @@ configuration.add("tapestry.jscalendar.path", "org/apache/tapestry5/jscalendar-1.0"); configuration.add("tapestry.jscalendar", "classpath:${tapestry.jscalendar.path}"); }</code></pre> -</div></div><p>These contribution set up a number of defaults used to configure various Tapestry services. As you can see, you can even define symbol values in terms of other symbol values.</p><p>Mapped configurations don't have to be keyed on Strings (enums or Class are other common key types). When a mapped configuration <em>is</em> keyed on String, then a case-insensitive map is used. -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - <a href="ioc-cookbook-patterns.html" rel="prev"> - <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span> - <span class="title">IoC Cookbook - Patterns</span> - </a> - - </div> - <div class="parent"> - <a href="ioc-cookbook.html" rel="parent"> - <span class="aui-icon aui-icon-small atb-icon-arrow-up">Up</span> - <span class="title">IoC cookbook</span> - </a> - - </div> - <div class="next"> - - </div> -</div></div> +</div></div><p>These contribution set up a number of defaults used to configure various Tapestry services. As you can see, you can even define symbol values in terms of other symbol values.</p><p>Mapped configurations don't have to be keyed on Strings (enums or Class are other common key types). When a mapped configuration <em>is</em> keyed on String, then a case-insensitive map is used.</p></div> </div> <!-- /// Content End --> </div> Modified: websites/production/tapestry/content/javascript-faq.html ============================================================================== --- websites/production/tapestry/content/javascript-faq.html (original) +++ websites/production/tapestry/content/javascript-faq.html Tue Mar 7 03:12:12 2023 @@ -142,35 +142,12 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><p> -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - <a href="component-events-faq.html" rel="prev"> - <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span> - <span class="title">Component Events FAQ</span> - </a> + <div id="ConfluenceContent"><h1 id="JavaScriptFAQ-JavaScript">JavaScript</h1><p>Main articles: <a href="client-side-javascript.html">Client-Side JavaScript</a>, <a href="legacy-javascript.html">Legacy JavaScript</a></p><h2 id="JavaScriptFAQ-Contents">Contents</h2><p><style type="text/css">/*<![CDATA[*/ +div.rbtoc1678158717816 {padding: 0px;} +div.rbtoc1678158717816 ul {margin-left: 0px;} +div.rbtoc1678158717816 li {margin-left: 0px;padding-left: 0px;} - </div> - <div class="parent"> - <a 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 href="ajax-components-faq.html" rel="next"> - <span class="title">Ajax Components FAQ</span> - <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span> - </a> - - </div> -</div><h1 id="JavaScriptFAQ-JavaScript">JavaScript</h1><p>Main articles: <a href="client-side-javascript.html">Client-Side JavaScript</a>, <a href="legacy-javascript.html">Legacy JavaScript</a></p><h2 id="JavaScriptFAQ-Contents">Contents</h2><p><style type="text/css">/*<![CDATA[*/ -div.rbtoc1672423915404 {padding: 0px;} -div.rbtoc1672423915404 ul {margin-left: 0px;} -div.rbtoc1672423915404 li {margin-left: 0px;padding-left: 0px;} - -/*]]>*/</style></p><div class="toc-macro rbtoc1672423915404"> +/*]]>*/</style></p><div class="toc-macro rbtoc1678158717816"> <ul class="toc-indentation"><li><a href="#JavaScriptFAQ-WhydoIgeta"Tapestryisundefined"erroronformsubmit?(5.3andearlier)">Why do I get a "Tapestry is undefined" error on form submit? (5.3 and earlier)</a></li><li><a href="#JavaScriptFAQ-What'sthedifferencebetweentheT5objectandtheTapestryobjectinthebrowser?(5.3andearlier)">What's the difference between the T5 object and the Tapestry object in the browser? (5.3 and earlier)</a></li></ul> </div><h2 id="JavaScriptFAQ-WhydoIgeta"Tapestryisundefined"erroronformsubmit?(5.3andearlier)">Why do I get a "Tapestry is undefined" error on form submit? (5.3 and earlier)</h2><p>This client-side error is clear but can be awkward to solve. It means your browser has not been able to load the tapestry.js file properly. The question is, why? It can be due to multiple reasons, some of them below:</p><ul><li>First, check if 'tapestry.js' is present in the head part of your resulting HTML page.</li><li><p>If you have set the <a href="configuration.html">tapestry.combine-scripts</a> configuration symbol to true, Tapestry generates one single URL to retrieve all the JS files. Sometimes, this can produce long URLs that browsers are unable to retrieve. Try setting the symbol to false.</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="confluenc e-information-macro-body"><p>This only applies to Tapestry 5.1.</p></div></div></li><li>If you have included jQuery in conjunction with Tapestry's prototype, that will cause a conflict with the '$' selector used by both. In this case, you should put jQuery on top of the stack and turn on the <a class="external-link" href="http://api.jquery.com/jQuery.noConflict/" rel="nofollow">jQuery.noConflict</a> mode.</li><li>Also, if you have included a custom or third-party JS library on top of the stack that causes the JavaScript parsing to fail, then check the JavaScript syntax in that library.</li><li>If you have used a tool to minimize your JavaScript libraries, this can lead to JavaScript syntax errors, so check if it works with all the JavaScript files unpacked.</li></ul><h2 id="JavaScriptFAQ-What'sthedifferencebetweentheT5objectandtheTapestryobjectinthebrowser?(5.3andearlier)">What's the difference between the <code>T5</code> object and the <code>Tapestry</code> object in the browser? ( 5.3 and earlier)</h2><p>Both of these objects are <em>namespaces</em>: containers of functions, constants, and nested namespaces.</p><p>The <code>T5</code> object is a replacement for the <code>Tapestry</code> object, starting in release 5.3. Increasingly, functions defined by the <code>Tapestry</code> object are being replaced with similar or equivalent functions in the <code>T5</code> object.</p><p>This is part of an overall goal, spanning at least two releases of Tapestry, to make Tapestry JavaScript framework agnostic; which is to say, not depend specifically on Prototype or jQuery. Much of the code in the <code>Tapestry</code> object is specifically linked to Prototype and Scriptaculous.</p><p>The <code>T5</code> object represents a stable, documented, set of APIs that are preferred when building components for maximum portability between underlying JavaScript frameworks. In other words, when building component libraries, coding to the <code>T5</code> object ensures that your c omponent will be useful regardless of whether the final application is built using Prototype, jQuery or something else.</p></div> </div> Modified: websites/production/tapestry/content/meta-programming-page-content.html ============================================================================== --- websites/production/tapestry/content/meta-programming-page-content.html (original) +++ websites/production/tapestry/content/meta-programming-page-content.html Tue Mar 7 03:12:12 2023 @@ -142,30 +142,7 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><p></p> -<div class="atb-scrollbar-macro"> - <div class="prev"> - <a href="extending-the-if-component.html" rel="prev"> - <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span> - <span class="title">Extending the If Component</span> - </a> - - </div> - <div class="parent"> - <a 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 href="using-select-with-a-list.html" rel="next"> - <span class="title">Using Select With a List</span> - <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span> - </a> - - </div> -</div><p></p><h1 id="MetaProgrammingPageContent-Meta-ProgrammingPageContent">Meta-Programming Page Content</h1><p>It is likely that you have some cross-cutting concerns across your pages, specific features you would like to "mix in" to your pages without getting tied into knots by inheritance. This is one of those areas where Tapestry shines.</p><p>This specific example is adapted from a real client requirement: the client was concerned about other sites wrapping his content in a frameset and making the site content appear to be theirs. Not all pages (in some cases, that would be an advantage) but specific pages in the application. For those pages, the following behaviors were required:</p><ul><li>Set the X-Frame-Options response header to "DENY"</li><li>Include JavaScript to "pop" the page out of a frame, if in one</li></ul><p>Again, this <em>could</em> be done by having a specific base-class that included a <code>beginRender()</code> method, but the meta-programming approach is ne arly as easy and much more flexible.</p><h2 id="MetaProgrammingPageContent-ComponentMeta-Data">Component Meta-Data</h2><p>In Tapestry, every component (and remember, pages are components) has <em>meta data</em>: an extra set of key/value pairs stored in the component's <a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ComponentResources.html">ComponentResources</a>.</p><p>By hooking into the component class transformation pipeline, we can change an annotation into meta-data that can be accessed by a filter.</p><h2 id="MetaProgrammingPageContent-DefiningtheAnnotation">Defining the Annotation</h2><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>ForbidFraming.java</b></div><div class="codeContent panelContent pdl"> + <div id="ConfluenceContent"><p></p><p></p><h1 id="MetaProgrammingPageContent-Meta-ProgrammingPageContent">Meta-Programming Page Content</h1><p>It is likely that you have some cross-cutting concerns across your pages, specific features you would like to "mix in" to your pages without getting tied into knots by inheritance. This is one of those areas where Tapestry shines.</p><p>This specific example is adapted from a real client requirement: the client was concerned about other sites wrapping his content in a frameset and making the site content appear to be theirs. Not all pages (in some cases, that would be an advantage) but specific pages in the application. For those pages, the following behaviors were required:</p><ul><li>Set the X-Frame-Options response header to "DENY"</li><li>Include JavaScript to "pop" the page out of a frame, if in one</li></ul><p>Again, this <em>could</em> be done by having a specific base-class that included a <code>beginRender ()</code> method, but the meta-programming approach is nearly as easy and much more flexible.</p><h2 id="MetaProgrammingPageContent-ComponentMeta-Data">Component Meta-Data</h2><p>In Tapestry, every component (and remember, pages are components) has <em>meta data</em>: an extra set of key/value pairs stored in the component's <a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ComponentResources.html">ComponentResources</a>.</p><p>By hooking into the component class transformation pipeline, we can change an annotation into meta-data that can be accessed by a filter.</p><h2 id="MetaProgrammingPageContent-DefiningtheAnnotation">Defining the Annotation</h2><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>ForbidFraming.java</b></div><div class="codeContent panelContent pdl"> <pre><code class="language-java">package com.fnord.annotations; import java.lang.annotation.Documented; Modified: websites/production/tapestry/content/page-navigation.html ============================================================================== --- websites/production/tapestry/content/page-navigation.html (original) +++ websites/production/tapestry/content/page-navigation.html Tue Mar 7 03:12:12 2023 @@ -142,101 +142,12 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><div class="aui-label" style="float:right" title="Related Articles"> + <div id="ConfluenceContent"><img class="wysiwyg-unknown-macro" src="https://cwiki.apache.org/confluence/plugins/servlet/confluence/placeholder/unknown-macro?name=div&locale=en_GB&version=2"><p>In essence, a Tapestry application is a number of related pages, working together. To some degree, each page is like an application unto itself.</p><p>Any individual request will be targeted at a single page. Requests come in two forms: </p><ul><li><em>component event</em> requests target a specific component on a specific page, triggering an event within that component</li><li><em>render</em> requests target a specific page, and stream the HTML markup for that page back to the client</li></ul><p>This dichotomy between component event requests and render requests alleviates a number of problems in traditional web applications related to the browser back button, or to the user hitting the refresh button in their browser.</p><h3 id="PageNavigation-Content s">Contents</h3><h2 id="PageNavigation-Contents|RelatedArticlesLogicalPageNameShortening"><style type="text/css">/*<![CDATA[*/ +div.rbtoc1678158710381 {padding: 0px;} +div.rbtoc1678158710381 ul {margin-left: 0px;} +div.rbtoc1678158710381 li {margin-left: 0px;padding-left: 0px;} - - - - - - - - - -<h3>Related Articles</h3> - -<ul class="content-by-label"><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="content-type-and-markup.html">Content Type and Markup</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="component-rendering.html">Component Rendering</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="page-life-cycle.html">Page Life Cycle</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="component-events.html">Component Events</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="rest-support-580.html">REST Support (5.8.0+)</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="page-navigation.html">Page Navigation</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="request-processing.html">Request Processing</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="component-events-faq.html">Component Events FAQ</a> - - - </div> - </li></ul> -</div> - - -<p>In essence, a Tapestry application is a number of related pages, working together. To some degree, each page is like an application unto itself.</p><p>Any individual request will be targeted at a single page. Requests come in two forms: </p><ul><li><em>component event</em> requests target a specific component on a specific page, triggering an event within that component</li><li><em>render</em> requests target a specific page, and stream the HTML markup for that page back to the client</li></ul><p>This dichotomy between component event requests and render requests alleviates a number of problems in traditional web applications related to the browser back button, or to the user hitting the refresh button in their browser.</p><h3 id="PageNavigation-Contents">Contents</h3><h2 id="PageNavigation-Contents|RelatedArticlesLogicalPageNameShortening"><style type="text/css">/*<![CDATA[*/ -div.rbtoc1672423908186 {padding: 0px;} -div.rbtoc1672423908186 ul {margin-left: 0px;} -div.rbtoc1672423908186 li {margin-left: 0px;padding-left: 0px;} - -/*]]>*/</style></h2><div class="toc-macro rbtoc1672423908186"> +/*]]>*/</style></h2><div class="toc-macro rbtoc1678158710381"> <ul class="toc-indentation"><li><a href="#PageNavigation-Contents|RelatedArticlesLogicalPageNameShortening">Logical Page Name Shortening</a></li><li><a href="#PageNavigation-ComponentEventRequests&Responses">Component Event Requests & Responses</a> <ul class="toc-indentation"><li><a href="#PageNavigation-1.Nullresponse">1. Null response</a></li><li><a href="#PageNavigation-2.Stringresponse">2. String response</a></li><li><a href="#PageNavigation-3.Classresponse">3. Class response</a></li><li><a href="#PageNavigation-4.Pageresponse">4. Page response</a></li><li><a href="#PageNavigation-5.HttpError">5. HttpError</a></li><li><a href="#PageNavigation-6.Linkresponse">6. Link response</a></li><li><a href="#PageNavigation-7.Streamresponse">7. Stream response</a></li><li><a href="#PageNavigation-8.URLresponse">8. URL response</a></li><li><a href="#PageNavigation-9.Objectresponse">9. Object response</a></li></ul> </li><li><a href="#PageNavigation-PageRenderRequests">Page Render Requests</a></li><li><a href="#PageNavigation-PageActivation">Page Activation</a></li><li><a href="#PageNavigation-PageNavigationPatterns">Page Navigation Patterns</a> Modified: websites/production/tapestry/content/persistent-page-data.html ============================================================================== --- websites/production/tapestry/content/persistent-page-data.html (original) +++ websites/production/tapestry/content/persistent-page-data.html Tue Mar 7 03:12:12 2023 @@ -142,51 +142,7 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>The use of the term "persistence" here refers to <em>page-level</em> persistence, NOT database persistence.</p></div></div><p>Most instance variables in Tapestry are automatically cleared at the end of each request. This is important, as it pertains to how Tapestry pages are shared, over time, by many users.</p><div class="aui-label" style="float:right" title="Related Articles"> - - - - - - - - - - -<h3>Related Articles</h3> - -<ul class="content-by-label"><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="performance-and-clustering.html">Performance and Clustering</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="session-storage.html">Session Storage</a> - - - </div> - </li><li> - <div> - <span class="icon aui-icon content-type-page" title="Page">Page:</span> </div> - - <div class="details"> - <a href="persistent-page-data.html">Persistent Page Data</a> - - - </div> - </li></ul> -</div> - - -<p>However, you often want to store some data on a <em>single</em> page, and have access to it in later requests to that same page, without having to store it in a database between requests. (To store values across multiple pages, see <a href="session-storage.html">Session Storage</a>.)</p><p>Making page data persist across requests to a single page is accomplished with the @<a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Persist.html">Persist</a> annotation. This annotation is applied to private instance fields of components:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> + <div id="ConfluenceContent"><div class="confluence-information-macro confluence-information-macro-information"><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>The use of the term "persistence" here refers to <em>page-level</em> persistence, NOT database persistence.</p></div></div><p>Most instance variables in Tapestry are automatically cleared at the end of each request. This is important, as it pertains to how Tapestry pages are shared, over time, by many users.</p><img class="wysiwyg-unknown-macro" src="https://cwiki.apache.org/confluence/plugins/servlet/confluence/placeholder/unknown-macro?name=div&locale=en_GB&version=2"><p>However, you often want to store some data on a <em>single</em> page, and have access to it in later requests to that same page, without having to store it in a database between requests. (To store values across multiple page s, see <a href="session-storage.html">Session Storage</a>.)</p><p>Making page data persist across requests to a single page is accomplished with the @<a class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Persist.html">Persist</a> annotation. This annotation is applied to private instance fields of components:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <pre><code class="language-java"> @Persist private int value; </code></pre> Modified: websites/production/tapestry/content/release-notes-50.html ============================================================================== --- websites/production/tapestry/content/release-notes-50.html (original) +++ websites/production/tapestry/content/release-notes-50.html Tue Mar 7 03:12:12 2023 @@ -142,60 +142,14 @@ <!-- /// Content Start --> <div id="content"> - <div id="ConfluenceContent"><p> -</p><div class="atb-scrollbar-macro"> - <div class="prev"> - <a href="how-to-upgrade.html" rel="prev"> - <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span> - <span class="title">How to Upgrade</span> - </a> + <div id="ConfluenceContent"><p>This is the consolidated list of changes between Tapestry versions 5.0.3 and 5.0.19. Before upgrading, be sure to review the <a href="how-to-upgrade.html">How to Upgrade</a> instructions.</p><p><strong>Contents</strong></p><p><style type="text/css">/*<![CDATA[*/ +div.rbtoc1678158721965 {padding: 0px;} +div.rbtoc1678158721965 ul {margin-left: 0px;padding-left: 5px;} +div.rbtoc1678158721965 li {margin-left: 0px;padding-left: 0px;} - </div> - <div class="parent"> - <a href="release-notes.html" rel="parent"> - <span class="aui-icon aui-icon-small atb-icon-arrow-up">Up</span> - <span class="title">Release Notes</span> - </a> - - </div> - <div class="next"> - <a href="release-notes-51.html" rel="next"> - <span class="title">Release Notes 5.1</span> - <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span> - </a> - - </div> -</div>This is the consolidated list of changes between Tapestry versions 5.0.3 and 5.0.19. Before upgrading, be sure to review the <a href="how-to-upgrade.html">How to Upgrade</a> instructions.<p><strong>Contents</strong></p><p><style type="text/css">/*<![CDATA[*/ -div.rbtoc1672423920310 {padding: 0px;} -div.rbtoc1672423920310 ul {margin-left: 0px;padding-left: 5px;} -div.rbtoc1672423920310 li {margin-left: 0px;padding-left: 0px;} - -/*]]>*/</style></p><div class="toc-macro rbtoc1672423920310"> +/*]]>*/</style></p><div class="toc-macro rbtoc1678158721965"> <ul class="toc-indentation"><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.19">Tapestry Version 5.0.19</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.18">Tapestry Version 5.0.18</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.17">Tapestry Version 5.0.17</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.16">Tapestry Version 5.0.16</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.15">Tapestry Version 5.0.15</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.14">Tapestry Version 5.0.14</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.13">Tapestry Version 5.0.13</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.12">Tapestry Version 5.0.12</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.11">Tapestry Version 5.0.11</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.10">Tapestry Version 5.0.10</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.9">Tapestry Version 5.0.9</a></li><li><a href="#ReleaseNotes5.0-Tapest ryVersion5.0.8">Tapestry Version 5.0.8</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.7">Tapestry Version 5.0.7</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.6">Tapestry Version 5.0.6</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.5">Tapestry Version 5.0.5</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.4">Tapestry Version 5.0.4</a></li><li><a href="#ReleaseNotes5.0-TapestryVersion5.0.3">Tapestry Version 5.0.3</a></li></ul> [... 29 lines stripped ...]