Author: buildbot
Date: Sun Feb 18 21:21:20 2018
New Revision: 1025570
Log:
Production update by buildbot for tapestry
Added:
websites/production/tapestry/content/typescript.html
Modified:
websites/production/tapestry/content/ajax-and-zones.html
websites/production/tapestry/content/aliases.html
websites/production/tapestry/content/cache/main.pageCache
websites/production/tapestry/content/client-side-javascript.html
websites/production/tapestry/content/documentation.html
websites/production/tapestry/content/integrating-with-jpa.html
websites/production/tapestry/content/javascript-modules.html
websites/production/tapestry/content/legacy-javascript.html
websites/production/tapestry/content/supported-environments-and-versions.html
Modified: websites/production/tapestry/content/ajax-and-zones.html
==============================================================================
--- websites/production/tapestry/content/ajax-and-zones.html (original)
+++ websites/production/tapestry/content/ajax-and-zones.html Sun Feb 18
21:21:20 2018
@@ -112,6 +112,15 @@
<span class="icon aui-icon aui-icon-small
aui-iconfont-page-default" title="Page">Page:</span> </div>
<div class="details">
+ <a href="typescript.html">TypeScript</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="coffeescript.html">CoffeeScript</a>
@@ -174,7 +183,7 @@
</div>
-<p>Tapestry provides easy-to-use support for <strong>Ajax</strong>, the
technique of using JavaScript to dynamically update parts of a web page with
content from the server without redrawing the whole page. With Tapestry, you
can do simple Ajax updates without having to write any JavaScript code at
all.</p><p>Ajax support is included in many <a
href="ajax-and-zones.html">built-in components</a> and <a
href="ajax-and-zones.html">component mixins</a> via the <code>async</code>
parameter (in Tapestry 5.4+) and the <code>zone</code> parameter (for
earlier versions). Here we use an EventLink component to trigger an Ajax update
of another area of the page:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeHeader panelHeader pdl"
style="border-bottom-width: 1px;"><b>Page or component template
(partial)</b></div><div class="codeContent panelContent pdl">
+<p>Tapestry provides easy-to-use support for <strong>Ajax</strong>, the
technique of using JavaScript to dynamically update parts of a web page with
content from the server without redrawing the whole page. With Tapestry, you
can do simple Ajax updates without having to write any JavaScript code at
all.</p><p>Ajax support is included in many <a
href="component-reference.html">built-in components</a> and <a
href="component-mixins.html">component mixins</a> via
the <code>async</code> parameter (in Tapestry 5.4+) and
the <code>zone</code> parameter (for earlier versions). Here we use an
EventLink component to trigger an Ajax update of another area of the
page:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Page or
component template (partial)</b></div><div class="codeContent panelContent pdl">
<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><t:eventlink event="updateTime"
async="true">update</t:eventlink>
...
<t:zone t:id="timeArea" id="timeArea">
@@ -210,7 +219,7 @@ Object onActionFromSomeLink()
{
return myZone.getBody(); // AJAX request, return zone's own body
}</pre>
-</div></div><p>The possible return values are:</p><ul><li>An injected Block or
Component to render as the response. The response will be a JSON hash, with a
"content" key whose value is the rendered markup. This is the basis for updates
with the Zone component.</li><li>The zone's own body (using Zone's getBody()
method)</li><li>null (to redraw the current page)</li><li>A <a
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/json/JSONObject.html">JSONObject</a>
or <a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/json/JSONArray.html">JSONArray</a>,
which will be sent as the response.</li><li>A <a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/StreamResponse.html">StreamResponse</a>,
which will be sent as the response.</li><li>A <a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/Link.html">Link</a>,
which wil
l send a redirect to the client.</li><li>A page name (as a String), or a page
class, or a page instance, which will send a redirect to the indicated
page.</li></ul><p>See <a href="ajax-and-zones.html">Ajax and Zones</a> for
full descriptions of the above.</p><h3
id="AjaxandZones-GracefulDegradation">Graceful Degradation</h3><p>Users who do
not have JavaScript enabled may click EventLinks (or ActionLinks, or Forms)
that are configured to update a Zone. When that occurs, the request will still
be sent to the server, but Tapestry will handle it as a <em>traditional</em>
request.</p><p>This happens automatically when your event handler method has a
void return type.</p><p>However, to support graceful degradation when your
event handler method has a <em>non-void</em> return type, you should detect
non-Ajax requests and return a traditional response, typically null to redraw
the whole page. This is accomplished by injecting the <a class="external-link"
href="http://tapestry.apache.org/c
urrent/apidocs/org/apache/tapestry5/services/Request.html">Request</a> object,
and invoking the isXHR() method. This value will be true for Ajax requests, and
false for traditional request.</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+</div></div><p>The possible return values are:</p><ul><li>An injected Block or
Component to render as the response. The response will be a JSON hash, with a
"content" key whose value is the rendered markup. This is the basis for updates
with the Zone component.</li><li>The zone's own body (using Zone's getBody()
method)</li><li>null (to redraw the current page)</li><li>A <a
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/json/JSONObject.html">JSONObject</a>
or <a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/json/JSONArray.html">JSONArray</a>,
which will be sent as the response.</li><li>A <a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/StreamResponse.html">StreamResponse</a>,
which will be sent as the response.</li><li>A <a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/Link.html">Link</a>,
which wil
l send a redirect to the client.</li><li>A page name (as a String), or a page
class, or a page instance, which will send a redirect to the indicated
page.</li></ul><p>See <a href="page-navigation.html">Page Navigation</a>
for full descriptions of the above.</p><h3
id="AjaxandZones-GracefulDegradation">Graceful Degradation</h3><p>Users who do
not have JavaScript enabled may click EventLinks (or ActionLinks, or Forms)
that are configured to update a Zone. When that occurs, the request will still
be sent to the server, but Tapestry will handle it as a <em>traditional</em>
request.</p><p>This happens automatically when your event handler method has a
void return type.</p><p>However, to support graceful degradation when your
event handler method has a <em>non-void</em> return type, you should detect
non-Ajax requests and return a traditional response, typically null to redraw
the whole page. This is accomplished by injecting the <a class="external-link"
href="http://tapestry.apach
e.org/current/apidocs/org/apache/tapestry5/services/Request.html">Request</a>
object, and invoking the isXHR() method. This value will be true for Ajax
requests, and false for traditional request.</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;">@Inject
private Request request;
@@ -251,12 +260,12 @@ void onActionFromRegister()
</pre>
</div></div><h3 id="AjaxandZones-ZoneLimitations">Zone
Limitations</h3><p>Unlike many other situations, Tapestry relies on you to
specify useful and unique ids to Zone components, then reference those ids
inside EventLink (or ActionLink, or Form) components. Using Zone components
inside any kind of loop may cause additional problems, as Tapestry will
<em>uniqueify</em> the client id you specify (appending an index
number).</p><p>If you create a component that contains a zone, and you use that
component in a loop, you'll likely need to set the client-side id like
this:</p><p> </p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
<pre class="brush: xml; gutter: false; theme: Default"
style="font-size:12px;"><t:zone t:id="myzone"
id="prop:componentResources.id"></pre>
-</div></div><p> </p><p>See <a class="external-link"
href="http://jumpstart.doublenegative.com.au/jumpstart7/examples/ajax/components1"
rel="nofollow">this JumpStart Example</a> for details.</p><p>The show and
update function names (Tapestry 5.3 and earlier only) are converted to lower
case; all the methods of Tapestry.ElementEffect should have all lower-case
names. Because client-side JavaScript is so fluid (new methods may be added to
existing objects), Tapestry makes no attempt to validate the function names ...
however, if the names are not valid, then the default show and highlight
methods will be used.</p><p>Zones may only be used inside the <em>body</em> of
a page, not the head<em>.</em></p><h3 id="AjaxandZones-MoreInformation">More
Information</h3><p>For examples of extending a Form with a Zone and updating
multiple zones at once, see the <a href="ajax-and-zones.html">Ajax and
Zones</a>.</p><p>There are also a number of Ajax-related examples at
the  <a class
="external-link" href="http://jumpstart.doublenegative.com.au/jumpstart7/"
rel="nofollow"><span class="confluence-link">Tapestry JumpStart</span></a>
site.</p><p><span class="confluence-anchor-link"
id="AjaxandZones-autocomplete"></span></p><h2
id="AjaxandZones-AutocompleteMixin">Autocomplete Mixin</h2><p></p><div
class="navmenu" style="float:right; background:#eee; margin:3px; padding:0 1em">
+</div></div><p> </p><p>See <a class="external-link"
href="http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/components1"
rel="nofollow">this JumpStart Example</a> for details.</p><p>The show and
update function names (Tapestry 5.3 and earlier only) are converted to lower
case; all the methods of Tapestry.ElementEffect should have all lower-case
names. Because client-side JavaScript is so fluid (new methods may be added to
existing objects), Tapestry makes no attempt to validate the function names ...
however, if the names are not valid, then the default show and highlight
methods will be used.</p><p>Zones may only be used inside the <em>body</em> of
a page, not the head<em>.</em></p><h3 id="AjaxandZones-MoreInformation">More
Information</h3><p>For examples of extending a Form with a Zone and updating
multiple zones at once, see the <a href="ajax-components-faq.html">Ajax
Components FAQ</a>.</p><p>There are also a number of Ajax-related examples at
the  
<a class="external-link"
href="http://jumpstart.doublenegative.com.au/jumpstart/" rel="nofollow"><span
class="confluence-link">Tapestry JumpStart</span></a> site.</p><p><span
class="confluence-anchor-link" id="AjaxandZones-autocomplete"></span></p><h2
id="AjaxandZones-AutocompleteMixin">Autocomplete Mixin</h2><p></p><div
class="navmenu" style="float:right; background:#eee; margin:3px; padding:0 1em">
<p> <strong>JumpStart Demo:</strong><br clear="none">
<a class="external-link"
href="http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/autocompletemixin"
rel="nofollow">Autocomplete Mixin</a></p></div>The <a class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/mixins/Autocomplete.html">Autocomplete</a>
mixin exists to allow a text field to query the server for completions for a
partially entered phrase. It is often used in situations where the field exists
to select a single value from a large set, too large to successfully download
to the client as a drop down list; for example, when the number of values to
select from is numbered in the thousands.<p>Autocomplete can be added to an
existing text field:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;"> <t:textfield t:id="accountName"
t:mixins="autocomplete" size="100"/>
</pre>
-</div></div><p>The mixin can be configured in a number of ways, see the <a
class="external-link"
href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/mixins/Autocomplete.html">component
reference</a>.</p><p>When the user types into the field, the client-side
JavaScript will send a request to the server to get completions.</p><p>You must
write an event handler to provide these completions. The name of the event is
"providecompletions". The context is the partial input value, and the return
value will be converted into the selections for the user.</p><p>For
example:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+</div></div><p>The mixin can be configured in a number of ways, see the <a
href="component-reference.html">component reference</a>.</p><p>When the user
types into the field, the client-side JavaScript will send a request to the
server to get completions.</p><p>You must write an event handler to provide
these completions. The name of the event is "providecompletions". The context
is the partial input value, and the return value will be converted into the
selections for the user.</p><p>For example:</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;"> List<String>
onProvideCompletionsFromAccountName(String partial)
{
List<Account> matches = accountDAO.findByPartialAccountName(partial);
Modified: websites/production/tapestry/content/aliases.html
==============================================================================
--- websites/production/tapestry/content/aliases.html (original)
+++ websites/production/tapestry/content/aliases.html Sun Feb 18 21:21:20 2018
@@ -75,7 +75,7 @@
</div>
<div id="content">
- <div id="ConfluenceContent"><p>
+ <div id="ConfluenceContent"><p> </p><p> 
Use ServiceOverrides instead. Aliases will be removed starting in 5.3.
</p><div class="aui-message aui-message-warning">
@@ -150,13 +150,13 @@ Deprecated since 5.2 |
</div>
-<p> </p><p>See <a href="aliases.html">Aliases</a></p><h1
id="Aliases-Introduction">Introduction</h1><p>Tapestry goes to great lengths so
that you can use the <a href="aliases.html">Inject</a> annotation on a field
and provide no additional data, yet end up with the correct object or
service.</p><p>In many cases, Tapestry must match a field type to an available
IoC service.</p><p>If there is only single service in the registry that
implements the service, Tapestry will utilize that service.</p><p>When there is
more than one such service, it is necessary to disambiguate which service is to
be injected. To disambiguate globally (across all injections), you must create
an alias from the service interface directly to the particular
service.</p><p>This takes the form of a contribution to the Alias
service.</p><p>The Alias service has additional purposes: first, it allows for
spot overrides on injected services, based on the application's mode.
Currently, the only mode is "servlet",
but future modes may include "portlet" and possibly
"offline".</p><p>Secondly, the companion AliasOverrides service configuration
allows for spot overrides of specific services, without disturbing the rest of
the network of services within the IoC Registry.</p><h1
id="Aliases-ContributinganAlias">Contributing an Alias</h1><p>To contribute a
new service to the Alias service, you must first decide on a logical name.
Often, this is the name of the service interface implemented by the
service.</p><p>You can then contribute into the Infrastructure service's
configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<p> </p><p>See <a href="ioc-cookbook-overriding-ioc-services.html">IoC
Cookbook - Overriding IoC Services</a></p><h1
id="Aliases-Introduction">Introduction</h1><p>Tapestry goes to great lengths so
that you can use the <a href="injection.html">Inject</a> annotation on a field
and provide no additional data, yet end up with the correct object or
service.</p><p>In many cases, Tapestry must match a field type to an available
IoC service.</p><p>If there is only single service in the registry that
implements the service, Tapestry will utilize that service.</p><p>When there is
more than one such service, it is necessary to disambiguate which service is to
be injected. To disambiguate globally (across all injections), you must create
an alias from the service interface directly to the particular
service.</p><p>This takes the form of a contribution to the Alias
service.</p><p>The Alias service has additional purposes: first, it allows for
spot overrides on injected services, based on
the application's mode. Currently, the only mode is "servlet", but future
modes may include "portlet" and possibly "offline".</p><p>Secondly, the
companion AliasOverrides service configuration allows for spot overrides of
specific services, without disturbing the rest of the network of services
within the IoC Registry.</p><h1 id="Aliases-ContributinganAlias">Contributing
an Alias</h1><p>To contribute a new service to the Alias service, you must
first decide on a logical name. Often, this is the name of the service
interface implemented by the service.</p><p>You can then contribute into the
Infrastructure service's configuration:</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 static void
contributeAlias(@InjectService("MyService") MyService myService,
Configuration<AliasContribution> configuration)
{
configuration.add(AliasContribution.create(MyService.class, myService));
}</pre>
-</div></div><p> </p><p> </p><p>The above example follows a typical
pattern; the service to be vended is injected into the contributor method,
using the explicit InjectService annotation. A contribution is made providing
the service type.</p><p>Notice that the contribution doesn't _have_ to be a
service; you can just instantiate an object inside the contribution method and
contribute that. That's what we're doing in the example, though we're using a
create() static method rather than *new* (just to smooth out some Java Generics
ugliness).</p><h1 id="Aliases-ContributingtoAliasOverrides">Contributing to
AliasOverrides</h1><p>To override a service, you need to know its service
interface name.</p><p>You can then make a contribution to the AliasOverrides
service configuration, as described in the previous section.</p><p>The object
contributed as an override will mask the default contribution.</p></div>
+</div></div><p> </p><p> </p><p>The above example follows a typical
pattern; the service to be vended is injected into the contributor method,
using the explicit InjectService annotation. A contribution is made providing
the service type.</p><p>Notice that the contribution doesn't <em>have</em> to
be a service; you can just instantiate an object inside the contribution method
and contribute that. That's what we're doing in the example, though we're using
a create() static method rather than *new* (just to smooth out some Java
Generics ugliness).</p><h1
id="Aliases-ContributingtoAliasOverrides">Contributing to
AliasOverrides</h1><p>To override a service, you need to know its service
interface name.</p><p>You can then make a contribution to the AliasOverrides
service configuration, as described in the previous section.</p><p>The object
contributed as an override will mask the default contribution.</p></div>
</div>
<div class="clearer"></div>
Modified: websites/production/tapestry/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/tapestry/content/client-side-javascript.html
==============================================================================
--- websites/production/tapestry/content/client-side-javascript.html (original)
+++ websites/production/tapestry/content/client-side-javascript.html Sun Feb 18
21:21:20 2018
@@ -109,6 +109,15 @@
<span class="icon aui-icon aui-icon-small
aui-iconfont-page-default" title="Page">Page:</span> </div>
<div class="details">
+ <a href="typescript.html">TypeScript</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="coffeescript.html">CoffeeScript</a>
@@ -171,7 +180,7 @@
</div>
-<p>The <a href="client-side-javascript.html">legacy JavaScript</a> page
discusses the earlier approaches; the main feature of Tapestry 5.4 is a total
rewrite of all things client-side, with the following goals:</p><ul><li>Break
the hard linkage of Tapestry to <a class="external-link"
href="http://prototypejs.org/" rel="nofollow">Prototype</a> and <a
class="external-link" href="http://script.aculo.us/"
rel="nofollow">Scriptaculous</a>, by introducing an abstraction
layer</li><li>Remove the clumsy <code>Tapestry</code> and <code>T5</code>
"namespaces"</li><li>Reduce the amount of page-specific JavaScript
initialization</li><li>Make it easier to override behavior associated with
client elements</li><li>Support CoffeeScript and (potentially) other languages
that target JavaScript</li><li>Organize client-side JavaScript using <a
href="client-side-javascript.html">modules</a></li><li>Make pages load
faster</li><li>Integrate <a class="external-link"
href="http://getbootstrap.com/" rel
="nofollow">Bootstrap</a></li><li>Make it easier for rich client libraries
such as <a class="external-link" href="http://backbonejs.org/"
rel="nofollow">Backbone</a> or <a class="external-link"
href="https://angularjs.org/" rel="nofollow">AngularJS</a> to operate within a
page</li><li>Properly document Tapestry's client support</li></ul><h3
id="Client-SideJavaScript-TheOverallVision">The Overall Vision</h3><p>The
overall vision for the client-side in Tapestry is encapsulation, at several
different levels.</p><p>On the server-side, a Tapestry component (or mixin)
exposes configurable parameters. The component writes DOM elements or
attributes, as well as some amount of JavaScript initialization. The
encapsulation here allows developers with little or no knowledge of client-side
JavaScript to enjoy the benefits (as consumers of components created by
developers who are versed in client-side coding and Tapestry
components).</p><p>On the client-side, the JavaScript combines w
ith the special markup to produce the behaviors that are desired ... anything
from controlling the initial focus field, to performing client-side input field
validation, to running complex Ajax workflows.</p><p>Where possible, all of
this behavior is driven by <code>data-</code> attributes on the elements,
combined with top-level event handlers. On the client side, events are used not
only to respond directly to user actions (with "click", "mouseOver", "submit",
or other event listeners) but also to allow elements to collaborate in various
ways.  For example, input validation is based on triggering a specific
custom event on each form control element, and top-level event handlers can
then manage the validation for any number of fields.</p><h3
id="Client-SideJavaScript-Prototypevs.jQuery">Prototype vs. jQuery</h3><p>For
several years, it has been obvious that Tapestry "backed the wrong horse" with
respect to Prototype and jQuery. When the first code was being laid down in
2007 o
r 2008, it wasn't so clear that jQuery with its odd abstractions and
unfamiliar approach, would go on to conquer the world. Meanwhile, Prototype was
very strongly integrated into Ruby on Rails and had first class documentation
and books.</p><p>That being said, jQuery is not the be-all and end-all either.
Tapestry 5.4 introduces an abstraction layer, that allows many components to
write code that doesn't care whether the foundation framework is Prototype or
jQuery or something else. If<span> you like jQuery then there's no
problem: write your application using just jQuery and you can ignore a lot of
the features in the abstraction layer. Your code will likely be just a bit more
efficient.</span></p><p>If you are building a reusable component or library,
writing to the abstraction layer may be worth the effort; it is entirely
possible that someone may write a replacement for the abstraction layer that
targets your favorite foundation framework, such as ExtJS, MooTools, or somethi
ng not even known of today.</p><h3
id="Client-SideJavaScript-Heavyvs.Light">Heavy vs. Light</h3><p>Earlier
Tapestry JavaScript was <em>heavy</em>. Essentially, each component would
write some very specific JavaScript initialization that would include the
component's DOM id and many other details. This initialization would reference
a function on the <code>T5.inits</code> namespace.</p><p>The function there
would typically locate the specific element by its client DOM id, then attach
event handlers to the one element. It might also create some form of
client-side controller object. There were issues due to this: for complex pages
(or perhaps even typical pages), the "blob" of JavaScript initialization at the
bottom of the page could be quite large.</p><p>The use of individual event
handlers meant that Tapestry applications would use more client-side objects
that a bespoke jQuery solution ... because the normal approach in jQuery is to
attach a single event handler to the documen
t or body that handles any events that bubble up to the top <em>and</em>
match a CSS selector.</p><p>In Tapestry 5.4, the goal is to make
things <em>light</em>. In most cases, there isn't a specific
initialization function; instead a <a
href="client-side-javascript.html">JavaScript module</a> is loaded, and it
installs one or more top-level event handlers; the elements has data-<a
class="external-link"
href="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes"
rel="nofollow"> attributes</a> that are used by those top level handlers
to recognize which elements they are responsible for.</p><p>This is more of a
full lifecycle approach; adding or removing page content (such as with
a <a href="client-side-javascript.html">Zone</a> component) is both
cheaper and less error prone using top-level event handlers than per-element
event handlers; there's also less of a chance of memory leaks under Internet
Explorer.</p><div class="confluenc
e-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>Internet Explorer is pretty well
known for memory leaks; its DOM and JavaScript run in different kinds of
memory, which are garbage collected individually. This means that a reference
from JavaScript to a DOM element will keep the DOM element live, even if that's
the only reference to the DOM element anywhere. Meanwhile, event handler
JavaScript functions are kept live from the DOM element, making a cycle that
can't be broken. Libraries like Prototype and jQuery have to expend some effort
to break this link by unregistering event handlers from DOM elements when
removing them from the DOM.</p></div></div><p>A specific example of this
approach is how client-side validation now works; in the past, there was a
complex system of classes and event listeners that were specific to each ind
ividual field. Field controllers had to register with Form controllers.
Validators had to register with Field controllers.</p><p>Under 5.4, there are a
number of <code>data-</code> attributes that can be attached to any DOM
element. A form searches for elements with a non-blank value
for <code>data-validation</code>; each such element has a series of custom
events triggered on it. The top-level handlers for those events receive
notifications for elements throughout the document.</p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl"
style="border-bottom-width: 1px;"><b>t5/core/validation.coffee
(partial)</b></div><div class="codeContent panelContent pdl">
+<p>The <a href="legacy-javascript.html">legacy JavaScript</a> page discusses
the earlier approaches; the main feature of Tapestry 5.4 is a total rewrite of
all things client-side, with the following goals:</p><ul><li>Break the hard
linkage of Tapestry to <a class="external-link" href="http://prototypejs.org/"
rel="nofollow">Prototype</a> and <a class="external-link"
href="http://script.aculo.us/" rel="nofollow">Scriptaculous</a>, by introducing
an abstraction layer</li><li>Remove the clumsy <code>Tapestry</code> and
<code>T5</code> "namespaces"</li><li>Reduce the amount of page-specific
JavaScript initialization</li><li>Make it easier to override behavior
associated with client elements</li><li>Support CoffeeScript and (potentially)
other languages that target JavaScript</li><li>Organize client-side JavaScript
using <a href="javascript-modules.html">modules</a></li><li>Make pages load
faster</li><li>Integrate <a class="external-link"
href="http://getbootstrap.com/" rel="nofollo
w">Bootstrap</a></li><li>Make it easier for rich client libraries such
as <a class="external-link" href="http://backbonejs.org/"
rel="nofollow">Backbone</a> or <a class="external-link"
href="https://angularjs.org/" rel="nofollow">AngularJS</a> to operate within a
page</li><li>Properly document Tapestry's client support</li></ul><h3
id="Client-SideJavaScript-TheOverallVision">The Overall Vision</h3><p>The
overall vision for the client-side in Tapestry is encapsulation, at several
different levels.</p><p>On the server-side, a Tapestry component (or mixin)
exposes configurable parameters. The component writes DOM elements or
attributes, as well as some amount of JavaScript initialization. The
encapsulation here allows developers with little or no knowledge of client-side
JavaScript to enjoy the benefits (as consumers of components created by
developers who are versed in client-side coding and Tapestry
components).</p><p>On the client-side, the JavaScript combines with the s
pecial markup to produce the behaviors that are desired ... anything from
controlling the initial focus field, to performing client-side input field
validation, to running complex Ajax workflows.</p><p>Where possible, all of
this behavior is driven by <code>data-</code> attributes on the elements,
combined with top-level event handlers. On the client side, events are used not
only to respond directly to user actions (with "click", "mouseOver", "submit",
or other event listeners) but also to allow elements to collaborate in various
ways.  For example, input validation is based on triggering a specific
custom event on each form control element, and top-level event handlers can
then manage the validation for any number of fields.</p><h3
id="Client-SideJavaScript-Prototypevs.jQuery">Prototype vs. jQuery</h3><p>For
several years, it has been obvious that Tapestry "backed the wrong horse" with
respect to Prototype and jQuery. When the first code was being laid down in
2007 or 2008, i
t wasn't so clear that jQuery with its odd abstractions and unfamiliar
approach, would go on to conquer the world. Meanwhile, Prototype was very
strongly integrated into Ruby on Rails and had first class documentation and
books.</p><p>That being said, jQuery is not the be-all and end-all either.
Tapestry 5.4 introduces an abstraction layer, that allows many components to
write code that doesn't care whether the foundation framework is Prototype or
jQuery or something else. If<span> you like jQuery then there's no
problem: write your application using just jQuery and you can ignore a lot of
the features in the abstraction layer. Your code will likely be just a bit more
efficient.</span></p><p>If you are building a reusable component or library,
writing to the abstraction layer may be worth the effort; it is entirely
possible that someone may write a replacement for the abstraction layer that
targets your favorite foundation framework, such as ExtJS, MooTools, or
something not ev
en known of today.</p><h3 id="Client-SideJavaScript-Heavyvs.Light">Heavy vs.
Light</h3><p>Earlier Tapestry JavaScript was <em>heavy</em>. Essentially,
each component would write some very specific JavaScript initialization that
would include the component's DOM id and many other details. This
initialization would reference a function on the <code>T5.inits</code>
namespace.</p><p>The function there would typically locate the specific element
by its client DOM id, then attach event handlers to the one element. It might
also create some form of client-side controller object. There were issues due
to this: for complex pages (or perhaps even typical pages), the "blob" of
JavaScript initialization at the bottom of the page could be quite
large.</p><p>The use of individual event handlers meant that Tapestry
applications would use more client-side objects that a bespoke jQuery solution
... because the normal approach in jQuery is to attach a single event handler
to the document or body
that handles any events that bubble up to the top <em>and</em> match a
CSS selector.</p><p>In Tapestry 5.4, the goal is to make
things <em>light</em>. In most cases, there isn't a specific
initialization function; instead a <a
href="client-side-javascript.html">JavaScript module</a> is loaded, and it
installs one or more top-level event handlers; the elements has data-<a
class="external-link"
href="https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_data_attributes"
rel="nofollow"> attributes</a> that are used by those top level handlers
to recognize which elements they are responsible for.</p><p>This is more of a
full lifecycle approach; adding or removing page content (such as with
a <a href="client-side-javascript.html">Zone</a> component) is both
cheaper and less error prone using top-level event handlers than per-element
event handlers; there's also less of a chance of memory leaks under Internet
Explorer.</p><div class="confluence-informa
tion-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>Internet Explorer is pretty well
known for memory leaks; its DOM and JavaScript run in different kinds of
memory, which are garbage collected individually. This means that a reference
from JavaScript to a DOM element will keep the DOM element live, even if that's
the only reference to the DOM element anywhere. Meanwhile, event handler
JavaScript functions are kept live from the DOM element, making a cycle that
can't be broken. Libraries like Prototype and jQuery have to expend some effort
to break this link by unregistering event handlers from DOM elements when
removing them from the DOM.</p></div></div><p>A specific example of this
approach is how client-side validation now works; in the past, there was a
complex system of classes and event listeners that were specific to each
individual f
ield. Field controllers had to register with Form controllers. Validators had
to register with Field controllers.</p><p>Under 5.4, there are a number
of <code>data-</code> attributes that can be attached to any DOM element.
A form searches for elements with a non-blank value
for <code>data-validation</code>; each such element has a series of custom
events triggered on it. The top-level handlers for those events receive
notifications for elements throughout the document.</p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl"
style="border-bottom-width: 1px;"><b>t5/core/validation.coffee
(partial)</b></div><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">define ["underscore", "./dom", "./events", "./utils",
"./messages", "./fields"],
(_, dom, events, utils, messages) ->
Modified: websites/production/tapestry/content/documentation.html
==============================================================================
--- websites/production/tapestry/content/documentation.html (original)
+++ websites/production/tapestry/content/documentation.html Sun Feb 18 21:21:20
2018
@@ -67,7 +67,7 @@
</div>
<div id="content">
- <div id="ConfluenceContent"><div
style="float:right;margin-left:1em"><h2 id="Documentation-AllTopics">All
Topics</h2><ul class="childpages-macro"><li><a
href="introduction.html">Introduction</a></li><li><a
href="getting-started.html">Getting Started</a></li><li><a
href="principles.html">Principles</a></li><li><a
href="tapestry-tutorial.html">Tapestry Tutorial</a><ul
class="childpages-macro"><li><a
href="dependencies-tools-and-plugins.html">Dependencies, Tools and
Plugins</a></li><li><a href="creating-the-skeleton-application.html">Creating
The Skeleton Application</a></li><li><a
href="exploring-the-project.html">Exploring the Project</a></li><li><a
href="implementing-the-hi-lo-guessing-game.html">Implementing the Hi-Lo
Guessing Game</a></li><li><a
href="using-beaneditform-to-create-user-forms.html">Using BeanEditForm To
Create User Forms</a></li><li><a
href="using-tapestry-with-hibernate.html">Using Tapestry With
Hibernate</a></li></ul></li><li><a href="us
er-guide.html">User Guide</a><ul class="childpages-macro"><li><a
href="supported-environments-and-versions.html">Supported Environments and
Versions</a></li><li><a href="project-layout.html">Project
Layout</a></li><li><a href="configuration.html">Configuration</a></li><li><a
href="runtime-exceptions.html">Runtime Exceptions</a></li><li><a
href="class-reloading.html">Class Reloading</a></li><li><a
href="component-reference.html">Component Reference</a></li><li><a
href="annotations.html">Annotations</a></li><li><a
href="component-classes.html">Component Classes</a></li><li><a
href="component-templates.html">Component Templates</a></li><li><a
href="property-expressions.html">Property Expressions</a></li><li><a
href="component-parameters.html">Component Parameters</a></li><li><a
href="parameter-type-coercion.html">Parameter Type Coercion</a></li><li><a
href="layout-component.html">Layout Component</a></li><li><a
href="component-mixins.html">Component Mixins</a><ul class="c
hildpages-macro"><li><a href="built-in-mixins.html">Built-in
Mixins</a></li></ul></li><li><a href="page-navigation.html">Page
Navigation</a></li><li><a href="localization.html">Localization</a></li><li><a
href="page-life-cycle.html">Page Life Cycle</a></li><li><a
href="request-processing.html">Request Processing</a></li><li><a
href="component-rendering.html">Component Rendering</a></li><li><a
href="component-events.html">Component Events</a></li><li><a
href="url-rewriting.html">URL rewriting</a></li><li><a
href="dom.html">DOM</a></li><li><a href="response-compression.html">Response
Compression</a></li><li><a href="security.html">Security</a></li><li><a
href="https.html">HTTPS</a></li><li><a
href="content-type-and-markup.html">Content Type and Markup</a></li><li><a
href="persistent-page-data.html">Persistent Page Data</a></li><li><a
href="session-storage.html">Session Storage</a><ul
class="childpages-macro"><li><a href="clustering-issues.html">Clustering
Issues</a></l
i></ul></li><li><a href="injection.html">Injection</a></li><li><a
href="environmental-services.html">Environmental Services</a></li><li><a
href="css.html">CSS</a></li><li><a href="assets.html">Assets</a></li><li><a
href="forms-and-validation.html">Forms and Validation</a></li><li><a
href="beaneditform-guide.html">BeanEditForm Guide</a></li><li><a
href="uploading-files.html">Uploading Files</a></li><li><a
href="logging.html">Logging</a></li><li><a
href="unit-testing-pages-or-components.html">Unit testing pages or
components</a></li><li><a href="integration-testing.html">Integration
Testing</a></li><li><a href="development-dashboard.html">Development
Dashboard</a></li><li><a href="modules.html">Modules</a><ul
class="childpages-macro"><li><a href="built-in-modules.html">Built In
Modules</a></li><li><a href="third-party-modules.html">Third Party
Modules</a></li></ul></li><li><a href="ioc.html">IOC</a><ul
class="childpages-macro"><li><a href="tapestry-ioc-overview.html">T
apestry IoC Overview</a></li><li><a href="tapestry-ioc-modules.html">Tapestry
IoC Modules</a></li><li><a href="defining-tapestry-ioc-services.html">Defining
Tapestry IOC Services</a></li><li><a href="service-advisors.html">Service
Advisors</a></li><li><a href="tapestry-ioc-decorators.html">Tapestry IoC
Decorators</a></li><li><a href="tapestry-ioc-configuration.html">Tapestry IoC
Configuration</a></li><li><a href="case-insensitivity.html">Case
Insensitivity</a></li><li><a href="autoloading-modules.html">Autoloading
Modules</a></li><li><a href="service-implementation-reloading.html">Service
Implementation Reloading</a></li><li><a
href="ordering-by-constraints.html">Ordering by Constraints</a></li><li><a
href="symbols.html">Symbols</a></li><li><a
href="chainbuilder-service.html">ChainBuilder Service</a></li><li><a
href="pipelinebuilder-service.html">PipelineBuilder Service</a></li><li><a
href="shadowbuilder-service.html">ShadowBuilder Service</a></li><li><a
href="strategy
builder-service.html">StrategyBuilder Service</a></li><li><a
href="injection-in-detail.html">Injection in Detail</a></li><li><a
href="object-providers.html">Object Providers</a></li><li><a
href="service-serialization.html">Service Serialization</a></li><li><a
href="type-coercion.html">Type Coercion</a></li><li><a
href="starting-the-ioc-registry.html">Starting the IoC Registry</a></li><li><a
href="registry-startup.html">Registry Startup</a></li><li><a
href="parallel-execution.html">Parallel Execution</a></li><li><a
href="logging-in-tapestry.html">Logging in Tapestry</a></li><li><a
href="using-jsr-330-standard-annotations.html">Using JSR 330 standard
annotations</a></li><li><a href="operation-tracker.html">Operation
Tracker</a></li></ul></li><li><a href="hibernate-core.html">Hibernate -
Core</a><ul class="childpages-macro"><li><a
href="hibernate-core-conf.html">Hibernate - Core - Conf</a></li><li><a
href="hibernate.html">Hibernate</a></li></ul></li><li><a href="integrati
ng-with-spring-framework.html">Integrating with Spring
Framework</a></li><li><a href="bean-validation.html">Bean
Validation</a></li><li><a href="component-report.html">Component
Report</a></li><li><a href="aliases.html">Aliases</a></li><li><a
href="integrating-with-jpa.html">Integrating with JPA</a></li><li><a
href="client-side-javascript.html">Client-Side JavaScript</a><ul
class="childpages-macro"><li><a href="javascript-modules.html">JavaScript
Modules</a></li><li><a href="coffeescript.html">CoffeeScript</a></li><li><a
href="legacy-javascript.html">Legacy JavaScript</a></li><li><a
href="ajax-and-zones.html">Ajax and Zones</a></li></ul></li></ul></li><li><a
href="cheat-sheets.html">Cheat Sheets</a><ul class="childpages-macro"><li><a
href="application-module-class-cheat-sheet.html">Application Module Class Cheat
Sheet</a></li><li><a href="component-cheat-sheet.html">Component Cheat
Sheet</a></li><li><a href="tapestry-for-jsf-users.html">Tapestry for JSF
Users</a></li></
ul></li><li><a href="cookbook.html">Cookbook</a><ul
class="childpages-macro"><li><a href="default-parameter.html">Default
Parameter</a></li><li><a href="overriding-exception-reporting.html">Overriding
Exception Reporting</a></li><li><a href="error-page-recipe.html">Error Page
Recipe</a></li><li><a href="supporting-informal-parameters.html">Supporting
Informal Parameters</a></li><li><a href="component-libraries.html">Component
Libraries</a></li><li><a href="switching-cases.html">Switching
Cases</a></li><li><a href="enum-parameter-recipe.html">Enum Parameter
Recipe</a></li><li><a href="extending-the-if-component.html">Extending the If
Component</a></li><li><a
href="meta-programming-page-content.html">Meta-Programming Page
Content</a></li><li><a href="using-select-with-a-list.html">Using Select With
a List</a></li><li><a href="ioc-cookbook.html">IoC cookbook</a><ul
class="childpages-macro"><li><a
href="ioc-cookbook-basic-services-and-injection.html">IoC Cookbook - Basic Se
rvices and Injection</a></li><li><a
href="ioc-cookbook-overriding-ioc-services.html">IoC Cookbook - Overriding IoC
Services</a></li><li><a href="ioc-cookbook-patterns.html">IoC Cookbook -
Patterns</a></li><li><a href="ioc-cookbook-service-configurations.html">IoC
cookbook - Service Configurations</a></li></ul></li><li><a
href="performance-and-clustering.html">Performance and
Clustering</a></li><li><a href="google-app-engine.html">Google App
Engine</a></li></ul></li><li><a
href="frequently-asked-questions.html">Frequently Asked Questions</a><ul
class="childpages-macro"><li><a href="general-questions.html">General
Questions</a></li><li><a href="templating-and-markup-faq.html">Templating and
Markup FAQ</a></li><li><a href="page-and-component-classes-faq.html">Page And
Component Classes FAQ</a></li><li><a
href="forms-and-form-components-faq.html">Forms and Form Components
FAQ</a></li><li><a href="beaneditform-faq.html">BeanEditForm
FAQ</a></li><li><a href="link-components-fa
q.html">Link Components FAQ</a></li><li><a
href="component-events-faq.html">Component Events FAQ</a></li><li><a
href="javascript-faq.html">JavaScript FAQ</a></li><li><a
href="ajax-components-faq.html">Ajax Components FAQ</a></li><li><a
href="injection-faq.html">Injection FAQ</a></li><li><a
href="tapestry-inversion-of-control-faq.html">Tapestry Inversion of Control
FAQ</a></li><li><a href="security-faq.html">Security FAQ</a></li><li><a
href="integration-with-existing-applications.html">Integration with existing
applications</a></li><li><a href="request-processing-faq.html">Request
Processing FAQ</a></li><li><a
href="limitations.html">Limitations</a></li><li><a
href="specific-errors-faq.html">Specific Errors FAQ</a></li><li><a
href="hibernate-support-faq.html">Hibernate Support FAQ</a></li><li><a
href="maven-support-faq.html">Maven Support FAQ</a></li><li><a
href="release-upgrade-faq.html">Release Upgrade FAQ</a></li></ul></li><li><a
href="release-notes.html">Release Not
es</a><ul class="childpages-macro"><li><a href="how-to-upgrade.html">How to
Upgrade</a></li><li><a href="release-notes-50.html">Release Notes
5.0</a></li><li><a href="release-notes-51.html">Release Notes
5.1</a></li><li><a href="release-notes-52.html">Release Notes 5.2</a><ul
class="childpages-macro"><li><a href="release-notes-520.html">Release Notes
5.2.0</a></li><li><a href="release-notes-521.html">Release Notes
5.2.1</a></li><li><a href="release-notes-522.html">Release Notes
5.2.2</a></li><li><a href="release-notes-523.html">Release Notes
5.2.3</a></li><li><a href="release-notes-524.html">Release Notes
5.2.4</a></li><li><a href="release-notes-525.html">Release Notes
5.2.5</a></li><li><a href="release-notes-526.html">Release Notes
5.2.6</a></li></ul></li><li><a href="release-notes-53.html">Release Notes
5.3</a></li><li><a href="release-notes-531.html">Release Notes
5.3.1</a></li><li><a href="release-notes-532.html">Release Notes
5.3.2</a></li><li><a href="release-no
tes-533.html">Release Notes 5.3.3</a></li><li><a
href="release-notes-534.html">Release Notes 5.3.4</a></li><li><a
href="release-notes-535.html">Release Notes 5.3.5</a></li><li><a
href="release-notes-536.html">Release Notes 5.3.6</a></li><li><a
href="release-notes-537.html">Release Notes 5.3.7</a></li><li><a
href="release-notes-538.html">Release Notes 5.3.8</a></li><li><a
href="release-notes-54.html">Release Notes 5.4</a></li><li><a
href="release-notes-541.html">Release Notes 5.4.1</a></li><li><a
href="release-notes-542.html">Release Notes 5.4.2</a></li><li><a
href="release-notes-543.html">Release Notes 5.4.3</a></li></ul></li><li><a
href="javascript-rewrite-in-54.html">JavaScript Rewrite in 5.4</a></li><li><a
href="support.html">Support</a></li><li><a
href="developer-information.html">Developer Information</a><ul
class="childpages-macro"><li><a
href="building-tapestry-from-source.html">Building Tapestry from
Source</a></li><li><a href="confluence-site-setup.html">Confl
uence Site Setup</a><ul class="childpages-macro"><li><a
href="since-and-deprecated-user-macros.html">Since and Deprecated User
Macros</a></li></ul></li><li><a href="developer-bible.html">Developer
Bible</a></li><li><a href="release-process.html">Release
Process</a></li><li><a href="the-tapestry-jail.html">The tapestry
jail</a></li><li><a href="version-numbers.html">Version
Numbers</a></li></ul></li></ul></div>
+ <div id="ConfluenceContent"><div
style="float:right;margin-left:1em"><h2 id="Documentation-AllTopics">All
Topics</h2><ul class="childpages-macro"><li><a
href="introduction.html">Introduction</a></li><li><a
href="getting-started.html">Getting Started</a></li><li><a
href="principles.html">Principles</a></li><li><a
href="tapestry-tutorial.html">Tapestry Tutorial</a><ul
class="childpages-macro"><li><a
href="dependencies-tools-and-plugins.html">Dependencies, Tools and
Plugins</a></li><li><a href="creating-the-skeleton-application.html">Creating
The Skeleton Application</a></li><li><a
href="exploring-the-project.html">Exploring the Project</a></li><li><a
href="implementing-the-hi-lo-guessing-game.html">Implementing the Hi-Lo
Guessing Game</a></li><li><a
href="using-beaneditform-to-create-user-forms.html">Using BeanEditForm To
Create User Forms</a></li><li><a
href="using-tapestry-with-hibernate.html">Using Tapestry With
Hibernate</a></li></ul></li><li><a href="us
er-guide.html">User Guide</a><ul class="childpages-macro"><li><a
href="supported-environments-and-versions.html">Supported Environments and
Versions</a></li><li><a href="project-layout.html">Project
Layout</a></li><li><a href="configuration.html">Configuration</a></li><li><a
href="runtime-exceptions.html">Runtime Exceptions</a></li><li><a
href="class-reloading.html">Class Reloading</a></li><li><a
href="component-reference.html">Component Reference</a></li><li><a
href="annotations.html">Annotations</a></li><li><a
href="component-classes.html">Component Classes</a></li><li><a
href="component-templates.html">Component Templates</a></li><li><a
href="property-expressions.html">Property Expressions</a></li><li><a
href="component-parameters.html">Component Parameters</a></li><li><a
href="parameter-type-coercion.html">Parameter Type Coercion</a></li><li><a
href="layout-component.html">Layout Component</a></li><li><a
href="component-mixins.html">Component Mixins</a><ul class="c
hildpages-macro"><li><a href="built-in-mixins.html">Built-in
Mixins</a></li></ul></li><li><a href="page-navigation.html">Page
Navigation</a></li><li><a href="localization.html">Localization</a></li><li><a
href="page-life-cycle.html">Page Life Cycle</a></li><li><a
href="request-processing.html">Request Processing</a></li><li><a
href="component-rendering.html">Component Rendering</a></li><li><a
href="component-events.html">Component Events</a></li><li><a
href="url-rewriting.html">URL rewriting</a></li><li><a
href="dom.html">DOM</a></li><li><a href="response-compression.html">Response
Compression</a></li><li><a href="security.html">Security</a></li><li><a
href="https.html">HTTPS</a></li><li><a
href="content-type-and-markup.html">Content Type and Markup</a></li><li><a
href="persistent-page-data.html">Persistent Page Data</a></li><li><a
href="session-storage.html">Session Storage</a><ul
class="childpages-macro"><li><a href="clustering-issues.html">Clustering
Issues</a></l
i></ul></li><li><a href="injection.html">Injection</a></li><li><a
href="environmental-services.html">Environmental Services</a></li><li><a
href="css.html">CSS</a></li><li><a href="assets.html">Assets</a></li><li><a
href="forms-and-validation.html">Forms and Validation</a></li><li><a
href="beaneditform-guide.html">BeanEditForm Guide</a></li><li><a
href="uploading-files.html">Uploading Files</a></li><li><a
href="logging.html">Logging</a></li><li><a
href="unit-testing-pages-or-components.html">Unit testing pages or
components</a></li><li><a href="integration-testing.html">Integration
Testing</a></li><li><a href="development-dashboard.html">Development
Dashboard</a></li><li><a href="modules.html">Modules</a><ul
class="childpages-macro"><li><a href="built-in-modules.html">Built In
Modules</a></li><li><a href="third-party-modules.html">Third Party
Modules</a></li></ul></li><li><a href="ioc.html">IOC</a><ul
class="childpages-macro"><li><a href="tapestry-ioc-overview.html">T
apestry IoC Overview</a></li><li><a href="tapestry-ioc-modules.html">Tapestry
IoC Modules</a></li><li><a href="defining-tapestry-ioc-services.html">Defining
Tapestry IOC Services</a></li><li><a href="service-advisors.html">Service
Advisors</a></li><li><a href="tapestry-ioc-decorators.html">Tapestry IoC
Decorators</a></li><li><a href="tapestry-ioc-configuration.html">Tapestry IoC
Configuration</a></li><li><a href="case-insensitivity.html">Case
Insensitivity</a></li><li><a href="autoloading-modules.html">Autoloading
Modules</a></li><li><a href="service-implementation-reloading.html">Service
Implementation Reloading</a></li><li><a
href="ordering-by-constraints.html">Ordering by Constraints</a></li><li><a
href="symbols.html">Symbols</a></li><li><a
href="chainbuilder-service.html">ChainBuilder Service</a></li><li><a
href="pipelinebuilder-service.html">PipelineBuilder Service</a></li><li><a
href="shadowbuilder-service.html">ShadowBuilder Service</a></li><li><a
href="strategy
builder-service.html">StrategyBuilder Service</a></li><li><a
href="injection-in-detail.html">Injection in Detail</a></li><li><a
href="object-providers.html">Object Providers</a></li><li><a
href="service-serialization.html">Service Serialization</a></li><li><a
href="type-coercion.html">Type Coercion</a></li><li><a
href="starting-the-ioc-registry.html">Starting the IoC Registry</a></li><li><a
href="registry-startup.html">Registry Startup</a></li><li><a
href="parallel-execution.html">Parallel Execution</a></li><li><a
href="logging-in-tapestry.html">Logging in Tapestry</a></li><li><a
href="using-jsr-330-standard-annotations.html">Using JSR 330 standard
annotations</a></li><li><a href="operation-tracker.html">Operation
Tracker</a></li></ul></li><li><a href="hibernate-core.html">Hibernate -
Core</a><ul class="childpages-macro"><li><a
href="hibernate-core-conf.html">Hibernate - Core - Conf</a></li><li><a
href="hibernate.html">Hibernate</a></li></ul></li><li><a href="integrati
ng-with-spring-framework.html">Integrating with Spring
Framework</a></li><li><a href="bean-validation.html">Bean
Validation</a></li><li><a href="component-report.html">Component
Report</a></li><li><a href="aliases.html">Aliases</a></li><li><a
href="integrating-with-jpa.html">Integrating with JPA</a></li><li><a
href="client-side-javascript.html">Client-Side JavaScript</a><ul
class="childpages-macro"><li><a href="javascript-modules.html">JavaScript
Modules</a></li><li><a href="coffeescript.html">CoffeeScript</a></li><li><a
href="typescript.html">TypeScript</a></li><li><a
href="legacy-javascript.html">Legacy JavaScript</a></li><li><a
href="ajax-and-zones.html">Ajax and Zones</a></li></ul></li></ul></li><li><a
href="cheat-sheets.html">Cheat Sheets</a><ul class="childpages-macro"><li><a
href="application-module-class-cheat-sheet.html">Application Module Class Cheat
Sheet</a></li><li><a href="component-cheat-sheet.html">Component Cheat
Sheet</a></li><li><a href="tapestry-for
-jsf-users.html">Tapestry for JSF Users</a></li></ul></li><li><a
href="cookbook.html">Cookbook</a><ul class="childpages-macro"><li><a
href="default-parameter.html">Default Parameter</a></li><li><a
href="overriding-exception-reporting.html">Overriding Exception
Reporting</a></li><li><a href="error-page-recipe.html">Error Page
Recipe</a></li><li><a href="supporting-informal-parameters.html">Supporting
Informal Parameters</a></li><li><a href="component-libraries.html">Component
Libraries</a></li><li><a href="switching-cases.html">Switching
Cases</a></li><li><a href="enum-parameter-recipe.html">Enum Parameter
Recipe</a></li><li><a href="extending-the-if-component.html">Extending the If
Component</a></li><li><a
href="meta-programming-page-content.html">Meta-Programming Page
Content</a></li><li><a href="using-select-with-a-list.html">Using Select With
a List</a></li><li><a href="ioc-cookbook.html">IoC cookbook</a><ul
class="childpages-macro"><li><a href="ioc-cookbook-basic-se
rvices-and-injection.html">IoC Cookbook - Basic Services and
Injection</a></li><li><a href="ioc-cookbook-overriding-ioc-services.html">IoC
Cookbook - Overriding IoC Services</a></li><li><a
href="ioc-cookbook-patterns.html">IoC Cookbook - Patterns</a></li><li><a
href="ioc-cookbook-service-configurations.html">IoC cookbook - Service
Configurations</a></li></ul></li><li><a
href="performance-and-clustering.html">Performance and
Clustering</a></li><li><a href="google-app-engine.html">Google App
Engine</a></li></ul></li><li><a
href="frequently-asked-questions.html">Frequently Asked Questions</a><ul
class="childpages-macro"><li><a href="general-questions.html">General
Questions</a></li><li><a href="templating-and-markup-faq.html">Templating and
Markup FAQ</a></li><li><a href="page-and-component-classes-faq.html">Page And
Component Classes FAQ</a></li><li><a
href="forms-and-form-components-faq.html">Forms and Form Components
FAQ</a></li><li><a href="beaneditform-faq.html">BeanEdi
tForm FAQ</a></li><li><a href="link-components-faq.html">Link Components
FAQ</a></li><li><a href="component-events-faq.html">Component Events
FAQ</a></li><li><a href="javascript-faq.html">JavaScript FAQ</a></li><li><a
href="ajax-components-faq.html">Ajax Components FAQ</a></li><li><a
href="injection-faq.html">Injection FAQ</a></li><li><a
href="tapestry-inversion-of-control-faq.html">Tapestry Inversion of Control
FAQ</a></li><li><a href="security-faq.html">Security FAQ</a></li><li><a
href="integration-with-existing-applications.html">Integration with existing
applications</a></li><li><a href="request-processing-faq.html">Request
Processing FAQ</a></li><li><a
href="limitations.html">Limitations</a></li><li><a
href="specific-errors-faq.html">Specific Errors FAQ</a></li><li><a
href="hibernate-support-faq.html">Hibernate Support FAQ</a></li><li><a
href="maven-support-faq.html">Maven Support FAQ</a></li><li><a
href="release-upgrade-faq.html">Release Upgrade FAQ</a></li></ul>
</li><li><a href="release-notes.html">Release Notes</a><ul
class="childpages-macro"><li><a href="how-to-upgrade.html">How to
Upgrade</a></li><li><a href="release-notes-50.html">Release Notes
5.0</a></li><li><a href="release-notes-51.html">Release Notes
5.1</a></li><li><a href="release-notes-52.html">Release Notes 5.2</a><ul
class="childpages-macro"><li><a href="release-notes-520.html">Release Notes
5.2.0</a></li><li><a href="release-notes-521.html">Release Notes
5.2.1</a></li><li><a href="release-notes-522.html">Release Notes
5.2.2</a></li><li><a href="release-notes-523.html">Release Notes
5.2.3</a></li><li><a href="release-notes-524.html">Release Notes
5.2.4</a></li><li><a href="release-notes-525.html">Release Notes
5.2.5</a></li><li><a href="release-notes-526.html">Release Notes
5.2.6</a></li></ul></li><li><a href="release-notes-53.html">Release Notes
5.3</a></li><li><a href="release-notes-531.html">Release Notes
5.3.1</a></li><li><a href="release-notes-532.html">Re
lease Notes 5.3.2</a></li><li><a href="release-notes-533.html">Release Notes
5.3.3</a></li><li><a href="release-notes-534.html">Release Notes
5.3.4</a></li><li><a href="release-notes-535.html">Release Notes
5.3.5</a></li><li><a href="release-notes-536.html">Release Notes
5.3.6</a></li><li><a href="release-notes-537.html">Release Notes
5.3.7</a></li><li><a href="release-notes-538.html">Release Notes
5.3.8</a></li><li><a href="release-notes-54.html">Release Notes
5.4</a></li><li><a href="release-notes-541.html">Release Notes
5.4.1</a></li><li><a href="release-notes-542.html">Release Notes
5.4.2</a></li><li><a href="release-notes-543.html">Release Notes
5.4.3</a></li></ul></li><li><a href="javascript-rewrite-in-54.html">JavaScript
Rewrite in 5.4</a></li><li><a href="support.html">Support</a></li><li><a
href="developer-information.html">Developer Information</a><ul
class="childpages-macro"><li><a
href="building-tapestry-from-source.html">Building Tapestry from Source</a></
li><li><a href="confluence-site-setup.html">Confluence Site Setup</a><ul
class="childpages-macro"><li><a
href="since-and-deprecated-user-macros.html">Since and Deprecated User
Macros</a></li></ul></li><li><a href="developer-bible.html">Developer
Bible</a></li><li><a href="release-process.html">Release
Process</a></li><li><a href="the-tapestry-jail.html">The tapestry
jail</a></li><li><a href="version-numbers.html">Version
Numbers</a></li></ul></li></ul></div>
<p>Welcome to the Tapestry 5 Documentation, a collection of guides to teach
beginners the basics and help experienced developers deepen their understanding
of Tapestry's power.</p><h1
id="Documentation-Highlights">Highlights</h1><p>These are the most useful
starting points for common needs.</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a
href="introduction.html">Introduction</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>An overview of Tapestry's general approach and
philosophy</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a href="getting-started.html">Getting
Started</a></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>A quick
guide to creating your first Tapestry project, using Maven</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><a
href="tapestry-tutorial.html">Tapestry Tutorial</a></p></td><td colspan="1"
rowspan="1" class="conf
luenceTd"><p>Picks up where <em>Getting Started</em> leaves off, explaining in
greater detail how Tapestry works</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a href="user-guide.html">User Guide</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Detailed articles on every
Tapestry feature</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a href="community.html">Community</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>Getting support, mailing lists,
JIRA, outside resources, and access to the source</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><a
href="cookbook.html">Cookbook</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Guides to doing common things with
Tapestry</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><strong><a
href="frequently-asked-questions.html">FAQ</a></strong></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>A quick pl
ace to check for common problems and solutions</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p><a
href="component-cheat-sheet.html">Component Cheat Sheet</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>A concise guide to component
classes, methods and annotations</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p><a class="external-link"
href="http://refcardz.dzone.com/refcardz/apache-tapestry-50?oid=hom7948"
rel="nofollow">Refcard</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>A color, six page foldout guide to Tapestry 5.0
(PDF)</p></td></tr></tbody></table></div><h1
id="Documentation-APIandComponentReference">API and Component
Reference</h1><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>API (Javadoc):</p></th><td colspan="1" rowspan="1"
class="confluenceTd"><p>5.0<sup>1</sup></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>5.
1<sup>1</sup></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>5.2<sup>1</sup></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><a class="external-link"
href="http://tapestry.apache.org/5.3.7/apidocs/">5.3.8</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><a class="external-link"
href="http://tapestry.apache.org/current">5.4</a></td></tr><tr><th colspan="1"
rowspan="1" class="confluenceTh"><p>Component Reference:</p></th><td
colspan="1" rowspan="1" class="confluenceTd"><p>5.0<sup>1</sup></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>5.1<sup>1</sup></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>5.2<sup>1</sup></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><em><span
class="confluence-link">(same as current)</span></em></p></td><td colspan="1"
rowspan="1" class="confluenceTd"><a href="component-reference.html">5.4
(current)</a></td></tr><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p>Release Notes:<
/p></th><td colspan="1" rowspan="1" class="confluenceTd"><p><a
href="release-notes-50.html">5.0</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><a href="release-notes-51.html">5.1</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><a
href="release-notes-52.html">5.2</a></p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p><a href="release-notes-538.html">5.3.8</a></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><a
href="release-notes-54.html">5.4</a></td></tr></tbody></table></div><p><sup>1</sup>
needs to be built manually from archived sources at <a class="external-link"
href="http://archive.apache.org/dist/tapestry/">http://archive.apache.org/dist/tapestry/</a>.</p><h1
id="Documentation-UserGuide">User Guide</h1><p><span
class="confluence-anchor-link" id="Documentation-userguide"></span>The <a
href="user-guide.html">User Guide</a> consists of over 75 pages of detailed
information on the concepts behind Tapestry and instructions o
n how to use this powerful tool. Highlights include:</p><ul><li
class="confluence-link"><a href="client-side-javascript.html">Client-Side
JavaScript</a> and <a href="ajax-and-zones.html">Ajax and Zones</a> describe
Tapestry's built-in support for dynamic in-page behavior.</li><li><a
href="integrating-with-spring-framework.html">Integrating with Spring
Framework</a> describes how to integrate Spring into your Tapestry
application.</li><li><a href="hibernate.html">Tapestry/Hibernate Integration
Library</a> provides out-of-the-box support for using Hibernate 3.</li><li><a
href="bean-validation.html">JSR 303: Bean Validation</a> shows how to use
standard annotations for validation</li><li><a
href="integration-testing.html">Integration Testing</a> shows how to test your
application with Selenium.</li></ul><p><a href="user-guide.html">More
topics</a>...</p><h1
id="Documentation-BlogsbyTapestryDevelopersandtheCommunity">Blogs by Tapestry
Developers and the Community</h1><ul><li><a
class="external-link" href="http://tapestryjava.blogspot.com/"
rel="nofollow">Tapestry Central</a> is Howard Lewis Ship's blog. As the creator
of Tapestry, he provides valuable insights into Tapestry's latest features and
future directions.</li><li><a class="external-link"
href="http://blog.tapestry5.de/" rel="nofollow">Igor Drobiazko's blog</a>
(committer & PMC) contains news on Tapestry development and will guide you
through some of the most exciting parts of Tapestry.</li><li><a
class="external-link" href="http://tawus.wordpress.com/" rel="nofollow">Java
Magic</a> (by Taha Hafeez, committer) has a series of tutorials illustrating
some of the more advanced Tapestry and Plastic features and
techniques.</li></ul><h1 id="Documentation-BooksonTapestry">Books on
Tapestry</h1><p>There are at least 9 published <a href="books.html">books on
Tapestry</a>, including three on Tapestry 5.</p><h1
id="Documentation-TapestryPresentations">Tapestry
Presentations</h1><ul><li>Mark Shead's <a
class="external-link"
href="http://blog.markshead.com/900/tapestry-5-10-minute-demo/"
rel="nofollow">10 Minute Demo</a></li><li>H. L. Ship's <a
class="external-link" href="https://www.youtube.com/watch?v=5BGt7eMFC20"
rel="nofollow">Tapestry 5.4 - Bootstrap-enhanced Exception
Reporting</a></li><li><a class="external-link"
href="http://jazoon.com/Portals/0/Content/slides/th_a7_1130-1220_drobiazko.pdf"
rel="nofollow">JavaServer Faces 2.0 vs. Tapestry 5</a> (PDF) A Head-to-Head
Comparison by Igor Drobiazko at Jazoon 2010</li><li><a class="external-link"
href="http://www.parleys.com/#st=5&sl=5&id=1700"
rel="nofollow">Tapestry 5: Java power, Scripting Ease</a> (VIDEO) by Howard
Lewis Ship at Devoxx 2009</li></ul><p><a href="presentations.html">More
presentations</a> ...</p><h1 id="Documentation-TapestryWikis">Tapestry
Wikis</h1><ul><li><a class="external-link"
href="http://wiki.apache.org/tapestry/FrontPage">Tapestry Community Wiki</a>
(Moin Moin) contains a lot of user-gen
erated information on different Tapestry use cases.</li><li><a
href="https://cwiki.apache.org/confluence/x/VCFkAQ">Documentation Source
wiki</a> (Confluence) – the wiki used as the content editor for the
official Tapestry documentation</li></ul><h1
id="Documentation-Gettinghelp">Getting help</h1><p>The primary method of
support is the <a href="mailing-lists.html">Tapestry Mailing
Lists</a>.</p><p>In addition, there are occasionally questions and answers
about Tapestry at <a class="external-link"
href="http://stackoverflow.com/questions/tagged/tapestry" rel="nofollow">Stack
Overflow</a>.</p><h1 id="Documentation-TheDeveloperCorner">The Developer
Corner</h1><p><a href="developer-information.html">Developer Information</a>
gives information needed by the Tapestry developers</p><p> </p></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 Sun Feb 18
21:21:20 2018
@@ -84,11 +84,11 @@
Added in 5.3
 
</div><p>Tapestry provides a built-in integration with the Java Persistence
API (JPA) through the <strong>Tapestry-jpa</strong> module. This module
supersedes the 3rd-party <a class="external-link"
href="http://www.tynamo.org/tapestry-jpa+guide/" rel="nofollow">Tynamo JPA
module</a>.</p><p><strong>Contents</strong></p><p><style
type="text/css">/*<![CDATA[*/
-div.rbtoc1518405707335 {padding: 0px;}
-div.rbtoc1518405707335 ul {list-style: disc;margin-left: 0px;}
-div.rbtoc1518405707335 li {margin-left: 0px;padding-left: 0px;}
+div.rbtoc1518988856515 {padding: 0px;}
+div.rbtoc1518988856515 ul {list-style: disc;margin-left: 0px;}
+div.rbtoc1518988856515 li {margin-left: 0px;padding-left: 0px;}
-/*]]>*/</style></p><div class="toc-macro rbtoc1518405707335">
+/*]]>*/</style></p><div class="toc-macro rbtoc1518988856515">
<ul class="toc-indentation"><li><a
href="#IntegratingwithJPA-Downloading">Downloading</a>
<ul class="toc-indentation"><li><a
href="#IntegratingwithJPA-SelectingaJPAImplementation">Selecting a JPA
Implementation</a></li></ul>
</li><li><a href="#IntegratingwithJPA-ConfiguringJPA">Configuring JPA</a>
@@ -183,7 +183,7 @@ div.rbtoc1518405707335 li {margin-left:
configuration.add("com.acme.model");
}
}</pre>
-</div></div><p>As you can see, you may add as many packages as you
wish.</p><h2 id="IntegratingwithJPA-ConfigurationSettings">Configuration
Settings</h2><p>Several aspects of Tapestry-jpa can be customized in your
application module (usually AppModule.java), just like other Tapestry <a
href="integrating-with-jpa.html">configuration symbols</a>.</p><div
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1"
rowspan="1" class="confluenceTh">Symbol</th><th colspan="1" rowspan="1"
class="confluenceTh">Default</th><th colspan="1" rowspan="1"
class="confluenceTh">Description</th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">JpaSymbols.PROVIDE_ENTITY_VALUE_ENCODERS</td><td
colspan="1" rowspan="1" class="confluenceTd">true</td><td colspan="1"
rowspan="1" class="confluenceTd">Whether entity value encoders will be provided
automatically. See <a href="integrating-with-jpa.html">Using Select with a
List</a>.</td></tr><tr><td colspan="1" rowspan="1" class="con
fluenceTd">JpaSymbols.EARLY_START_UP</td><td colspan="1" rowspan="1"
class="confluenceTd">true</td><td colspan="1" rowspan="1"
class="confluenceTd"><span style="color: rgb(33,33,33);">Whether JPA will be
started up at application launch, rather than lazily.</span></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd">JpaSymbols.ENTITY_SESSION_STATE_PERSISTENCE_STRATEGY_ENABLED</td><td
colspan="1" rowspan="1" class="confluenceTd">true</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Whether the "entity" persistence strategy
is used to store JPA entities as <code>Session State
Objects</code>.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">JpaSymbols.PERSISTENCE_DESCRIPTOR</td><td colspan="1"
rowspan="1" class="confluenceTd">/META-INF/persistence.xml</td><td colspan="1"
rowspan="1" class="confluenceTd"><span style="color: rgb(33,33,33);">The
location of the persistence configuration file, located on the classpath
</span></td></tr></tbody></table><
/div><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
class="external-link"
href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManager.html"
rel="nofollow">EntityManager</a> varies slightly. Let’s start with a
simple scenario, where only a single persistence unit is defined. In this case,
an EntityManager can be injected using the @<a class="external-link"
href="http://download.oracle.com/javaee/6/api/javax/persistence/PersistenceContext.html"
rel="nofollow">PersistenceContext</a> annotation.</p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="
border-bottom-width: 1px;"><b>CreateAddress.java</b></div><div
class="codeContent panelContent pdl">
+</div></div><p>As you can see, you may add as many packages as you
wish.</p><h2 id="IntegratingwithJPA-ConfigurationSettings">Configuration
Settings</h2><p>Several aspects of Tapestry-jpa can be customized in your
application module (usually AppModule.java), just like other Tapestry <a
href="configuration.html">configuration symbols</a>.</p><div
class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1"
rowspan="1" class="confluenceTh">Symbol</th><th colspan="1" rowspan="1"
class="confluenceTh">Default</th><th colspan="1" rowspan="1"
class="confluenceTh">Description</th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">JpaSymbols.PROVIDE_ENTITY_VALUE_ENCODERS</td><td
colspan="1" rowspan="1" class="confluenceTd">true</td><td colspan="1"
rowspan="1" class="confluenceTd">Whether entity value encoders will be provided
automatically. See <a href="integrating-with-jpa.html">Using Select with a
List</a>.</td></tr><tr><td colspan="1" rowspan="1" class="confluence
Td">JpaSymbols.EARLY_START_UP</td><td colspan="1" rowspan="1"
class="confluenceTd">true</td><td colspan="1" rowspan="1"
class="confluenceTd"><span style="color: rgb(33,33,33);">Whether JPA will be
started up at application launch, rather than lazily.</span></td></tr><tr><td
colspan="1" rowspan="1"
class="confluenceTd">JpaSymbols.ENTITY_SESSION_STATE_PERSISTENCE_STRATEGY_ENABLED</td><td
colspan="1" rowspan="1" class="confluenceTd">true</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Whether the "entity" persistence strategy
is used to store JPA entities as <code>Session State
Objects</code>.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">JpaSymbols.PERSISTENCE_DESCRIPTOR</td><td colspan="1"
rowspan="1" class="confluenceTd">/META-INF/persistence.xml</td><td colspan="1"
rowspan="1" class="confluenceTd"><span style="color: rgb(33,33,33);">The
location of the persistence configuration file, located on the classpath
</span></td></tr></tbody></table></div><h
1 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
class="external-link"
href="http://download.oracle.com/javaee/6/api/javax/persistence/EntityManager.html"
rel="nofollow">EntityManager</a> varies slightly. Let’s start with a
simple scenario, where only a single persistence unit is defined. In this case,
an EntityManager can be injected using the @<a class="external-link"
href="http://download.oracle.com/javaee/6/api/javax/persistence/PersistenceContext.html"
rel="nofollow">PersistenceContext</a> annotation.</p><div class="code panel
pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl"
style="border-
bottom-width: 1px;"><b>CreateAddress.java</b></div><div class="codeContent
panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">public class CreateAddress {
@PersistenceContext
@@ -252,7 +252,7 @@ div.rbtoc1518405707335 li {margin-left:
...
}</pre>
-</div></div><h1 id="IntegratingwithJPA-ValueEncoders">Value
Encoders</h1><p>The Tapestry-jpa module automatically provides <em>value
encoders</em> to make it easy to work with entities (especially lists of
entities) in your Tapestry pages and components. This is modeled on the similar
functionality from the Tapestry-hibernate-core module. See the <a
href="integrating-with-jpa.html">Integrating with JPA</a> for all the
details.</p><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’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="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><
b>UserDao.java</b></div><div class="codeContent panelContent pdl">
+</div></div><h1 id="IntegratingwithJPA-ValueEncoders">Value
Encoders</h1><p>The Tapestry-jpa module automatically provides <em>value
encoders</em> to make it easy to work with entities (especially lists of
entities) in your Tapestry pages and components. This is modeled on the similar
functionality from the Tapestry-hibernate-core module. See the <a
href="hibernate-user-guide.html">Hibernate User Guide</a> for all the
details.</p><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’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="codeHeader
panelHeader pdl" style="border-bottom-width: 1p
x;"><b>UserDao.java</b></div><div class="codeContent panelContent pdl">
<pre class="brush: java; gutter: false; theme: Default"
style="font-size:12px;">public interface UserDao {
@CommitAfter