You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by bu...@apache.org on 2015/06/27 23:21:05 UTC

svn commit: r956226 [19/34] - in /websites/production/tapestry/content: ./ 2010/10/11/ 2010/10/31/ 2010/11/18/ 2010/11/19/ 2010/12/16/ 2010/12/17/ 2011/01/10/ 2011/03/29/ 2011/06/13/ 2011/06/24/ 2011/06/29/ 2011/07/29/ 2011/08/16/ 2011/08/27/ 2011/10/3...

Modified: websites/production/tapestry/content/injection-in-detail.html
==============================================================================
--- websites/production/tapestry/content/injection-in-detail.html (original)
+++ websites/production/tapestry/content/injection-in-detail.html Sat Jun 27 21:21:02 2015
@@ -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 type="text/javascript">
-  SyntaxHighlighter.defaults['toolbar'] = false;
-  SyntaxHighlighter.all();
-  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -55,7 +45,7 @@
   <input type="submit" value="Search">
 </form>
 
-</div><div class="emblem" style="float:left"><p><a shape="rect" href="index.html"><img class="confluence-embedded-image confluence-external-resource" src="http://tapestry.apache.org/images/tapestry_small.png" data-image-src="http://tapestry.apache.org/images/tapestry_small.png"></a></p></div><div class="title" style="float:left; margin: 0 0 0 3em"><h1 id="SmallBanner-PageTitle">Injection in Detail</h1></div></div>
+</div><div class="emblem" style="float:left"><p><a shape="rect" href="index.html"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://tapestry.apache.org/images/tapestry_small.png" data-image-src="http://tapestry.apache.org/images/tapestry_small.png"></span></a></p></div><div class="title" style="float:left; margin: 0 0 0 3em"><h1 id="SmallBanner-PageTitle">Injection in Detail</h1></div></div>
 <div class="clearer"></div>
 </div>
 
@@ -76,61 +66,8 @@ table.ScrollbarTable td.ScrollbarNextNam
 table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}
 
 /*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="strategybuilder-service.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif" width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName" width="33%"><a shape="rect" href="strategybuilder-service.html">StrategyBuilder Service</a>&#160;</td><td colspan="1" rowspan="1" class="ScrollbarParent" width="33%"><sup><a shape="rect" href="ioc.html"><img align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif" width="8" height="8"></a></sup><a shape="rect" href="ioc.html">IoC</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName" width="33%">&#160;<a shape="rect" href="object-providers.html">Object Providers</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a shape="rect" href="object-providers.html"><img align="middle" 
 border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16" height="16"></a></td></tr></table></div><h1 id="InjectioninDetail-InjectioninDetail">Injection in Detail</h1><div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
-<h3>Related Articles</h3>
-<ul class="content-by-label"><li>
-            <div>
-                    <span class="icon icon-page" title="Page">Page:</span>            </div>
-
-            <div class="details">
-                            <a shape="rect" href="injection.html">Injection</a>
-                    
-                
-                            </div>
-        </li><li>
-            <div>
-                    <span class="icon icon-page" title="Page">Page:</span>            </div>
-
-            <div class="details">
-                            <a shape="rect" href="injection-faq.html">Injection FAQ</a>
-                    
-                
-                            </div>
-        </li><li>
-            <div>
-                    <span class="icon icon-page" title="Page">Page:</span>            </div>
-
-            <div class="details">
-                            <a shape="rect" href="injection-in-detail.html">Injection in Detail</a>
-                    
-                
-                            </div>
-        </li></ul>
-</div><p>Injection in Tapestry IoC can be a complicated subject for a number of reasons:</p><ul><li>Injection can occur in many places: on fields, and on parameters to methods and constructors of certain objects.</li><li>Parts of Injection are themselves defined in terms of Tapestry IoC services, many of which are extensible.</li></ul><p>Despite this, injection generally <em>Just Works</em>: most of the time, you want Tapestry to inject a service, and only a single service implements the service interface.</p><p>This document discusses what to do when you hit a case that doesn't Just Work, or when you want to extend the injection logic in some way.</p><p>Some aspects of this discussion reflect Tapestry IoC used within a Tapestry web application: the tapestry-core module makes some extensions to injection.</p><h1 id="InjectioninDetail-InjectionTriggers">Injection Triggers</h1><p>Injection is triggered in a number of ways:</p><ul><li>A field in a component class, autobuilt object, or 
 service implementation class is annotated with @Inject.</li><li>A method parameter to a service builder method, a decorator method, or a contribute method (in a Tapestry IoC module class).</li><li>A constructor parameter to an autobuilt object, or a service implementation class.</li><li>Any of the above with an @InjectService annotation.</li></ul><p>These define the&#160;<em>point of injection</em>.</p><p>Injection also covers a related matter: providing special resources to a service or component (remember that pages are specialized components). For a service, the service's id (as a string) or extensible configuration (as a Collection, List or Map) may be provided. For a component, the component's id, locale, message catalog, or component resources may be provided.</p><h1 id="InjectioninDetail-StandardInjectionProcessing">Standard Injection Processing</h1><p>This section describes standard injection, which applies at the IoC layer: autobuilt objects and service implementations. The
  steps for injection into Tapestry components are slightly different and are covered later.</p><p>So a the point of injection, Tapestry has identified a field or parameter that should be injected. At this point, Tapestry knows the following:</p><ul><li>The field name (if field injection). The parameter name is not available.</li><li>The field or parameter type, as a Java class. In many cases, this will be enough to identify what object shall be injected.</li><li>Any additional annotations on the field or parameter.</li></ul><p>Tapestry proceeds with this information.</p><h2 id="InjectioninDetail-Checkfor@InjectService">Check for @InjectService</h2><p>Tapestry checks first for the @InjectService annotation. The value of this annotation is the service id to inject. When @InjectService is present at the point of injection, the search is complete, though the injection can fail (throwing an exception) if the service id indicated does not exist, or if the service's interface is not compat
 ible with the field's type.</p><h2 id="InjectioninDetail-Checkforserviceresources">Check for service resources</h2><p>This step applies only to IoC layer injection (not to injection into components).</p><p>When the @Inject annotation is <em>not present</em> at the point of injection, Tapestry checks to see if a resource can be injected. Services are global values, but resources are specific to the service under construction.</p><p>When the Inject annotation is present, this step is skipped (this is necessary when the object to be injected has a type that conflicts with a resource type, such as List or Class).</p><ul><li>org.slf4j.Logger &#8211; The Logger of the service being constructed (or the logger of the Module class being instantiated).</li><li><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ObjectLocator.html">ObjectLocator</a> &#8211; For contribute methods, used to locate additional objects.</li><li><a shape="r
 ect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ServiceResources.html">ServiceResources</a> &#8211; For service builder methods, an extended version of ObjectLocator.&#160;</li><li>Class &#8211;&#160;The service interface type.</li><li><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/OperationTracker.html">OperationTracker</a> &#8211; Used to track deeply nested operations so that errors can be reported sensibly.</li><li>Object, or service interface type &#8211; Passed to decorator methods.</li><li>Collection, List, Map &#8211; Assembled service configurations passed to service builder methods (or service class constructors).</li><li><p>Configuration, OrderedConfiguration, MappedConfiguration &#8211; Configuration passed to contribute methods, to build service configurations. <br clear="none" class="atl-forced-newline"> <br clear="none" class="atl-forced-newline"> If f
 ield type does not match any of the available resource types, or the Inject annotation is present, logic continues to the next step.</p>    <div class="aui-message problem shadowed information-macro">
-                            <span class="aui-icon icon-problem">Icon</span>
-                <div class="message-content">
-                            <p>Injection of resources into fields is triggered by the presence of the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/InjectResource.html">InjectResource</a> annotation, whereas injection of resources into parameters occurs when the Inject or InjectService annotation is <em>not</em> present. These rules are slightly tricky, which reflects a desire to avoid any annotations except when needed, and the fact that field injection came much later than parameter injection.</p>
-                    </div>
-    </div>
-</li></ul><h2 id="InjectioninDetail-ServiceLookupbyTypeandAnnotations">Service Lookup by Type and Annotations</h2><p>Tapestry attempts to find a matching <em>service</em>.</p><p>First, it generates a set of services whose service interface is compatible with the injection type. This is based on assignability.</p><p>If the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Local.html">Local</a> annotation is present, then services not from the module containing the service being constructed will be eliminated.</p><p>Tapestry then works through the known marker annotations. For each marker annotation that is present at the point of injection, Tapestry eliminates services which <em>do not</em> have the marker. Thus, if multiple marker annotations are present, the final service must have <em>all of them</em>.</p><p>At the end, of this, Tapestry determines how many services match.</p><ul><li>If there is a single ma
 tching service, then the service to inject as been identified.</li><li>If there are no matches, and there were no marker annotations at the point of injection, then the Tapestry continues to the next step.</li><li>Otherwise there were either no matches, or too many matches: Tapestry will throw a RuntimeException.</li></ul><h2 id="InjectioninDetail-MasterObjectProviderLookup">MasterObjectProvider Lookup</h2><p>This is the point at which Tapestry's extensibility comes into play. MasterObjectProvider is a service, with a configuration of <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ObjectProvider.html">ObjectProviders</a>.</p><p>The MasterObjectProvider is also the point at which Tapestry's IoC layer injection, and Tapestry's component injection, unite.</p><p>As a chain-of-command, each of the following ObjectProviders will be considered and will attempt to identify the object to be injected.</p>    <div class="aui-mess
 age warning shadowed information-macro">
-                            <span class="aui-icon icon-warning">Icon</span>
-                <div class="message-content">
-                            <p>A common problem when extending injection is that contributions into the MasterObjectProvider configuration have to be handled carefully. Any dependencies of the contributed objects should be resolvable using only the early stages of the injection process, otherwise MasterObjectProvider will have to be instantiated in order to handle its own injection: Tapestry will detect this impossibility and throw an exception. In addition, the <a shape="rect" href="typecoercer-service.html">TypeCoercer</a> service is used by several ObjectProvider implementations, so the same restrictions apply to TypeCoercer service contributions.</p>
-                    </div>
-    </div>
-<h3 id="InjectioninDetail-ValueObjectProvider">Value ObjectProvider</h3><p>Checks for the presence of the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Value.html">Value</a> annotation. If present, then the annotation's value is evaluated (to expand any symbol references), and the TypeCoercer service is used to convert the resulting String to the injection type (the field or parameter type).</p><h3 id="InjectioninDetail-SymbolObjectProvider">Symbol ObjectProvider</h3><p>Similar to the Value ObjectProvider: the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Symbol.html">Symbol</a> annotation's value (if present) is looked up using the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/SymbolSource.html">SymbolSource</a> service,&#160;and converted to the inject
 ion type via the TypeCoercer service.</p><h3 id="InjectioninDetail-AutobuildObjectProvider">Autobuild ObjectProvider</h3><p>Checks to see if the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Autobuild.html">Autobuild</a> annotation is present and, if so, autobuilds the value for the parameter. Of course, the object being built will itself be configured via injection.</p><h3 id="InjectioninDetail-ServiceOverrideObjectProvider">ServiceOverride ObjectProvider</h3><p>Checks any contributions to the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/ServiceOverride.html">ServiceOverride</a> service. Contributions map a type to an object of that type. Thus, ServiceOverrides will override injections of services that are not qualified with a marker annotation.</p><h3 id="InjectioninDetail-AliasObjectProvider(tapestry-core)">Alias ObjectProvider
  (tapestry-core)</h3><p>Uses the Alias service (<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Alias.html">API</a>) to look for an object that can be injected.</p>    <div class="aui-message problem shadowed information-macro">
-                            <span class="aui-icon icon-problem">Icon</span>
-                <div class="message-content">
-                            <p>Deprecated in Tapestry 5.2 and removed in 5.4.</p>
-                    </div>
-    </div>
-<p>This is commonly used to override a built-in service by contributing an object with the exact same interface. This is an older and more complex version of the ServiceOverride provider.</p><h3 id="InjectioninDetail-AssetObjectProvider(tapestry-core)">Asset ObjectProvider (tapestry-core)</h3><p>Checks for the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Path.html">Path</a> annotation.</p><p>If present, the annotation's value has embedded symbols expanded, and is converted into an Asset (which must exist).</p><p>The TypeCoercer can then convert the Asset to the injection type, for example, as Resource.</p><h3 id="InjectioninDetail-ServiceObjectProvider(tapestry-core)">Service ObjectProvider (tapestry-core)</h3><p>Looks for the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Service.html">Service</a> annotation; if present, the annotatio
 n's value is the exact service id to inject. This is necessary because injections into <em>component</em> fields are always triggered by the Inject annotation.</p>    <div class="aui-message warning shadowed information-macro">
-                            <span class="aui-icon icon-warning">Icon</span>
-                <div class="message-content">
-                            <p>This is supported but no longer necessary, as the @InjectService annotation is now also supported for component fields.</p>
-                    </div>
-    </div>
-<h3 id="InjectioninDetail-SpringBeanObjectProvider(tapestry-spring)">SpringBean ObjectProvider (tapestry-spring)</h3><p>Attempts to resolve a Spring bean purely by object type (Spring qualifiers are not supported). If no beans are assignable to the type, then processing continues. If exactly one is assignable, it is used as the injection value. If more than one bean is assignable, it is an error (and a list of matching beans names will be part of the thrown exception).</p><h2 id="InjectioninDetail-ServiceLookup">Service Lookup</h2><p>If none of the ObjectProviders can identify the value to inject, a last step occurs: lookup by service type. If exactly <em>one</em> service matches the injection type, then that service is injected.</p><p>Otherwise, the lookup fails because either no services match, or more than one matches. An exception will be thrown with the details, including a list of matching services (if there is more than one match).</p><h1 id="InjectioninDetail-Post-InjectionM
 ethods">Post-Injection Methods</h1><p>Autobuilt objects (services and the like, but <em>not</em> components) may have post-injection methods.</p><p>Any public method may have the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/PostInjection.html">PostInjection</a> annotation.</p><p>Such methods are invoked after constructor and/or field injection. Only <strong>public methods</strong> will be invoked. Any return value is ignored.</p><p>The method often takes no parameters; however if the method has parameters, these parameters are new points of injection.</p><p>Often this is used to perform additional setup, such as registerring a service as a listener of events produced by another service:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class MyServiceImpl implements MyService, UpdateListener
+<div class="error"><span class="error">Error formatting macro: contentbylabel: com.atlassian.confluence.api.service.exceptions.BadRequestException: Could not parse cql : null</span> </div></div><p>Injection in Tapestry IoC can be a complicated subject for a number of reasons:</p><ul><li>Injection can occur in many places: on fields, and on parameters to methods and constructors of certain objects.</li><li>Parts of Injection are themselves defined in terms of Tapestry IoC services, many of which are extensible.</li></ul><p>Despite this, injection generally <em>Just Works</em>: most of the time, you want Tapestry to inject a service, and only a single service implements the service interface.</p><p>This document discusses what to do when you hit a case that doesn't Just Work, or when you want to extend the injection logic in some way.</p><p>Some aspects of this discussion reflect Tapestry IoC used within a Tapestry web application: the tapestry-core module makes some extensions to inj
 ection.</p><h1 id="InjectioninDetail-InjectionTriggers">Injection Triggers</h1><p>Injection is triggered in a number of ways:</p><ul><li>A field in a component class, autobuilt object, or service implementation class is annotated with @Inject.</li><li>A method parameter to a service builder method, a decorator method, or a contribute method (in a Tapestry IoC module class).</li><li>A constructor parameter to an autobuilt object, or a service implementation class.</li><li>Any of the above with an @InjectService annotation.</li></ul><p>These define the&#160;<em>point of injection</em>.</p><p>Injection also covers a related matter: providing special resources to a service or component (remember that pages are specialized components). For a service, the service's id (as a string) or extensible configuration (as a Collection, List or Map) may be provided. For a component, the component's id, locale, message catalog, or component resources may be provided.</p><h1 id="InjectioninDetail-Sta
 ndardInjectionProcessing">Standard Injection Processing</h1><p>This section describes standard injection, which applies at the IoC layer: autobuilt objects and service implementations. The steps for injection into Tapestry components are slightly different and are covered later.</p><p>So a the point of injection, Tapestry has identified a field or parameter that should be injected. At this point, Tapestry knows the following:</p><ul><li>The field name (if field injection). The parameter name is not available.</li><li>The field or parameter type, as a Java class. In many cases, this will be enough to identify what object shall be injected.</li><li>Any additional annotations on the field or parameter.</li></ul><p>Tapestry proceeds with this information.</p><h2 id="InjectioninDetail-Checkfor@InjectService">Check for @InjectService</h2><p>Tapestry checks first for the @InjectService annotation. The value of this annotation is the service id to inject. When @InjectService is present at t
 he point of injection, the search is complete, though the injection can fail (throwing an exception) if the service id indicated does not exist, or if the service's interface is not compatible with the field's type.</p><h2 id="InjectioninDetail-Checkforserviceresources">Check for service resources</h2><p>This step applies only to IoC layer injection (not to injection into components).</p><p>When the @Inject annotation is <em>not present</em> at the point of injection, Tapestry checks to see if a resource can be injected. Services are global values, but resources are specific to the service under construction.</p><p>When the Inject annotation is present, this step is skipped (this is necessary when the object to be injected has a type that conflicts with a resource type, such as List or Class).</p><ul><li>org.slf4j.Logger &#8211; The Logger of the service being constructed (or the logger of the Module class being instantiated).</li><li><a shape="rect" class="external-link" href="http
 ://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ObjectLocator.html">ObjectLocator</a> &#8211; For contribute methods, used to locate additional objects.</li><li><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ServiceResources.html">ServiceResources</a> &#8211; For service builder methods, an extended version of ObjectLocator.&#160;</li><li>Class &#8211;&#160;The service interface type.</li><li><a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/OperationTracker.html">OperationTracker</a> &#8211; Used to track deeply nested operations so that errors can be reported sensibly.</li><li>Object, or service interface type &#8211; Passed to decorator methods.</li><li>Collection, List, Map &#8211; Assembled service configurations passed to service builder methods (or service class constructors).</li><li><p>Configuration, OrderedConfiguration, MappedConfi
 guration &#8211; Configuration passed to contribute methods, to build service configurations. <br clear="none" class="atl-forced-newline"> <br clear="none" class="atl-forced-newline"> If field type does not match any of the available resource types, or the Inject annotation is present, logic continues to the next step.</p><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Injection of resources into fields is triggered by the presence of the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/InjectResource.html">InjectResource</a> annotation, whereas injection of resources into parameters occurs when the Inject or InjectService annotation is <em>not</em> present. These rules are slightly tricky, which reflects a desire to avoid any annot
 ations except when needed, and the fact that field injection came much later than parameter injection.</p></div></div></li></ul><h2 id="InjectioninDetail-ServiceLookupbyTypeandAnnotations">Service Lookup by Type and Annotations</h2><p>Tapestry attempts to find a matching <em>service</em>.</p><p>First, it generates a set of services whose service interface is compatible with the injection type. This is based on assignability.</p><p>If the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Local.html">Local</a> annotation is present, then services not from the module containing the service being constructed will be eliminated.</p><p>Tapestry then works through the known marker annotations. For each marker annotation that is present at the point of injection, Tapestry eliminates services which <em>do not</em> have the marker. Thus, if multiple marker annotations are present, the final service must have <em>all of
  them</em>.</p><p>At the end, of this, Tapestry determines how many services match.</p><ul><li>If there is a single matching service, then the service to inject as been identified.</li><li>If there are no matches, and there were no marker annotations at the point of injection, then the Tapestry continues to the next step.</li><li>Otherwise there were either no matches, or too many matches: Tapestry will throw a RuntimeException.</li></ul><h2 id="InjectioninDetail-MasterObjectProviderLookup">MasterObjectProvider Lookup</h2><p>This is the point at which Tapestry's extensibility comes into play. MasterObjectProvider is a service, with a configuration of <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/ObjectProvider.html">ObjectProviders</a>.</p><p>The MasterObjectProvider is also the point at which Tapestry's IoC layer injection, and Tapestry's component injection, unite.</p><p>As a chain-of-command, each of the following 
 ObjectProviders will be considered and will attempt to identify the object to be injected.</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>A common problem when extending injection is that contributions into the MasterObjectProvider configuration have to be handled carefully. Any dependencies of the contributed objects should be resolvable using only the early stages of the injection process, otherwise MasterObjectProvider will have to be instantiated in order to handle its own injection: Tapestry will detect this impossibility and throw an exception. In addition, the <a shape="rect" href="typecoercer-service.html">TypeCoercer</a> service is used by several ObjectProvider implementations, so the same restrictions apply to TypeCoercer service contributions.</p></div></div><h3 id="InjectioninDetail-ValueObj
 ectProvider">Value ObjectProvider</h3><p>Checks for the presence of the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Value.html">Value</a> annotation. If present, then the annotation's value is evaluated (to expand any symbol references), and the TypeCoercer service is used to convert the resulting String to the injection type (the field or parameter type).</p><h3 id="InjectioninDetail-SymbolObjectProvider">Symbol ObjectProvider</h3><p>Similar to the Value ObjectProvider: the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Symbol.html">Symbol</a> annotation's value (if present) is looked up using the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/SymbolSource.html">SymbolSource</a> service,&#160;and converted to the injection type via the TypeCoercer servi
 ce.</p><h3 id="InjectioninDetail-AutobuildObjectProvider">Autobuild ObjectProvider</h3><p>Checks to see if the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Autobuild.html">Autobuild</a> annotation is present and, if so, autobuilds the value for the parameter. Of course, the object being built will itself be configured via injection.</p><h3 id="InjectioninDetail-ServiceOverrideObjectProvider">ServiceOverride ObjectProvider</h3><p>Checks any contributions to the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/services/ServiceOverride.html">ServiceOverride</a> service. Contributions map a type to an object of that type. Thus, ServiceOverrides will override injections of services that are not qualified with a marker annotation.</p><h3 id="InjectioninDetail-AliasObjectProvider(tapestry-core)">Alias ObjectProvider (tapestry-core)</h3><p>Uses the A
 lias service (<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/Alias.html">API</a>) to look for an object that can be injected.</p><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Deprecated in Tapestry 5.2 and removed in 5.4.</p></div></div><p>This is commonly used to override a built-in service by contributing an object with the exact same interface. This is an older and more complex version of the ServiceOverride provider.</p><h3 id="InjectioninDetail-AssetObjectProvider(tapestry-core)">Asset ObjectProvider (tapestry-core)</h3><p>Checks for the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Path.html">Path</a> annotation.</p><p>If present, the annotation's value has
  embedded symbols expanded, and is converted into an Asset (which must exist).</p><p>The TypeCoercer can then convert the Asset to the injection type, for example, as Resource.</p><h3 id="InjectioninDetail-ServiceObjectProvider(tapestry-core)">Service ObjectProvider (tapestry-core)</h3><p>Looks for the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Service.html">Service</a> annotation; if present, the annotation's value is the exact service id to inject. This is necessary because injections into <em>component</em> fields are always triggered by the Inject annotation.</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 is supported but no longer necessary, as the @InjectService annotation is now also supported for component fields.<
 /p></div></div><h3 id="InjectioninDetail-SpringBeanObjectProvider(tapestry-spring)">SpringBean ObjectProvider (tapestry-spring)</h3><p>Attempts to resolve a Spring bean purely by object type (Spring qualifiers are not supported). If no beans are assignable to the type, then processing continues. If exactly one is assignable, it is used as the injection value. If more than one bean is assignable, it is an error (and a list of matching beans names will be part of the thrown exception).</p><h2 id="InjectioninDetail-ServiceLookup">Service Lookup</h2><p>If none of the ObjectProviders can identify the value to inject, a last step occurs: lookup by service type. If exactly <em>one</em> service matches the injection type, then that service is injected.</p><p>Otherwise, the lookup fails because either no services match, or more than one matches. An exception will be thrown with the details, including a list of matching services (if there is more than one match).</p><h1 id="InjectioninDetail-
 Post-InjectionMethods">Post-Injection Methods</h1><p>Autobuilt objects (services and the like, but <em>not</em> components) may have post-injection methods.</p><p>Any public method may have the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/PostInjection.html">PostInjection</a> annotation.</p><p>Such methods are invoked after constructor and/or field injection. Only <strong>public methods</strong> will be invoked. Any return value is ignored.</p><p>The method often takes no parameters; however if the method has parameters, these parameters are new points of injection.</p><p>Often this is used to perform additional setup, such as registerring a service as a listener of events produced by another service:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class MyServiceImpl implements MyService, UpdateListener
 {
   @PostInjection
   public void registerAsListener(UpdateListenerHub hub)
@@ -141,15 +78,8 @@ table.ScrollbarTable td.ScrollbarNextIco
 ]]></script>
 </div></div><h1 id="InjectioninDetail-ComponentInjection">Component Injection</h1><p>Inside Tapestry components, injection occurs exclusively on <em>fields</em> and is always triggered by the @Inject (or @InjectService) annotation.</p><p>Component field injection is very similar to IoC layer, but with a different set of injectable resources.</p><p>Injection is the responsibility of the <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/InjectionProvider.html">InjectionProvider</a> service, which is a chain-of-command across a number of implementations.</p><h2 id="InjectioninDetail-BlockInjectionProvider">Block InjectionProvider</h2><p>Checks if the field type is Block. If so, determines the block id to inject (either from the field name, or from an @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Id.html">Id</a> annotation, if present).</p><h2 id=
 "InjectioninDetail-DefaultInjectionProvider">Default InjectionProvider</h2><p>Uses the MasterObjectProvider service to provide the injectable value. The Service Lookup stage is skipped.</p><h2 id="InjectioninDetail-ComponentResourcesInjectionProvider">ComponentResources InjectionProvider</h2><p>Injects fields of type ComponentResources.</p><h2 id="InjectioninDetail-CommonResourcesInjectionProvider">CommonResources InjectionProvider</h2><p>Injects fields with common resources:</p><ul><li>String: the components' complete id</li><li>org.slf4j.Logger: Logger for the component (based on component class name)</li><li>Locale: locale for the containing page (page locale is immutable)</li><li>Messages: Component's message catalog</li><li>ComponentResourceSelector: selector for the containing page (selector is immutable)</li></ul>
 
-    <div class="aui-message hint shadowed information-macro">
-                    <p class="title">Added in 5.3</p>
-                            <span class="aui-icon icon-hint">Icon</span>
-                <div class="message-content">
-                            
-
-                    </div>
-    </div>
-
+<div class="confluence-information-macro confluence-information-macro-information"><p class="title">Added in 5.3</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
+</div></div>
 <div style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;">
 <p>ComponentResourceSelector is new as of release 5.3. It encapsulates a locale plus additional application-specific data used for skinning and/or themeing.</p>
 </div><h2 id="InjectioninDetail-AssetInjectionProvider">Asset InjectionProvider</h2><p>Triggered by the @Path annotation: the Path value has symbols expanded, and is then converted to an Asset.</p><h2 id="InjectioninDetail-ServiceInjectionProvider">Service InjectionProvider</h2><p>Equivalent to the Service Lookup phase in an IoC layer injection.</p><h1 id="InjectioninDetail-@InjectServiceinComponents">@InjectService in Components</h1><p>You may use the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/InjectService.html">InjectService</a> annotation on component fields.</p><p>&#160;</p></div>

Modified: websites/production/tapestry/content/injection.html
==============================================================================
--- websites/production/tapestry/content/injection.html (original)
+++ websites/production/tapestry/content/injection.html Sat Jun 27 21:21:02 2015
@@ -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 type="text/javascript">
-  SyntaxHighlighter.defaults['toolbar'] = false;
-  SyntaxHighlighter.all();
-  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -55,7 +45,7 @@
   <input type="submit" value="Search">
 </form>
 
-</div><div class="emblem" style="float:left"><p><a shape="rect" href="index.html"><img class="confluence-embedded-image confluence-external-resource" src="http://tapestry.apache.org/images/tapestry_small.png" data-image-src="http://tapestry.apache.org/images/tapestry_small.png"></a></p></div><div class="title" style="float:left; margin: 0 0 0 3em"><h1 id="SmallBanner-PageTitle">Injection</h1></div></div>
+</div><div class="emblem" style="float:left"><p><a shape="rect" href="index.html"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://tapestry.apache.org/images/tapestry_small.png" data-image-src="http://tapestry.apache.org/images/tapestry_small.png"></span></a></p></div><div class="title" style="float:left; margin: 0 0 0 3em"><h1 id="SmallBanner-PageTitle">Injection</h1></div></div>
 <div class="clearer"></div>
 </div>
 
@@ -74,36 +64,7 @@
 <p>Injection is a key concept in Tapestry, and it is used in several different but related ways.</p>
 
 <div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
-<h3>Related Articles</h3>
-<ul class="content-by-label"><li>
-            <div>
-                    <span class="icon icon-page" title="Page">Page:</span>            </div>
-
-            <div class="details">
-                            <a shape="rect" href="injection.html">Injection</a>
-                    
-                
-                            </div>
-        </li><li>
-            <div>
-                    <span class="icon icon-page" title="Page">Page:</span>            </div>
-
-            <div class="details">
-                            <a shape="rect" href="injection-faq.html">Injection FAQ</a>
-                    
-                
-                            </div>
-        </li><li>
-            <div>
-                    <span class="icon icon-page" title="Page">Page:</span>            </div>
-
-            <div class="details">
-                            <a shape="rect" href="injection-in-detail.html">Injection in Detail</a>
-                    
-                
-                            </div>
-        </li></ul>
-</div>
+<div class="error"><span class="error">Error formatting macro: contentbylabel: com.atlassian.confluence.api.service.exceptions.BadRequestException: Could not parse cql : null</span> </div></div>
 
 <h2 id="Injection-InjectioninTapestryIOCServices">Injection in Tapestry IOC Services</h2>
 
@@ -131,7 +92,7 @@
 <p>For field type <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/Block.html">Block</a>, the value of the Inject annotation is the id of the <a shape="rect" href="component-templates.html#ComponentTemplates-block">&lt;t:block&gt;</a> element within the component's template. Normally, the id of the block is determined from the field name (after stripping out any leading "_" and "$" characters):</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 @Inject
 private Block foo;
 ]]></script>
@@ -140,7 +101,7 @@ private Block foo;
 <p>Where that is not appropriate, an @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Id.html">Id</a> annotation can be supplied:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 @Inject
 @Id(&quot;bar&quot;)
 private Block barBlock;
@@ -156,7 +117,7 @@ private Block barBlock;
 <p>A very common example occurs when a component needs access to its <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ComponentResources.html">resources</a>. The component can define a field of the appropriate type and use the <code>@Inject</code> annotation without a value:</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 @Inject
 private ComponentResources resources;
 ]]></script>
@@ -188,7 +149,7 @@ private ComponentResources resources;
 <p>When the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Path.html">Path</a> annotation is also present, then the injected value (relative to the component) will be a localized asset.</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 @Inject
 @Path(&quot;context:images/top_banner.png&quot;)
 private Asset banner;
@@ -202,7 +163,7 @@ private Asset banner;
 <p>Here, a custom EmployeeService service is injected, but any custom or built-in service may be injected in the same way. </p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 @Inject
 private EmployeeService employeeService;
 ]]></script>
@@ -232,7 +193,7 @@ private EmployeeService employeeService;
 <p>Here, a specific object is requested. A @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Service.html">Service</a> annotation is used to identify the service name.</p>
 
 <div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[
 @Inject
 @Service(&quot;Request&quot;)
 private Request request;

Modified: websites/production/tapestry/content/input-validation.html
==============================================================================
--- websites/production/tapestry/content/input-validation.html (original)
+++ websites/production/tapestry/content/input-validation.html Sat Jun 27 21:21:02 2015
@@ -45,7 +45,7 @@
   <input type="submit" value="Search">
 </form>
 
-</div><div class="emblem" style="float:left"><p><a shape="rect" href="index.html"><img class="confluence-embedded-image confluence-external-resource" src="http://tapestry.apache.org/images/tapestry_small.png" data-image-src="http://tapestry.apache.org/images/tapestry_small.png"></a></p></div><div class="title" style="float:left; margin: 0 0 0 3em"><h1 id="SmallBanner-PageTitle">Input Validation</h1></div></div>
+</div><div class="emblem" style="float:left"><p><a shape="rect" href="index.html"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://tapestry.apache.org/images/tapestry_small.png" data-image-src="http://tapestry.apache.org/images/tapestry_small.png"></span></a></p></div><div class="title" style="float:left; margin: 0 0 0 3em"><h1 id="SmallBanner-PageTitle">Input Validation</h1></div></div>
 <div class="clearer"></div>
 </div>
 

Modified: websites/production/tapestry/content/integrating-with-jpa.html
==============================================================================
--- websites/production/tapestry/content/integrating-with-jpa.html (original)
+++ websites/production/tapestry/content/integrating-with-jpa.html Sat Jun 27 21:21:02 2015
@@ -27,15 +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 type="text/javascript">
-  SyntaxHighlighter.defaults['toolbar'] = false;
-  SyntaxHighlighter.all();
-  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -54,7 +45,7 @@
   <input type="submit" value="Search">
 </form>
 
-</div><div class="emblem" style="float:left"><p><a shape="rect" href="index.html"><img class="confluence-embedded-image confluence-external-resource" src="http://tapestry.apache.org/images/tapestry_small.png" data-image-src="http://tapestry.apache.org/images/tapestry_small.png"></a></p></div><div class="title" style="float:left; margin: 0 0 0 3em"><h1 id="SmallBanner-PageTitle">Integrating with JPA</h1></div></div>
+</div><div class="emblem" style="float:left"><p><a shape="rect" href="index.html"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://tapestry.apache.org/images/tapestry_small.png" data-image-src="http://tapestry.apache.org/images/tapestry_small.png"></span></a></p></div><div class="title" style="float:left; margin: 0 0 0 3em"><h1 id="SmallBanner-PageTitle">Integrating with JPA</h1></div></div>
 <div class="clearer"></div>
 </div>
 
@@ -68,29 +59,11 @@
 <div id="content">
 <div id="ConfluenceContent">
 
-    <div class="aui-message hint shadowed information-macro">
-                    <p class="title">Added in 5.3</p>
-                            <span class="aui-icon icon-hint">Icon</span>
-                <div class="message-content">
-                            
-
-                    </div>
-    </div>
-
+<div class="confluence-information-macro confluence-information-macro-information"><p class="title">Added in 5.3</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
+</div></div>
 <div style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;">
-<p>&#160;</p></div><p>Starting with Tapestry 5.3, Tapestry provides built-in integration with the Java Persistence API (JPA). This module supersedes <a shape="rect" class="external-link" href="http://tynamo.org/tapestry-jpa+guide" >Tynamo's JPA integration</a>.</p><p><strong>Contents</strong></p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1424128793276 {padding: 0px;}
-div.rbtoc1424128793276 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1424128793276 li {margin-left: 0px;padding-left: 0px;}
-
-/*]]>*/</style></p><div class="toc-macro rbtoc1424128793276">
-<ul class="toc-indentation"><li><a shape="rect" href="#IntegratingwithJPA-ConfiguringJPA">Configuring JPA</a>
-<ul class="toc-indentation"><li><a shape="rect" href="#IntegratingwithJPA-XML-lessJPAconfiguration">XML-less JPA configuration</a></li><li><a shape="rect" href="#IntegratingwithJPA-Automaticallyaddingmanagedclasses">Automatically adding managed classes</a></li></ul>
-</li><li><a shape="rect" href="#IntegratingwithJPA-InjectingtheEntityManager">Injecting the EntityManager</a>
-<ul class="toc-indentation"><li><a shape="rect" href="#IntegratingwithJPA-InjectingtheEntityManagerintopageandcomponentclasses">Injecting the EntityManager into page and component classes</a></li><li><a shape="rect" href="#IntegratingwithJPA-InjectingEntityManagerintoservices">Injecting EntityManager into services</a></li></ul>
-</li><li><a shape="rect" href="#IntegratingwithJPA-Transactionmanagement">Transaction management</a></li></ul>
-</div><h1 id="IntegratingwithJPA-ConfiguringJPA">Configuring JPA</h1><p>The persistence.xml file is the standard configuration file in JPA used to define the persistence units. Tapestry reads this file to create the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html" >EntityManagerFactory</a>. The following example demonstrates a persistence.xml file.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+<p>&#160;</p></div><p>Starting with Tapestry 5.3, Tapestry provides built-in integration with the Java Persistence API (JPA). This module supersedes <a shape="rect" class="external-link" href="http://tynamo.org/tapestry-jpa+guide" >Tynamo's JPA integration</a>.</p><p><strong>Contents</strong></p><p></p><div class="toc-macro client-side-toc-macro" data-headerelements="H1,H2,H3" data-structure="list"></div><h1 id="IntegratingwithJPA-ConfiguringJPA">Configuring JPA</h1><p>The persistence.xml file is the standard configuration file in JPA used to define the persistence units. Tapestry reads this file to create the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html" >EntityManagerFactory</a>. The following example demonstrates a persistence.xml file.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 &lt;persistence xmlns=&quot;http://java.sun.com/xml/ns/persistence&quot; version=&quot;2.0&quot;&gt;
    &lt;persistence-unit name=&quot;DemoUnit&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;
        &lt;properties&gt;
@@ -104,7 +77,7 @@ div.rbtoc1424128793276 li {margin-left:
 
 &lt;/persistence&gt;]]></script>
 </div></div><p>By default, the persistence descriptor is named <em>persistence.xml</em> and is expected to be located on the classpath in the <em>META-INF</em> directory. If you want to place the <em>persistence.xml</em> file in another directory or name it differently, you can make a contribution to the <em>SymbolProvider</em> service, as shown in the following example. This is a quite useful feature if you want to use a different persistence descriptor for tests.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class AppModule {
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class AppModule {
 
     @Contribute(SymbolProvider.class)
     @FactoryDefaults
@@ -114,7 +87,7 @@ div.rbtoc1424128793276 li {margin-left:
 
 }]]></script>
 </div></div><h2 id="IntegratingwithJPA-XML-lessJPAconfiguration">XML-less JPA configuration</h2><p>With Tapestry, configuring JPA is much simpler than as described in the JPA specification. Tapestry allows you to configure the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html" >EntityManagerFactory</a> programmatically, without writing any XML. Imagine you want to use JDBC connections managed by the container and provided through JNDI. The resulting persistence descriptor might look like this:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
 &lt;persistence xmlns=&quot;http://java.sun.com/xml/ns/persistence&quot;
              version=&quot;2.0&quot;&gt;
    &lt;persistence-unit name=&quot;JTAUnit&quot; transaction-type=&quot;RESOURCE_LOCAL&quot;&gt;
@@ -131,7 +104,7 @@ div.rbtoc1424128793276 li {margin-left:
 
 &lt;/persistence&gt;]]></script>
 </div></div><p>Now let's see how to provide the same configuration <em>without</em> XML. The following demonstrates an equivalent JPA configuration.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class AppModule {
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class AppModule {
 
    @Contribute(EntityManagerSource.class)
    public static void configurePersistenceUnitInfos(MappedConfiguration&lt;String,PersistenceUnitConfigurer&gt; cfg) {
@@ -149,14 +122,8 @@ div.rbtoc1424128793276 li {margin-left:
      cfg.add(&quot;JTAUnit&quot;, configurer);
    }
 }]]></script>
-</div></div><p>In the example above you can see a contribution to the <em>EntityManagerSource</em> service. This service is responsible for creating the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html" >EntityManagerFactory</a> to be used to create <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManager.html" >EntityManager</a>. When the service is initialized, it parses the <em>persistence.xml</em> file, if available. For any persistence unit defined in the XML descriptor a <em>TapestryPersistenceUnitInfo</em> object is created. The <em>TapestryPersistenceUnitInfo</em> interface is a mutable extension of the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/spi/PersistenceUnitInfo.html" >PersistenceUnitInfo</a> interface (defined in the JPA specification) that allows you to configure a persist
 ence unit programmatically.</p><p>After parsing the persistence descriptor, the EntityManagerSource service applies its configuration to create further persistence units and/or update the existing ones. The service&#8217;s configuration is a map in which persistence unit names are associated with <em>PersistenceUnitConfigurer</em> instances. A PersistenceUnitConfigurer is used to configure a persistence unit programmatically that has been associated with it. In the example above you can see a contribution providing a PersistenceUnitConfigurer for the unit named <em>JTAUnit</em>.</p>    <div class="aui-message hint shadowed information-macro">
-                            <span class="aui-icon icon-hint">Icon</span>
-                <div class="message-content">
-                            <p>Note that the TapestryPersistenceUnitInfo instance passed to the PersistenceUnitConfigurer is either empty or my contain the persistence unit metadata read from the persistence.xml file. What happens if you contribute a PersistenceUnitConfigurer for a persistence unit that has not been defined in the persistence.xml file? In this case Tapestry assumes that you want to configure the persistence unit programmatically and just creates a fresh <em>TapestryPersistenceUnitInfo</em> object and passes it to the <em>PersistenceUnitConfigurer</em>.</p>
-                    </div>
-    </div>
-<h2 id="IntegratingwithJPA-Automaticallyaddingmanagedclasses">Automatically adding managed classes</h2><p>If only a single persistence unit is defined, Tapestry scans the <em>application-root-package.entities</em> package. The classes in that package are automatically added as managed classes to the defined persistence unit.</p><p>If you have additional packages containing entities, you may contribute them to the <em>JpaEntityPackageManager</em> service configuration.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class AppModule {
+</div></div><p>In the example above you can see a contribution to the <em>EntityManagerSource</em> service. This service is responsible for creating the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManagerFactory.html" >EntityManagerFactory</a> to be used to create <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManager.html" >EntityManager</a>. When the service is initialized, it parses the <em>persistence.xml</em> file, if available. For any persistence unit defined in the XML descriptor a <em>TapestryPersistenceUnitInfo</em> object is created. The <em>TapestryPersistenceUnitInfo</em> interface is a mutable extension of the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/spi/PersistenceUnitInfo.html" >PersistenceUnitInfo</a> interface (defined in the JPA specification) that allows you to configure a persist
 ence unit programmatically.</p><p>After parsing the persistence descriptor, the EntityManagerSource service applies its configuration to create further persistence units and/or update the existing ones. The service&#8217;s configuration is a map in which persistence unit names are associated with <em>PersistenceUnitConfigurer</em> instances. A PersistenceUnitConfigurer is used to configure a persistence unit programmatically that has been associated with it. In the example above you can see a contribution providing a PersistenceUnitConfigurer for the unit named <em>JTAUnit</em>.</p><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>Note that the TapestryPersistenceUnitInfo instance passed to the PersistenceUnitConfigurer is either empty or my contain the persistence unit metadata read from the persistence.x
 ml file. What happens if you contribute a PersistenceUnitConfigurer for a persistence unit that has not been defined in the persistence.xml file? In this case Tapestry assumes that you want to configure the persistence unit programmatically and just creates a fresh <em>TapestryPersistenceUnitInfo</em> object and passes it to the <em>PersistenceUnitConfigurer</em>.</p></div></div><h2 id="IntegratingwithJPA-Automaticallyaddingmanagedclasses">Automatically adding managed classes</h2><p>If only a single persistence unit is defined, Tapestry scans the <em>application-root-package.entities</em> package. The classes in that package are automatically added as managed classes to the defined persistence unit.</p><p>If you have additional packages containing entities, you may contribute them to the <em>JpaEntityPackageManager</em> service configuration.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class AppModule {
 
    @Contribute(JpaEntityPackageManager.class)
    public static void providePackages(Configuration&lt;String&gt; configuration) {
@@ -166,7 +133,7 @@ div.rbtoc1424128793276 li {margin-left:
    }
 }]]></script>
 </div></div><p>As you can see, you may add as many packages as you wish.</p><h1 id="IntegratingwithJPA-InjectingtheEntityManager">Injecting the EntityManager</h1><p>The created entity managers can be injected into page, component and other services.</p><h2 id="IntegratingwithJPA-InjectingtheEntityManagerintopageandcomponentclasses">Injecting the EntityManager into page and component classes</h2><p>Depending on whether more than one persistence unit has been defined, the way to inject <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManager.html" >EntityManager</a> varies slightly. Let&#8217;s start with a simple scenario, where only a single persistence unit is defined. In this case, an EntityManager can be injected using the @Inject annotation.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class CreateAddress {
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class CreateAddress {
 
    @Inject
    private EntityManager entityManager;
@@ -180,7 +147,7 @@ div.rbtoc1424128793276 li {margin-left:
    }
 }]]></script>
 </div></div><p>Alternatively, you can use the @<a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/PersistenceContext.html" >PersistenceContext</a> annotation to get the EntityManager injected into a page or component, as shown in the following example.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class CreateAddress {
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class CreateAddress {
 
    @PersistenceContext
    private EntityManager entityManager;
@@ -194,7 +161,7 @@ div.rbtoc1424128793276 li {margin-left:
    }
 }]]></script>
 </div></div><p>If you have multiple instances of persistence-unit defined in the same application, you need to explicitly tell Tapestry which persistence unit you want to get injected. This is what the @PersistenceContext annotation&#8217;s <em>name</em> attribute is used for? The following example demonstrates how to inject the persistence unit named <em>DemoUnit</em>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class CreateAddress {
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class CreateAddress {
 
    @PersistenceContext(unitName = &quot;DemoUnit&quot;)
    private EntityManager entityManager;
@@ -209,14 +176,14 @@ div.rbtoc1424128793276 li {margin-left:
    }
 }]]></script>
 </div></div><h2 id="IntegratingwithJPA-InjectingEntityManagerintoservices">Injecting EntityManager into services</h2><p>While component injection occurs only on fields, the injection in the IoC layer may be triggered by a field or a constructor. The following example demonstrates field injection, when a single persistence unit is defined in the persistence descriptor.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class UserDAOImpl implements UserDAO {
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class UserDAOImpl implements UserDAO {
    @Inject
    private EntityManager entityManager;
 
    ...
 }]]></script>
 </div></div><p>The constructor injection is demonstrated in the following example.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class UserDAOImpl implements UserDAO {
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class UserDAOImpl implements UserDAO {
 
    private EntityManager entityManager;
 
@@ -227,7 +194,7 @@ div.rbtoc1424128793276 li {margin-left:
    ...
 }]]></script>
 </div></div><p>If multiple persistence units are defined in the same application, you need to disambiguate the unit to inject. This is done with the <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/PersistenceContext.html" >@PersistenceContext</a> annotation, as shown in the following example. Because @PersistenceContext must not be placed on constructor parameters, you can&#8217;t use constructor injection and must switch to field injection.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class UserDAOImpl implements UserDAO {
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class UserDAOImpl implements UserDAO {
    @Inject
    @PersistenceContext(unitName = &quot;DemoUnit&quot;)
    private EntityManager entityManager;
@@ -235,7 +202,7 @@ div.rbtoc1424128793276 li {margin-left:
    ...
 }]]></script>
 </div></div><h1 id="IntegratingwithJPA-Transactionmanagement">Transaction management</h1><p>As you may already know from the Hibernate integration library, Tapestry automatically manages transactions for you. The JPA integration library defines the @CommitAfter annotation, which acts as the correspondent annotation from the Hibernate integration library. Let&#8217;s explore the <em>UserDAO</em> interface to see the annotation in action.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public interface UserDAO {
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public interface UserDAO {
 
    @CommitAfter
    @PersistenceContext(unitName = &quot;DemoUnit&quot;)
@@ -247,14 +214,8 @@ div.rbtoc1424128793276 li {margin-left:
    @PersistenceContext(unitName = &quot;DemoUnit&quot;)
    void delete(User... users);
 }]]></script>
-</div></div><p>As you can see, the annotation may be placed on service method in order to mark that method as transactional. Any method marked with the @CommitAfter annotation will have a transaction started before, and committed after, it is called. Runtime exceptions thrown by by a transactional method will abort the transaction. Checked exceptions are ignored and the transaction will be committed anyway.</p>    <div class="aui-message problem shadowed information-macro">
-                            <span class="aui-icon icon-problem">Icon</span>
-                <div class="message-content">
-                            <p>Note that <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityTransaction.html" >EntityTransaction</a> interface does not support two phase commits. Committing transactions of multiple EntityManagers in the same request might result in data consistency issues. That&#8217;s why @CommitAfter annotation must be accompanied by the @PersistenceContext annotation if multiple persistence unit are defined in an application. This way you can only commit the transaction of a single persistence unit. You should be very carefully, if you are committing multiple transactions manually in the same request.</p>
-                    </div>
-    </div>
-<p>After placing the @CommitAfter annotation on methods, you need to tell Tapestry to advise those methods. This is accomplished by adding the transaction advice, as shown in the following example.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[public class AppModule {
+</div></div><p>As you can see, the annotation may be placed on service method in order to mark that method as transactional. Any method marked with the @CommitAfter annotation will have a transaction started before, and committed after, it is called. Runtime exceptions thrown by by a transactional method will abort the transaction. Checked exceptions are ignored and the transaction will be committed anyway.</p><div class="confluence-information-macro confluence-information-macro-warning"><span class="aui-icon aui-icon-small aui-iconfont-error confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>Note that <a shape="rect" class="external-link" href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityTransaction.html" >EntityTransaction</a> interface does not support two phase commits. Committing transactions of multiple EntityManagers in the same request might result in data consistency issues. That&#8217;s why @CommitAfter annotatio
 n must be accompanied by the @PersistenceContext annotation if multiple persistence unit are defined in an application. This way you can only commit the transaction of a single persistence unit. You should be very carefully, if you are committing multiple transactions manually in the same request.</p></div></div><p>After placing the @CommitAfter annotation on methods, you need to tell Tapestry to advise those methods. This is accomplished by adding the transaction advice, as shown in the following example.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[public class AppModule {
 
    @Match(&quot;*DAO&quot;)
    public static void adviseTransactionally(

Modified: websites/production/tapestry/content/integrating-with-spring-framework.html
==============================================================================
--- websites/production/tapestry/content/integrating-with-spring-framework.html (original)
+++ websites/production/tapestry/content/integrating-with-spring-framework.html Sat Jun 27 21:21:02 2015
@@ -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 type="text/javascript">
-  SyntaxHighlighter.defaults['toolbar'] = false;
-  SyntaxHighlighter.all();
-  </script>
 
   <link href="/styles/style.css" rel="stylesheet" type="text/css"/>
 
@@ -55,7 +45,7 @@
   <input type="submit" value="Search">
 </form>
 
-</div><div class="emblem" style="float:left"><p><a shape="rect" href="index.html"><img class="confluence-embedded-image confluence-external-resource" src="http://tapestry.apache.org/images/tapestry_small.png" data-image-src="http://tapestry.apache.org/images/tapestry_small.png"></a></p></div><div class="title" style="float:left; margin: 0 0 0 3em"><h1 id="SmallBanner-PageTitle">Integrating with Spring Framework</h1></div></div>
+</div><div class="emblem" style="float:left"><p><a shape="rect" href="index.html"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://tapestry.apache.org/images/tapestry_small.png" data-image-src="http://tapestry.apache.org/images/tapestry_small.png"></span></a></p></div><div class="title" style="float:left; margin: 0 0 0 3em"><h1 id="SmallBanner-PageTitle">Integrating with Spring Framework</h1></div></div>
 <div class="clearer"></div>
 </div>
 
@@ -68,73 +58,36 @@
 
 <div id="content">
 <div id="ConfluenceContent"><div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
-<h3>Related Articles</h3>
-<ul class="content-by-label"><li>
-            <div>
-                    <span class="icon icon-page" title="Page">Page:</span>            </div>
-
-            <div class="details">
-                            <a shape="rect" href="security.html">Security</a>
-                    
-                
-                            </div>
-        </li><li>
-            <div>
-                    <span class="icon icon-page" title="Page">Page:</span>            </div>
-
-            <div class="details">
-                            <a shape="rect" href="integrating-with-spring-framework.html">Integrating with Spring Framework</a>
-                    
-                
-                            </div>
-        </li></ul>
-</div><p>Tapestry easily integrates with Spring Framework, allowing beans defined by Spring to be injected into Tapestry IoC services, and into Tapestry components. In addition, with Tapestry 5.2 and later, you can also go the other way, injecting Tapestry services in Spring beans.</p><p>For integrating Spring Security into your application, see <a shape="rect" href="security.html">Security</a>.</p><p><strong>Contents</strong></p><p><style type="text/css">/*<![CDATA[*/
-div.rbtoc1427879999366 {padding: 0px;}
-div.rbtoc1427879999366 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1427879999366 li {margin-left: 0px;padding-left: 0px;}
-
-/*]]>*/</style></p><div class="toc-macro rbtoc1427879999366">
-<ul class="toc-indentation"><li>Related Articles</li></ul>
-<ul><li><a shape="rect" href="#IntegratingwithSpringFramework-SpringVersion">Spring Version</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-Usage">Usage</a>
-<ul class="toc-indentation"><li><a shape="rect" href="#IntegratingwithSpringFramework-Requireddependency">Required dependency</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-Updateyourweb.xmlfile">Update your web.xml file</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-AccessingtheSpringApplicationContext">Accessing the Spring Application Context</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-Injectingbeans">Injecting beans</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-InjectingTapestryservicesinSpringbeans">Injecting Tapestry services in Spring beans</a></li></ul>
-</li><li><a shape="rect" href="#IntegratingwithSpringFramework-ApplicationContextCustomizer">ApplicationContextCustomizer</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-5.0CompatibilityMode">5.0 Compatibility Mode</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-ChangesFrom5.0">Changes From 5.0</a></li><li><a shape="rect" href="#IntegratingwithSpringFramework-Limitations">Limitations</a></li></ul>
-</div><h2 id="IntegratingwithSpringFramework-SpringVersion">Spring Version</h2><p>This module is compiled and tested against Spring Framework 2.5.6. It should be reasonable to override the dependency to earlier versions of Spring, though the code makes use of some APIs that were added to Spring to support JDK 1.5 annotations.</p><h2 id="IntegratingwithSpringFramework-Usage">Usage</h2><p>The integration is designed to be a very thin layer on top of Spring's normal configuration for a web application.</p><p>Detailed instructions are available in the <a shape="rect" class="external-link" href="http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#context-create" >Spring documentation</a>. Please omit the part about creating a ContextLoaderListener: this is now done automatically by Tapestry.</p><h3 id="IntegratingwithSpringFramework-Requireddependency">Required dependency</h3><p>To integrate Spring with Tapestry, you should add the below dependency in your classpath.
  The following exemple is for Maven users.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[  &lt;dependency&gt;
+<div class="error"><span class="error">Error formatting macro: contentbylabel: com.atlassian.confluence.api.service.exceptions.BadRequestException: Could not parse cql : null</span> </div></div><p>Tapestry easily integrates with Spring Framework, allowing beans defined by Spring to be injected into Tapestry IoC services, and into Tapestry components. In addition, with Tapestry 5.2 and later, you can also go the other way, injecting Tapestry services in Spring beans.</p><p>For integrating Spring Security into your application, see <a shape="rect" href="security.html">Security</a>.</p><p><strong>Contents</strong></p><p></p><div class="toc-macro client-side-toc-macro" data-headerelements="H1,H2,H3" data-structure="list"></div><h2 id="IntegratingwithSpringFramework-SpringVersion">Spring Version</h2><p>This module is compiled and tested against Spring Framework 2.5.6. It should be reasonable to override the dependency to earlier versions of Spring, though the code makes use of some APIs 
 that were added to Spring to support JDK 1.5 annotations.</p><h2 id="IntegratingwithSpringFramework-Usage">Usage</h2><p>The integration is designed to be a very thin layer on top of Spring's normal configuration for a web application.</p><p>Detailed instructions are available in the <a shape="rect" class="external-link" href="http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#context-create" >Spring documentation</a>. Please omit the part about creating a ContextLoaderListener: this is now done automatically by Tapestry.</p><h3 id="IntegratingwithSpringFramework-Requireddependency">Required dependency</h3><p>To integrate Spring with Tapestry, you should add the below dependency in your classpath. The following exemple is for Maven users.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[  &lt;dependency&gt;
     &lt;groupId&gt;org.apache.tapestry&lt;/groupId&gt;
     &lt;artifactId&gt;tapestry-spring&lt;/artifactId&gt;
     &lt;version&gt;[your-tapestry-version]&lt;/version&gt;
   &lt;/dependency&gt;
 ]]></script>
 </div></div><h3 id="IntegratingwithSpringFramework-Updateyourweb.xmlfile">Update your web.xml file</h3><p>The short form is that you must make two small changes to your application's web.xml.</p><p>First, a special filter is used in replace of the standard TapestryFilter:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[  &lt;filter&gt;
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[  &lt;filter&gt;
     &lt;filter-name&gt;app&lt;/filter-name&gt;
     &lt;!-- Special filter that adds in a T5 IoC module derived from the Spring WebApplicationContext. --&gt;
     &lt;filter-class&gt;org.apache.tapestry5.spring.TapestrySpringFilter&lt;/filter-class&gt;
   &lt;/filter&gt;]]></script>
 </div></div><p>Secondly, you may add the normal Spring configuration, consisting of an optional &lt;context-param&gt; identifying which Spring bean configuration file(s) to load:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;context-param&gt;
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[&lt;context-param&gt;
   &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
   &lt;param-value&gt;/WEB-INF/daoContext.xml /WEB-INF/applicationContext.xml&lt;/param-value&gt;
 &lt;/context-param&gt;
 ]]></script>
 </div></div><p>The &lt;context-param&gt; lists the Spring bean configuration file. It is optional and defaults to just /WEB-INF/applicationContext.xml if omitted.</p><h3 id="IntegratingwithSpringFramework-AccessingtheSpringApplicationContext">Accessing the Spring Application Context</h3><p>By integrating Spring in Tapestry, you get full access on Spring ApplicationContext as if you were accessing to any Tapestry service. Simply @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> into your pages and components.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[  @Inject
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[  @Inject
   private ApplicationContext springContext;
 ]]></script>
 </div></div><h3 id="IntegratingwithSpringFramework-Injectingbeans">Injecting beans</h3><p>Inside your component classes, you may use the @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> annotation. Typically, just adding @<a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/ioc/annotations/Inject.html">Inject</a> to the field type is sufficient to identify the Spring bean to inject:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[  @Inject
+<script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[  @Inject
   private UserDAO userDAO;]]></script>
 </div></div><p>Searching for Spring beans is threaded into the <a shape="rect" href="injection.html">MasterObjectProvider service</a>. The Spring context becomes one more place that Tapestry searches when determining the injection for a injected field or method parameter.</p><h3 id="IntegratingwithSpringFramework-InjectingTapestryservicesinSpringbeans">Injecting Tapestry services in Spring beans</h3>
 
-    <div class="aui-message hint shadowed information-macro">
-                    <p class="title">Added in 5.2</p>
-                            <span class="aui-icon icon-hint">Icon</span>
-                <div class="message-content">
-                            
-
-                    </div>
-    </div>
-
+<div class="confluence-information-macro confluence-information-macro-information"><p class="title">Added in 5.2</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body">
+</div></div>
 <div style="border-right: 20px solid #D8E4F1;border-left: 20px solid #D8E4F1;">
 <p>If you have configured Spring to allow annotation-based injection, then you will be able to inject Tapestry services into your Spring Beans.</p>