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 Sep 26 19:20:27 2017
@@ -27,16 +27,6 @@
       </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css" />
 
-          <link href='/resources/highlighter/styles/shCoreCXF.css' 
rel='stylesheet' type='text/css' />
-    <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' 
type='text/css' />
-    <script src='/resources/highlighter/scripts/shCore.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushJava.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushXml.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushPlain.js' 
type='text/javascript'></script>
-        <script>
-      SyntaxHighlighter.defaults['toolbar'] = false;
-      SyntaxHighlighter.all();
-    </script>
   
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -77,15 +67,12 @@
       </div>
 
       <div id="content">
-                <div id="ConfluenceContent"><h1 
id="IoCCookbook-OverridingIoCServices-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="IoCCookbook-OverridingI
 oCServices-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 class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">  @Contribute(ServiceOverride.class)
+                <div 
id="ConfluenceContent"><plain-text-body>{scrollbar}</plain-text-body><h1 
id="IoCCookbook-OverridingIoCServices-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="IoCCookbook-OverridingIoCServices-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><parameter ac:name="title">AppModule.java 
(partial)</parameter><parameter 
ac:name="lang">java</parameter><plain-text-body>  
@Contribute(ServiceOverride.class)
   public static void 
setupApplicationServiceOverrides(MappedConfiguration&lt;Class,Object&gt; 
configuration)
   {
     configuration.addInstance(SomeServiceType.class, 
SomeServiceTypeOverrideImpl.class);
   }
-</pre>
-</div></div><p>The name of the method is not important, as long as the @<a  
class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Contribute.html";>Contribute</a>
 annotation is present on the method.</p><p>In this example, we are using 
<code>addInstance()</code> which will instantiate the indicated class and 
handle dependency resolution. (Be careful with this, because in some cases, 
resolving dependencies of the override class can require checking against the 
ServiceOverrides service, and you'll get a runtime exception about 
ServiceOverrides requiring itself!).</p><p>Sometimes you'll want to define the 
override as a service of its own. This is useful if you want to inject a Logger 
specific to the service, or if the overriding implementation needs a <a  
href="tapestry-ioc-configuration.html">service configuration</a>:</p><div 
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader 
panelHeader pdl" style="border-bot
 tom-width: 1px;"><b>AppModule.java (partial)</b></div><div class="codeContent 
panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">  public static void bind(ServiceBinder binder)
+</plain-text-body><p>The name of the method is not important, as long as the 
@<a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Contribute.html";>Contribute</a>
 annotation is present on the method.</p><p>In this example, we are using 
<code>addInstance()</code> which will instantiate the indicated class and 
handle dependency resolution. (Be careful with this, because in some cases, 
resolving dependencies of the override class can require checking against the 
ServiceOverrides service, and you'll get a runtime exception about 
ServiceOverrides requiring itself!).</p><p>Sometimes you'll want to define the 
override as a service of its own. This is useful if you want to inject a Logger 
specific to the service, or if the overriding implementation needs a <a  
href="tapestry-ioc-configuration.html">service configuration</a>:</p><parameter 
ac:name="title">AppModule.java (partial)</parameter><parameter 
ac:name="lang">java</parameter><
 plain-text-body>  public static void bind(ServiceBinder binder)
   {
     binder.bind(SomeServiceType.class, 
SomeServiceTypeOverrideImpl.class).withId("SomeServiceTypeOverride");
   }
@@ -95,14 +82,11 @@
   {
     configuration.add(SomeServiceType.class, override);
   }
-</pre>
-</div></div><p>Here we're defining a service using the module's 
<code>bind()</code> method.</p><p>Every service in the IoC container must have 
a unique id, that's why we used the <code>withId()</code> method; if we we 
hadn't, the default service id would have been "SomeServiceType" which is a 
likely conflict with the very service we're trying to override.</p><p>We can 
inject our overriding implementation of SomeServiceType using the special @<a  
class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Local.html";>Local</a>
 annotation, which indicates that a service within the same module only should 
be injected (that is, services of the indicated type in other modules are 
ignored). Without @Local, there would be a problem because the override 
parameter would need to be resolved using the MasterObjectProvider and, 
ultimately, the ServiceOverride service; this would cause Tapestry to throw an 
exception indicating that ServiceOverride depe
 nds on itself. We defuse that situation by using @Local, which prevents the 
MasterObjectProvider service from being used to resolve the override 
parameter.</p><h2 
id="IoCCookbook-OverridingIoCServices-DecoratingServices">Decorating 
Services</h2><p>Another option is to <a  
href="tapestry-ioc-decorators.html">decorate</a> the existing service. Perhaps 
you want to extend some of the behavior of the service but keep the 
rest.</p><p>Alternately, this approach is useful to override a service that is 
matched using marker annotations.</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 class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">  public SomeServiceType decorateSomeServiceType(final 
SomeServiceType delegate)
+</plain-text-body><p>Here we're defining a service using the module's 
<code>bind()</code> method.</p><p>Every service in the IoC container must have 
a unique id, that's why we used the <code>withId()</code> method; if we we 
hadn't, the default service id would have been "SomeServiceType" which is a 
likely conflict with the very service we're trying to override.</p><p>We can 
inject our overriding implementation of SomeServiceType using the special @<a  
class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Local.html";>Local</a>
 annotation, which indicates that a service within the same module only should 
be injected (that is, services of the indicated type in other modules are 
ignored). Without @Local, there would be a problem because the override 
parameter would need to be resolved using the MasterObjectProvider and, 
ultimately, the ServiceOverride service; this would cause Tapestry to throw an 
exception indicating that ServiceOverrid
 e depends on itself. We defuse that situation by using @Local, which prevents 
the MasterObjectProvider service from being used to resolve the override 
parameter.</p><h2 
id="IoCCookbook-OverridingIoCServices-DecoratingServices">Decorating 
Services</h2><p>Another option is to <a  
href="tapestry-ioc-decorators.html">decorate</a> the existing service. Perhaps 
you want to extend some of the behavior of the service but keep the 
rest.</p><p>Alternately, this approach is useful to override a service that is 
matched using marker annotations.</p><parameter ac:name="title">AppModule.java 
(partial)</parameter><parameter 
ac:name="lang">java</parameter><plain-text-body>  public SomeServiceType 
decorateSomeServiceType(final SomeServiceType delegate)
   {
     return new SomeServiceType() { . . . };
   }
-</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>&#160;</p><p>&#160;</p></div>
+</plain-text-body><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>&#160;</p><p>&#160;</p><plain-text-body>{scrollbar}</plain-text-body></div>
       </div>
 
       <div class="clearer"></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 Sep 26 
19:20:27 2017
@@ -27,16 +27,6 @@
       </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css" />
 
-          <link href='/resources/highlighter/styles/shCoreCXF.css' 
rel='stylesheet' type='text/css' />
-    <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' 
type='text/css' />
-    <script src='/resources/highlighter/scripts/shCore.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushJava.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushXml.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushPlain.js' 
type='text/javascript'></script>
-        <script>
-      SyntaxHighlighter.defaults['toolbar'] = false;
-      SyntaxHighlighter.all();
-    </script>
   
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -77,65 +67,11 @@
       </div>
 
       <div id="content">
-                <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><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 aui-icon-small 
aui-iconfont-page-default" 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 aui-icon-small 
aui-iconfont-page-default" 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 aui-icon-small 
aui-iconfont-page-default" 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 aui-icon-small 
aui-iconfont-page-default" 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="IoCCookbook-Patterns-chainofcommand"></span></p><h1 
id="IoCCookbook-Patterns-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 class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">public interface InjectionProvider
+                <div 
id="ConfluenceContent"><p><plain-text-body>{scrollbar}</plain-text-body>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><parameter 
ac:name="style">float:right</parameter><parameter ac:name="title">Related 
Articles</parameter><parameter 
ac:name="class">aui-label</parameter><rich-text-body><parameter 
ac:name="showLabels">false</parameter><parameter 
ac:name="showSpace">false</parameter><parameter ac:name="title">Related 
Articles</parameter><parameter ac:name="cql">label = "patterns" and space = 
currentSpace()</parameter></rich-text-body><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><parameter 
ac:name="">chainofcommand</parameter></p><h1 
id="IoCCookbook-Patterns-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><parameter 
ac:name="language">java</parameter><plain-text-body>public interface 
InjectionProvider
 {
   boolean provideInjection(String fieldName, Class fieldType, ObjectLocator 
locator,
       ClassTransformation transformation, MutableComponentModel 
componentModel);
-}</pre>
-</div></div><p>The return type indicates whether the provider was able to do 
something. For example, the AssetInjectionProvider checks to see if there's an 
@Path annotation on the field, and if so, converts the path to an asset, works 
with the ClassTransformation object to implement injection, and returns true to 
indicate success. Returning true terminates the chain early, and that true 
value is ultimately returned to the caller.</p><p>In other cases, it returns 
false and the chain of command continues down to the next provider. If no 
provider is capable of handling the injection, then the value false is 
ultimately returned.</p><p>The InjectionProvider service is built up via 
contributions. These are the contributions from the TapestryModule:</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;">public static void contributeInjectionProvider(
+}</plain-text-body><p>The return type indicates whether the provider was able 
to do something. For example, the AssetInjectionProvider checks to see if 
there's an @Path annotation on the field, and if so, converts the path to an 
asset, works with the ClassTransformation object to implement injection, and 
returns true to indicate success. Returning true terminates the chain early, 
and that true value is ultimately returned to the caller.</p><p>In other cases, 
it returns false and the chain of command continues down to the next provider. 
If no provider is capable of handling the injection, then the value false is 
ultimately returned.</p><p>The InjectionProvider service is built up via 
contributions. These are the contributions from the 
TapestryModule:</p><parameter 
ac:name="language">java</parameter><plain-text-body>public static void 
contributeInjectionProvider(
     OrderedConfiguration&lt;InjectionProvider&gt; configuration,
     MasterObjectProvider masterObjectProvider,
     ObjectLocator locator,
@@ -152,14 +88,10 @@
 
   configuration.add("Block", new BlockInjectionProvider(), "before:Default");
   configuration.add("Service", new ServiceInjectionProvider(locator), 
"after:*");
-}</pre>
-</div></div><p>And, of course, other contributions could be made in other 
modules ... if you wanted to add in your own form of injection.</p><p>The 
configuration is converted into a service via a service builder method:</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;">  public InjectionProvider 
build(List&lt;InjectionProvider&gt; configuration, ChainBuilder chainBuilder)
+}</plain-text-body><p>And, of course, other contributions could be made in 
other modules ... if you wanted to add in your own form of injection.</p><p>The 
configuration is converted into a service via a service builder 
method:</p><parameter ac:name="language">java</parameter><plain-text-body>  
public InjectionProvider build(List&lt;InjectionProvider&gt; configuration, 
ChainBuilder chainBuilder)
   {
     return chainBuilder.build(InjectionProvider.class, configuration);
-  }</pre>
-</div></div><p>Now, let's see how this is used. The InjectWorker class looks 
for fields with the InjectAnnotation, and uses the chain of command to inject 
the appropriate value. However, to InjectWorker, there is no chain ... just a 
<em>single</em> object that implements the InjectionProvider interface.</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;">public class InjectWorker implements 
ComponentClassTransformWorker
+  }</plain-text-body><p>Now, let's see how this is used. The InjectWorker 
class looks for fields with the InjectAnnotation, and uses the chain of command 
to inject the appropriate value. However, to InjectWorker, there is no chain 
... just a <em>single</em> object that implements the InjectionProvider 
interface.</p><parameter 
ac:name="language">java</parameter><plain-text-body>public class InjectWorker 
implements ComponentClassTransformWorker
 {
   private final ObjectLocator locator;
 
@@ -202,8 +134,7 @@
 
     }
   }
-}</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>
+}</plain-text-body><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.<plain-text-body>{scrollbar}</plain-text-body></p></div>
       </div>
 
       <div class="clearer"></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 Sep 26 19:20:27 2017
@@ -27,16 +27,6 @@
       </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css" />
 
-          <link href='/resources/highlighter/styles/shCoreCXF.css' 
rel='stylesheet' type='text/css' />
-    <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' 
type='text/css' />
-    <script src='/resources/highlighter/scripts/shCore.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushJava.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushXml.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushPlain.js' 
type='text/javascript'></script>
-        <script>
-      SyntaxHighlighter.defaults['toolbar'] = false;
-      SyntaxHighlighter.all();
-    </script>
   
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -77,7 +67,7 @@
       </div>
 
       <div id="content">
-                <div id="ConfluenceContent">
+                <div 
id="ConfluenceContent"><plain-text-body>{scrollbar}</plain-text-body>
 
 <h1 id="IoCcookbook-ServiceConfigurations-ServiceConfigurations">Service 
Configurations</h1>
 
@@ -101,14 +91,12 @@
 
 <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 class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">
+<parameter ac:name="borderStyle">solid</parameter><plain-text-body>
   public static void 
contributeResourceDigestGenerator(Configuration&lt;String&gt; configuration)
   {
     configuration.add("class");
     configuration.add("tml");
-  }</pre>
-</div></div>
+  }</plain-text-body>
 
 <p>This is a <em>service contribution method</em>, a method that is invoked to 
provide values for a configuration. We'll see how the service receives these 
contributions shortly. The <a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/Configuration.html";>Configuration</a>
 object is how values are added to the service's configuration. Other 
parameters to a service configuration method are injected much as with a 
service's constructor, or a service builder method.</p>
 
@@ -118,16 +106,14 @@
 
 <p>Say your application stored a file on the classpath needed by your 
application; for illustrative purposes, perhaps it is a PGP private key. You 
don't want any client to able to download a .pgp file, no matter how unlikely 
that would be. Thus:</p>
 
-<div class="code panel pdl" style="border-style: solid;border-width: 
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">
+<parameter ac:name="borderStyle">solid</parameter><plain-text-body>
 public class MyAppModule
 {
  public static void 
contributeResourceDigestGenerator(Configuration&lt;String&gt; configuration)
  {
    configuration.add("pgp");
  }
-}</pre>
-</div></div>
+}</plain-text-body>
 
 <p>The contribution in MyAppModule doesn't <em>replace</em> the normal 
contribution, it is <em>combined</em>. The end result is that .class, .tml and 
.pgp files would <em>all</em> be protected.</p>
 
@@ -135,8 +121,7 @@ public class MyAppModule
 
 <p>A service receives the configuration as an injected parameter ... not of 
type Configuration (that's used for <em>making</em> contributions), but instead 
is of type Collection:</p>
 
-<div class="code panel pdl" style="border-style: solid;border-width: 
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">
+<parameter ac:name="borderStyle">solid</parameter><plain-text-body>
 public class ResourceDigestGeneratorImpl implements ResourceDigestGenerator
 {
   private final Set&lt;String&gt; digestExtensions;
@@ -147,8 +132,7 @@ public class ResourceDigestGeneratorImpl
   }
 
   . . .
-}</pre>
-</div></div>
+}</plain-text-body>
 
 <p>In many cases, the configuration is simply stored into an instance 
variable; in this example, the value is transformed from a Collection to a 
Set.</p>
 
@@ -162,8 +146,7 @@ public class ResourceDigestGeneratorImpl
 
 <p>Alternately, if the Request can't be handled, the Dispatcher returns 
false.</p>
 
-<div class="code panel pdl" style="border-style: solid;border-width: 
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">
+<parameter ac:name="borderStyle">solid</parameter><plain-text-body>
 public void contributeMasterDispatcher(OrderedConfiguration&lt;Dispatcher&gt; 
configuration, . . .)
 {
   // Looks for the root path and renders the start page
@@ -181,8 +164,7 @@ public void contributeMasterDispatcher(O
   configuration.add("PageRender", new PageRenderDispatcher(. . .));
 
   configuration.add("ComponentAction", new ComponentActionDispatcher(. . .), 
"after:PageRender");
-}</pre>
-</div></div>
+}</plain-text-body>
 
 <p>With an <a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/OrderedConfiguration.html";>OrderedConfiguration</a>,
 each contribution gets a name, which must be unique. Here the names are 
RootPath, Asset, PageRender and ComponentAction.</p>
 
@@ -198,13 +180,11 @@ public void contributeMasterDispatcher(O
 
 <p>The MasterDispatcher service configuration defines a <a  
href="chainbuilder-service.html">Chain of Command</a> and we can provide the 
implementation using virtually no code:</p>
 
-<div class="code panel pdl" style="border-style: solid;border-width: 
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">
+<parameter ac:name="borderStyle">solid</parameter><plain-text-body>
   public static Dispatcher buildMasterDispatcher(List&lt;Dispatcher&gt; 
configuration, ChainBuilder chainBuilder)
   {
     return chainBuilder.build(Dispatcher.class, configuration);
-  }</pre>
-</div></div>
+  }</plain-text-body>
 
 <p><a  class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/ChainBuilder.html";>ChainBuilder</a>
 is a service that <em>builds other services</em>. Here it creates an object of 
type Dispatcher in terms of the list of Dispatchers. This is one of the most 
common uses of service builder methods ... for when the service implementation 
doesn't exist, but can be constructed at runtime.</p>
 
@@ -216,8 +196,7 @@ public void contributeMasterDispatcher(O
 
 <p>The first step is to contribute values.</p>
 
-<div class="code panel pdl" style="border-style: solid;border-width: 
1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" 
style="font-size:12px;">
+<parameter ac:name="borderStyle">solid</parameter><plain-text-body>
   public static void contributeFactoryDefaults(MappedConfiguration&lt;String, 
String&gt; configuration)
   {
     configuration.add(SymbolConstants.FILE_CHECK_INTERVAL, "1000"); // 1 second
@@ -231,13 +210,13 @@ public void contributeMasterDispatcher(O
             "org/apache/tapestry5/scriptaculous_1_7_1_beta_3");
     configuration.add("tapestry.jscalendar.path", 
"org/apache/tapestry5/jscalendar-1.0");
     configuration.add("tapestry.jscalendar", 
"classpath:${tapestry.jscalendar.path}");
-  }</pre>
-</div></div>
+  }</plain-text-body>
 
 <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>
+
+<plain-text-body>{scrollbar}</plain-text-body></div>
       </div>
 
       <div class="clearer"></div>

Modified: websites/production/tapestry/content/ioc-cookbook.html
==============================================================================
--- websites/production/tapestry/content/ioc-cookbook.html (original)
+++ websites/production/tapestry/content/ioc-cookbook.html Tue Sep 26 19:20:27 
2017
@@ -27,16 +27,6 @@
       </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css" />
 
-          <link href='/resources/highlighter/styles/shCoreCXF.css' 
rel='stylesheet' type='text/css' />
-    <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' 
type='text/css' />
-    <script src='/resources/highlighter/scripts/shCore.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushJava.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushXml.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushPlain.js' 
type='text/javascript'></script>
-        <script>
-      SyntaxHighlighter.defaults['toolbar'] = false;
-      SyntaxHighlighter.all();
-    </script>
   
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -77,58 +67,7 @@
       </div>
 
       <div id="content">
-                <div id="ConfluenceContent"><p>Tapestry <strong>Inversion of 
Control</strong> (IoC), though originally designed specifically for the needs 
of the Tapestry web framework, may also be employed as a stand-alone IoC 
container, separate from the rest of Tapestry.</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 aui-icon-small 
aui-iconfont-page-default" title="Page">Page:</span>        </div>
-
-        <div class="details">
-                        <a  href="ioc.html">IOC</a>
-                
-                        
-                    </div>
-    </li><li>
-        <div>
-                <span class="icon aui-icon aui-icon-small 
aui-iconfont-page-default" title="Page">Page:</span>        </div>
-
-        <div class="details">
-                        <a  href="ioc-cookbook.html">IoC cookbook</a>
-                
-                        
-                    </div>
-    </li><li>
-        <div>
-                <span class="icon aui-icon aui-icon-small 
aui-iconfont-page-default" title="Page">Page:</span>        </div>
-
-        <div class="details">
-                        <a  href="tapestry-ioc-overview.html">Tapestry IoC 
Overview</a>
-                
-                        
-                    </div>
-    </li><li>
-        <div>
-                <span class="icon aui-icon aui-icon-small 
aui-iconfont-page-default" title="Page">Page:</span>        </div>
-
-        <div class="details">
-                        <a  
href="tapestry-inversion-of-control-faq.html">Tapestry Inversion of Control 
FAQ</a>
-                
-                        
-                    </div>
-    </li></ul>
-</div>
-
-
-<p>Tapestry IoC is a sophisticated tool that takes some experience to use 
properly.</p><p>The IOC documentation in the User Guide is factually correct, 
but it is designed more as a reference, rather than giving the big picture. In 
this Cookbook, we'll show a bit more about how to use Tapestry IoC, using real 
examples from the Tapestry code base (both the tapestry-ioc and tapestry-core 
modules).</p><p>A word of caution: several of the examples have been taken from 
Tapestry's <em>internal</em> code base. Tapestry internals are private, subject 
to change at any time, so be aware that if you go peeking at the internal 
source code, it may have changed since the corresponding documentation was 
written.</p><p><strong>Contents:</strong></p><ul><li><a  
href="ioc-cookbook-basic-services-and-injection.html">Basic Services and 
Injection</a></li><li><a  
href="ioc-cookbook-overriding-ioc-services.html">Overriding Tapestry IoC 
Services</a></li><li><a  href="ioc-cookbook-patterns.html">Using Patter
 ns</a></li><li><a  href="ioc-cookbook-service-configurations.html">Service 
Configurations</a></li></ul></div>
+                <div 
id="ConfluenceContent"><p><plain-text-body>{scrollbar}</plain-text-body></p><parameter
 ac:name="hidden">true</parameter><parameter 
ac:name="atlassian-macro-output-type">BLOCK</parameter><rich-text-body><p>A 
tutorial for using Tapestry's Inversion of Control 
container</p></rich-text-body><p>Tapestry <strong>Inversion of Control</strong> 
(IoC), though originally designed specifically for the needs of the Tapestry 
web framework, may also be employed as a stand-alone IoC container, separate 
from the rest of Tapestry.</p><parameter 
ac:name="style">float:right</parameter><parameter ac:name="title">Related 
Articles</parameter><parameter 
ac:name="class">aui-label</parameter><rich-text-body><parameter 
ac:name="showLabels">false</parameter><parameter 
ac:name="showSpace">false</parameter><parameter ac:name="title">Related 
Articles</parameter><parameter ac:name="cql">label = "ioc" and space = 
currentSpace()</parameter></rich-text-body><p>Tapestry IoC is a sophisticated 
tool
  that takes some experience to use properly.</p><p>The IOC documentation in 
the User Guide is factually correct, but it is designed more as a reference, 
rather than giving the big picture. In this Cookbook, we'll show a bit more 
about how to use Tapestry IoC, using real examples from the Tapestry code base 
(both the tapestry-ioc and tapestry-core modules).</p><p>A word of caution: 
several of the examples have been taken from Tapestry's <em>internal</em> code 
base. Tapestry internals are private, subject to change at any time, so be 
aware that if you go peeking at the internal source code, it may have changed 
since the corresponding documentation was 
written.</p><p><strong>Contents:</strong></p><ul><li><a  
href="ioc-cookbook-basic-services-and-injection.html">Basic Services and 
Injection</a></li><li><a  
href="ioc-cookbook-overriding-ioc-services.html">Overriding Tapestry IoC 
Services</a></li><li><a  href="ioc-cookbook-patterns.html">Using 
Patterns</a></li><li><a  href="ioc-cookbook-s
 ervice-configurations.html">Service Configurations</a></li></ul></div>
       </div>
 
       <div class="clearer"></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 Sep 26 
19:20:27 2017
@@ -27,16 +27,6 @@
       </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css" />
 
-          <link href='/resources/highlighter/styles/shCoreCXF.css' 
rel='stylesheet' type='text/css' />
-    <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' 
type='text/css' />
-    <script src='/resources/highlighter/scripts/shCore.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushJava.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushXml.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushPlain.js' 
type='text/javascript'></script>
-        <script>
-      SyntaxHighlighter.defaults['toolbar'] = false;
-      SyntaxHighlighter.all();
-    </script>
   
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -77,7 +67,7 @@
       </div>
 
       <div id="content">
-                <div id="ConfluenceContent"><h2 
id="JavaScriptFAQ-JavaScript">JavaScript</h2><p>Main article: <a  
href="legacy-javascript.html">Legacy JavaScript</a></p><h3 
id="JavaScriptFAQ-WhydoIgeta&quot;Tapestryisundefined&quot;erroronformsubmit?(5.3andearlier)">Why
 do I get a "Tapestry is undefined" error on form submit? (5.3 and 
earlier)</h3><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  
class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/SymbolConstants.html#COMBINE_SCRIPTS";>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 tha
 t 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="confluence-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><h3 
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)</h3><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 component will be useful regardless of 
whether the final application is built using Prototype, jQuery or something 
else.</p></div>
+                <div 
id="ConfluenceContent"><plain-text-body>{scrollbar}</plain-text-body><h2 
id="JavaScriptFAQ-JavaScript">JavaScript</h2><p>Main article: <a  
href="legacy-javascript.html">Legacy JavaScript</a></p><h3 
id="JavaScriptFAQ-WhydoIgeta&quot;Tapestryisundefined&quot;erroronformsubmit?(5.3andearlier)">Why
 do I get a "Tapestry is undefined" error on form submit? (5.3 and 
earlier)</h3><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  
class="external-link" 
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/SymbolConstants.html#COMBINE_SCRIPTS";>tapestry.combine-scripts</a>
 configuration symbol to true, Tapestry generates one single URL to retrieve 
all the JS fi
 les. Sometimes, this can produce long URLs that browsers are unable to 
retrieve. Try setting the symbol to false.</p><rich-text-body><p>This only 
applies to Tapestry 5.1.</p></rich-text-body></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><h3 
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)</h3><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 framew
 orks. In other words, when building component libraries, coding to the 
<code>T5</code> object ensures that your component will be useful regardless of 
whether the final application is built using Prototype, jQuery or something 
else.</p></div>
       </div>
 
       <div class="clearer"></div>

Modified: websites/production/tapestry/content/limitations.html
==============================================================================
--- websites/production/tapestry/content/limitations.html (original)
+++ websites/production/tapestry/content/limitations.html Tue Sep 26 19:20:27 
2017
@@ -27,16 +27,6 @@
       </title>
   <link type="text/css" rel="stylesheet" href="/resources/space.css" />
 
-          <link href='/resources/highlighter/styles/shCoreCXF.css' 
rel='stylesheet' type='text/css' />
-    <link href='/resources/highlighter/styles/shThemeCXF.css' rel='stylesheet' 
type='text/css' />
-    <script src='/resources/highlighter/scripts/shCore.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushJava.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushXml.js' 
type='text/javascript'></script>
-          <script src='/resources/highlighter/scripts/shBrushPlain.js' 
type='text/javascript'></script>
-        <script>
-      SyntaxHighlighter.defaults['toolbar'] = false;
-      SyntaxHighlighter.all();
-    </script>
   
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -77,8 +67,7 @@
       </div>
 
       <div id="content">
-                <div id="ConfluenceContent"><h2 
id="Limitations-Limitations">Limitations</h2><h3 
id="Limitations-HowdoIaddnewcomponentstoanexistingpagedynamically?">How do I 
add new components to an existing page dynamically?</h3><p>The short answer 
here is: <strong>you don't</strong>. The long answer here is <strong>you don't 
have to, to get the behavior you desire</strong>.</p><p>One of Tapestry basic 
values is high scalability: this is expressed in a number of ways, reflecting 
scalability concerns within a single server, and within a cluster of 
servers.</p><p>Although you code Tapestry pages and components as if they were 
ordinary POJOs (<span style="line-height: 1.4285715;">Plain Old Java Objects -- 
Tapestry does not require you to extend any base classes or implement any 
special interfaces)</span><span style="line-height: 1.4285715;">, as deployed 
by Tapestry they are closer to a traditional servlet: a single instance of each 
page services requests from multiple threads. Behind
  the scenes, Tapestry transforms you code, rewriting it on the 
fly.</span></p><p>What this means is that <em>any</em> incoming request must be 
handled by a <em>single page instance</em>. Therefore, Tapestry enforces the 
concept of <strong>static structure, dynamic behavior</strong>.</p><p>Tapestry 
provides quite a number of ways to vary what content is rendered, well beyond 
simple conditionals and loops. It is possible to "drag in" components from 
other pages when rendering a page (other FAQs will expand on this concept). The 
point is, that although a Tapestry page's structure is very rigid, the order in 
which the components of the page render does not have to be top to 
bottom.</p><h3 
id="Limitations-Whydoesn'tmyserviceimplementationreloadwhenIchangeit?">Why 
doesn't my service implementation reload when I change it?</h3><p>Main article: 
<a  href="service-implementation-reloading.html">Service Implementation 
Reloading</a></p><p>Live service reloading has some limitations:</p><ul><li>
 The service must define a service interface.</li><li>The service 
implementation must be on the file system (not inside a JAR).</li><li>The 
implementation must be instantiated by Tapestry, not inside code (even code 
inside a module class).</li><li>The service must use the default <a  
href="defining-tapestry-ioc-services.html">scope</a> (reloading of perthread 
scopes is not supported).</li></ul><p>Consider the following example 
module:</p><div class="code panel pdl" style="border-width: 1px;"><div 
class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: true; theme: Default" 
style="font-size:12px;">public static void bind(ServiceBinder binder)
+                <div 
id="ConfluenceContent"><plain-text-body>{scrollbar}</plain-text-body><h2 
id="Limitations-Limitations">Limitations</h2><h3 
id="Limitations-HowdoIaddnewcomponentstoanexistingpagedynamically?">How do I 
add new components to an existing page dynamically?</h3><p>The short answer 
here is: <strong>you don't</strong>. The long answer here is <strong>you don't 
have to, to get the behavior you desire</strong>.</p><p>One of Tapestry basic 
values is high scalability: this is expressed in a number of ways, reflecting 
scalability concerns within a single server, and within a cluster of 
servers.</p><p>Although you code Tapestry pages and components as if they were 
ordinary POJOs (<span style="line-height: 1.4285715;">Plain Old Java Objects -- 
Tapestry does not require you to extend any base classes or implement any 
special interfaces)</span><span style="line-height: 1.4285715;">, as deployed 
by Tapestry they are closer to a traditional servlet: a single instance of each 
page s
 ervices requests from multiple threads. Behind the scenes, Tapestry transforms 
you code, rewriting it on the fly.</span></p><p>What this means is that 
<em>any</em> incoming request must be handled by a <em>single page 
instance</em>. Therefore, Tapestry enforces the concept of <strong>static 
structure, dynamic behavior</strong>.</p><p>Tapestry provides quite a number of 
ways to vary what content is rendered, well beyond simple conditionals and 
loops. It is possible to "drag in" components from other pages when rendering a 
page (other FAQs will expand on this concept). The point is, that although a 
Tapestry page's structure is very rigid, the order in which the components of 
the page render does not have to be top to bottom.</p><h3 
id="Limitations-Whydoesn'tmyserviceimplementationreloadwhenIchangeit?">Why 
doesn't my service implementation reload when I change it?</h3><p>Main article: 
<a  href="service-implementation-reloading.html">Service Implementation 
Reloading</a></p><p>Live servi
 ce reloading has some limitations:</p><ul><li>The service must define a 
service interface.</li><li>The service implementation must be on the file 
system (not inside a JAR).</li><li>The implementation must be instantiated by 
Tapestry, not inside code (even code inside a module class).</li><li>The 
service must use the default <a  
href="defining-tapestry-ioc-services.html">scope</a> (reloading of perthread 
scopes is not supported).</li></ul><p>Consider the following example 
module:</p><parameter ac:name="controls">true</parameter><parameter 
ac:name="linenumbers">true</parameter><plain-text-body>public static void 
bind(ServiceBinder binder)
 {
   binder.bind(ArchiveService.class, ArchiveServiceImpl.class);
 }
@@ -91,8 +80,7 @@ public static JobQueue buildJobQueue(Mes
  
   return service;
 }
-</pre>
-</div></div><p>ArchiveService is reloadable, because Tapestry instantiates 
<code>ArchiveServiceImpl</code> itself. On the other hand, Tapestry invokes 
<code>buildJobQueue()</code> and it is your code inside the method that 
instantiates <code>JobQueueImpl</code>, so the JobQueue service will not be 
reloadable.</p><p>Finally, only classes whose class files are stored directly 
on the file system, and not packaged inside JARs, are ever reloadable ... 
generally, only the services of the application being built (and not services 
from libraries) will be stored on the file system. This reflects the intent of 
reloading: as an agile development tool, but not something to be used in 
deployment.</p><h3 
id="Limitations-HowdoIrunmultipleTapestryapplicationsinthesamewebapplication?">How
 do I run multiple Tapestry applications in the same web 
application?</h3><p>Running multiple Tapestry 5 applications is not supported; 
there's only one place to identify the application root package, so even config
 uring multiple filters into multiple folders will not work.</p><p>Support for 
multiple Tapestry applications in the same web application was a specific 
non-goal in Tapestry 5 (it needlessly complicated Tapestry 4). Given how 
loosely connected Tapestry 5 pages are from each other, there doesn't seem to 
be an advantage to doing so ... and certainly, in terms of memory utilization, 
there is a significant down side, were it even 
possible.</p><p>You&#160;<em>can</em>&#160;<span style="color: rgb(0,0,0);">run 
a Tapestry 4 app and a Tapestry 5 app side-by-side (the package names are 
different, for just this reason), but they know nothing of each other, and 
can't interact directly. This is just like the way you could have a single WAR 
with multiple servlets; the different applications can only communicate via 
URLs, or shared state in the 
HttpSession.</span></p><p>&#160;</p><p>&#160;</p><p>&#160;</p></div>
+</plain-text-body><p>ArchiveService is reloadable, because Tapestry 
instantiates <code>ArchiveServiceImpl</code> itself. On the other hand, 
Tapestry invokes <code>buildJobQueue()</code> and it is your code inside the 
method that instantiates <code>JobQueueImpl</code>, so the JobQueue service 
will not be reloadable.</p><p>Finally, only classes whose class files are 
stored directly on the file system, and not packaged inside JARs, are ever 
reloadable ... generally, only the services of the application being built (and 
not services from libraries) will be stored on the file system. This reflects 
the intent of reloading: as an agile development tool, but not something to be 
used in deployment.</p><h3 
id="Limitations-HowdoIrunmultipleTapestryapplicationsinthesamewebapplication?">How
 do I run multiple Tapestry applications in the same web 
application?</h3><p>Running multiple Tapestry 5 applications is not supported; 
there's only one place to identify the application root package, so even 
 configuring multiple filters into multiple folders will not 
work.</p><p>Support for multiple Tapestry applications in the same web 
application was a specific non-goal in Tapestry 5 (it needlessly complicated 
Tapestry 4). Given how loosely connected Tapestry 5 pages are from each other, 
there doesn't seem to be an advantage to doing so ... and certainly, in terms 
of memory utilization, there is a significant down side, were it even 
possible.</p><p>You&#160;<em>can</em>&#160;<span style="color: rgb(0,0,0);">run 
a Tapestry 4 app and a Tapestry 5 app side-by-side (the package names are 
different, for just this reason), but they know nothing of each other, and 
can't interact directly. This is just like the way you could have a single WAR 
with multiple servlets; the different applications can only communicate via 
URLs, or shared state in the 
HttpSession.</span></p><plain-text-body>{scrollbar}</plain-text-body><p>&#160;</p><p>&#160;</p><p>&#160;</p></div>
       </div>
 
       <div class="clearer"></div>


Reply via email to