You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2006/10/06 00:49:12 UTC

svn commit: r453414 - in /tapestry/tapestry5/tapestry-core/trunk/src: main/java/org/apache/tapestry/corelib/pages/ main/resources/org/apache/tapestry/corelib/pages/ site/resources/ test/app1/ test/java/org/apache/tapestry/integration/app1/pages/ test/r...

Author: hlship
Date: Thu Oct  5 15:49:11 2006
New Revision: 453414

URL: http://svn.apache.org/viewvc?view=rev&rev=453414
Log:
Show the stack trace on ExceptionReport.

Added:
    tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/pages/BadTemplate.java
    tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html
Removed:
    tapestry/tapestry5/tapestry-core/trunk/src/site/resources/tap5devwiki.20061001.2127590452.html
Modified:
    tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java
    tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html
    tapestry/tapestry5/tapestry-core/trunk/src/site/resources/tap5devwiki.html
    tapestry/tapestry5/tapestry-core/trunk/src/site/resources/tap5devwiki.xml
    tapestry/tapestry5/tapestry-core/trunk/src/test/app1/index.html

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java?view=diff&rev=453414&r1=453413&r2=453414
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/java/org/apache/tapestry/corelib/pages/ExceptionReport.java Thu Oct  5 15:49:11 2006
@@ -35,6 +35,10 @@
     private List<ExceptionInfo> _stack;
 
     private ExceptionInfo _info;
+    
+    private String _propertyName;
+    
+    private String _frame;
 
     @Inject("service:tapestry.ioc.ExceptionAnalyzer")
     private ExceptionAnalyzer _analyzer;
@@ -59,5 +63,30 @@
     public void setInfo(ExceptionInfo info)
     {
         _info = info;
+    }
+
+    public String getFrame()
+    {
+        return _frame;
+    }
+
+    public void setFrame(String frame)
+    {
+        _frame = frame;
+    }
+
+    public String getPropertyName()
+    {
+        return _propertyName;
+    }
+
+    public void setPropertyName(String propertyName)
+    {
+        _propertyName = propertyName;
+    }
+    
+    public Object getPropertyValue()
+    {
+        return _info.getProperty(_propertyName);
     }
 }

Modified: tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html?view=diff&rev=453414&r1=453413&r2=453414
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/main/resources/org/apache/tapestry/corelib/pages/ExceptionReport.html Thu Oct  5 15:49:11 2006
@@ -11,11 +11,26 @@
                         <t:comp type="If" test="prop:info.message">
                             <dt>Message:</dt>
                             <dd>${info.message}</dd>
+                        </t:comp>
+                        <t:comp type="Loop" source="prop:info.propertyNames"
+                            value="prop:propertyName">
+                            <dt>${propertyName}:</dt>
+                            <dd>${propertyValue}</dd>
+                        </t:comp>
+                        <t:comp type="If" test="prop:info.stackTrace">
+                            <dt>Stack trace:</dt>
+                            <dd>
+                                <ul>
+                                    <t:comp type="Loop" source="prop:info.stackTrace"
+                                        value="prop:frame">
+                                        <li>${frame}</li>
+                                    </t:comp>
+                                </ul>
+                            </dd>
                         </t:comp>
                     </dl>
                 </li>
-            </t:comp>
-        </ul>
-
+            </t:comp>
+        </ul>
     </body>
 </html>

Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/resources/tap5devwiki.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/resources/tap5devwiki.html?view=diff&rev=453414&r1=453413&r2=453414
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/resources/tap5devwiki.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/resources/tap5devwiki.html Thu Oct  5 15:49:11 2006
@@ -66,7 +66,7 @@
 	chkRegExpSearch: false,
 	chkCaseSensitiveSearch: false,
 	chkAnimate: true,
-	txtUserName: "YourName",
+	txtUserName: "HowardLewisShip",
 	chkSaveBackups: true,
 	chkAutoSave: false,
 	chkGenerateAnRssFeed: false,
@@ -5165,20 +5165,21 @@
 	<div id="saveTest"></div>
 	<div id="contentWrapper"></div>
 	<div id="contentStash"></div>
-	<div id="storeArea"><div tiddler="DynamicPageState" modifier="HowardLewisShip" modified="200609211635" created="200609211610" tags="">Tapestry 4 has left tracking of dynamic page state as an exercise to the developer.  Mostly, this is done using the ''parameters'' parameter of the ~DirectLink component.\n\nDynamic page state is anything that isn't inside a persistent page property. For the most part, this includes page properties updated by a For component\n\nIt seems likely that this information could be automatically encoded into ~URLs.  \n\nI'm envisioning a service that accumulates a series of //commands//. Each command is used to store a bit of page state. The commands are serializable.  The commands are ultimately serialized into a MIME string and attached as a query parameter to each URL.\n\nWhen such a link is triggered, the commands are de-serialized and each executed in turn. Only when that is finished is any further event processing executed, including calling in
 to to user code.\n\nMy outline for this is to store a series of tuples; each tuple is a component id plus the command to execute.\n\n{{{\npublic interface ComponentCommand&lt;T&gt;\n{\n  void execute(T component);\n}\n}}}\n\nThese commands should be immutable.\n\nSo a component, such as a For loop component, could provide itself and a ComponentCommand instance (probably a static inner class) to some kind of PageStateTracker service.\n\n{{{\npublic interface PageStateTracker\n{\n  void &lt;T&gt; addCommand(T component, ComponentCommand&lt;T&gt; command);\n}\n}}}\n\nThe commands are kept in the order that they are added, except that new commands for the same component //replace// previous commands for that component.\n\nAs with the Tapestry 4 For component, some mechanism will be needed to store object ids inside the URLs (that is, inside the commands serialized into URL query parameters) and translate back to //equivalent// objects when the link is triggered.\n\nDynamic page 
 state outside of a Form will overlap with some of the FormProcessing inside the form.</div>
+	<div id="storeArea"><div tiddler="ComponentMixins" modifier="HowardLewisShip" modified="200610051243" created="200610051234" tags="mixins">One of the more exciting ideas in Tapestry 5 is //mixins//; the ability to add behavior to a component without writing code. \n\nIt is expected that much common behavior, especially for form control components, will be provided by mixins. Further, many Ajax techniques will take the form of mixins applied to otherwise ordinary components.\n\nA mixin is an additional component class that operates //with// the main component. For a component element within the page, the functionality is provided by the main component class and by\nthe mixin.  \n\nMixins are primarily about rendering. Mixin render methods are //mixed in// to the components' render methods. In effect, the different rendering phases of a component are different AOP-like //joinpoints//, and the mixins can provide //before advice//.\n\nMixins can be specified for an //instance//
  of a component, or can be specified as part of the //implementation// of a component.\n\nIn the former case, the @Component annotation will be supplemented with a @Mixin annotation. The @Mixin is a list of one or more mixin classes for that component.\n\n''Todo: Template syntax for mixins?''\n\nIn the latter case, the @ComponentClass annotation will be supplemented with a @Mixin annotation.\n\nMixins can be configured.  They can have parameters, just like ordinary components. When a formal parameter name is ambiguous, it will be prefixed with the unqualified class name. Thus, you might have to say, &quot;MyMixin.parameterName=someProperty&quot; if &quot;parameterName&quot; is ambiguous (by ambiguous, we mean, a parameter of more than one mixin or of the component itself).  \n\nThis disambiguation is //simple//. It is assumed that the unqualified class name will be sufficient to uniquely identify a mixin. That is, it is expected that you will not have the same class name eve
 n in different packages (as mixins, on a single component). In a //degenerate case// where this is not so, it will be necessary to disambiguate the mixin name by create a subclass of the mixin with a new name.\n\n''Todo: how are mixins on a component implementation configured?''\n\nMixins may have persistent state, just as with ordinary components.\n\n</div>
+<div tiddler="DynamicPageState" modifier="HowardLewisShip" modified="200609211635" created="200609211610" tags="">Tapestry 4 has left tracking of dynamic page state as an exercise to the developer.  Mostly, this is done using the ''parameters'' parameter of the ~DirectLink component.\n\nDynamic page state is anything that isn't inside a persistent page property. For the most part, this includes page properties updated by a For component\n\nIt seems likely that this information could be automatically encoded into ~URLs.  \n\nI'm envisioning a service that accumulates a series of //commands//. Each command is used to store a bit of page state. The commands are serializable.  The commands are ultimately serialized into a MIME string and attached as a query parameter to each URL.\n\nWhen such a link is triggered, the commands are de-serialized and each executed in turn. Only when that is finished is any further event processing executed, including calling into to user code.\n\nM
 y outline for this is to store a series of tuples; each tuple is a component id plus the command to execute.\n\n{{{\npublic interface ComponentCommand&lt;T&gt;\n{\n  void execute(T component);\n}\n}}}\n\nThese commands should be immutable.\n\nSo a component, such as a For loop component, could provide itself and a ComponentCommand instance (probably a static inner class) to some kind of PageStateTracker service.\n\n{{{\npublic interface PageStateTracker\n{\n  void &lt;T&gt; addCommand(T component, ComponentCommand&lt;T&gt; command);\n}\n}}}\n\nThe commands are kept in the order that they are added, except that new commands for the same component //replace// previous commands for that component.\n\nAs with the Tapestry 4 For component, some mechanism will be needed to store object ids inside the URLs (that is, inside the commands serialized into URL query parameters) and translate back to //equivalent// objects when the link is triggered.\n\nDynamic page state outside of a Fo
 rm will overlap with some of the FormProcessing inside the form.</div>
 <div tiddler="EditTemplate" modifier="HowardLewisShip" modified="200609210649" created="200609210648" tags="">&lt;div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'&gt;&lt;/div&gt;\n&lt;div class='title' macro='view title'&gt;&lt;/div&gt;\n&lt;div class='editor' macro='edit title'&gt;&lt;/div&gt;\n&lt;div class='editor' macro='edit text'&gt;&lt;/div&gt;\n&lt;div class='editor' macro='edit tags'&gt;&lt;/div&gt;&lt;div class='editorFooter'&gt;&lt;span macro='message views.editor.tagPrompt'&gt;&lt;/span&gt;&lt;span macro='tagChooser'&gt;&lt;/span&gt;&lt;/div&gt;</div>
 <div tiddler="EnvironmentalServices" modifier="HowardLewisShip" modified="200609260145" created="200609251547" tags="">Frequently, different components need to //cooperate// during the rendering process.\n\nThis is an established pattern from Tapestry 4, which an enclosing component provides services to the components it encloses. By //encloses// we mean, any components that are rendered as part of the Form's body; give the use of the Block/~RenderBlock components, this can not be determined statically, but is instead determined dynamically, as part of the rendering process.\n\nThe canoncial example of this pattern is Form component, and the complex relationship it has with each form element component it encloses.\n\nIn Tapestry 4, this mechanism was based on the ~IRequestCycle which could store named attributes. The service providing component would store itself into the cycle using a well known name, and service consuming components would retrieve the service using the sam
 e well known name.\n\nFor Tapestry 5, this will be formalized. A new service will be used to manage this information:\n\n{{{\npublic interface Enviroment\n{\n  &lt;T&gt; T push(Class&lt;T&gt; type, T instance);\n\n  &lt;T&gt; peek(Class&lt;T&gt; type);\n\n  &lt;T&gt; T pop(Class&lt;T&gt; type);\n}\n}}}\n\nThe Environment is unique to a request.</div>
 <div tiddler="FormProcessing" modifier="HowardLewisShip" modified="200609211540" created="200609210203" tags="forms">Form processing in Tapestry 4 had certain strengths and limitations.\n\nBasically, any action framework that can do a simple mapping from query parameters to bean property names has advantages in terms of simple forms, and Tapestry 4's approach has huge advantages on more complex forms (with some considerable developer and framework overhead).\n\nWith a direct mapping of query parameter names to bean names, each query parameter becomes self describing. You map query parameters to property of some well known bean. You do simple conversions from strings to other types (typically, ints and dates and the like). You drop query parameters that don't match up. You leave a lot of validation and other plumbing (such as getting those values into your DataTransferObjects) to the developer.\n\nBut you never see a ~StaleLinkException.\n\nYou also have some unwanted loophol
 es in your application in that //any// property can be updated through the URL. This is //one step// towards a security hole.\n\n!Tapestry 4 Approach\n\nEvery form component, as it renders, asks the Form that encloses it to provide a client id.  The terminology is a little messed; client id is the unique (within the form) name for //one rendering// of the component. If the component renders multiple times, because of loops, each rendering gets a unique name.  This becomes the &lt;input&gt;'s name attribute, and ultimately, the query parameter name.\n\nTapestry attempts to make the client id match the (user provided) component id. This is not always possible, especially in a loop, in which case a numeric suffix may be appended to the id to (help) ensure uniqueness.\n\nOn render, a sequence of //component activations// occur, guided by the normal render sequence. The exact sequence of activations guides\nthe production of client ids.\n\nUsing more advanced Tapestry techniques,
  including loops, conditionals and the Block/RenderBlock combo, the exact set of components and\ncomponent activations that will occur for a given rendering of a given form can not be predicted statically. Tapestry must actually render out the form\nto discover all of these.\n\nIn fact, while the Form component is producing this series of client ids, it builds up the list and stores it into the rendered page as a hidden form field. It will need it later, when the client-side form is submitted back to the server.\n\nAn advantage of this approach is the disconnect between the query parameter names (the client ids) and the objects and properties being editted. Often the client ids will be //mneumonic// for the properties, but aren't directly mapped to them. Only the components responsible for each query parameter know how to validate the submitted value, and what property of which object will need to be updated.\n\nWhen a form submission occurs, we want to ensure that each quer
 y parameter value read out of the request is applied to the correct property of the correct object. There's a limit to how much Tapestry can help here (because it has only a casual knowledge of this aspect of the application structure).\n\nDuring this submission process, which endded up with the curious name, //rewind phase//, Tapestry must do two things:\n* Activate each component, such that the component may re-determine its client id, read its parameter, and update its page property\n* Validate that the process has not been comprimised by a change of server side state\n\nThat second element is a tricky one; things can go wonky if a race condition occurs between two users. For example, lets take a simple invoice and line item model. If users A and B both read the same invoice, user A adds a line item, and user B changes a line item ... we can have a problem when user B submits the form. Now that there are three line items (not two) in the form, there will be extra componen
 t activations to process query parameters that don't exist in the request. \n\nThis scenario can occur whenever the processing of the form submission is driven by server-side data that can change between request.\n\nTapestry detects this as a difference in the sequence of client ids allocated, and throws a ~StaleLinkException, which is very frustrating for developers to comprehend and fix.\n\nThere are also other edge cases for different race conditions where data is applied to the wrong server-side objects.\n\nThe Tapestry 3 ~ListEdit component, which evolved into the  Tapestry 4 For component, attempts to address this by serializing a series of //object ids// into the form (as a series of hidden fields). This requires a bit of work on the part of the developer to provide an ~IPrimaryKeyConverter that can help convert objects to ids (when rendering) and ids back to objects (during form submission).\n\nGenerally speaking, the Tapestry 4 approach represents layers of kludge o
 n layers of kludge. It works, it gets the job done, it can handle some very complex situations, but it is less than ideal.\n\n!Tapestry 5\n\nThe goal here is to capture the series of //component activations//, along with any significant page state changes, during the render.\n\nThese activations will be a series of //commands//.  For each component activation there will be two commands:  the first command will be used to inform the component of its client id (this command executes during render and during form submission). The second command will request that the client handle the form submission (this command executes only during form submission).\n\nThe serialized series of commands is stored as a hidden form field.\n\nThere's a lot of API to be figured out, especially the relationship between the form components and the form itself.\n\nFurther, a lot of what the Tapestry 4 For component does, in terms of serializing dynamic page state, will need to fold into this as well.
 \n\nThe end result will be a single hidden field with a big MIME string inside it ... but compared to the Tapestry 4 Form component (which has to write out many hidden fields) the whole will be less than the sum of the parts ... due to the overhead of serialization and gzip compression.\n\n\n\n\n\n\n</div>
 <div tiddler="MainMenu" modifier="HowardLewisShip" modified="200609210701" created="200609210643" tags="">MasterIndex\n[[RSS feed|tap5devwiki.xml]]\n\n[[Tapestry 5 Home|http://tapestry.apache.org/tapestry5/]]\n[[Howard's Blog|http://howardlewisship.com/blog/]]\n\n[[Formatting Help|http://www.blogjones.com/TiddlyWikiTutorial.html#EasyToEdit%20Welcome%20NewFeatures%20WhereToFindHelp]]</div>
-<div tiddler="MasterIndex" modifier="HowardLewisShip" modified="200609251541" created="200609202214" tags="">* PropBinding -- Notes on the workhorse &quot;prop:&quot; binding prefix\n* TypeCoercion -- How Tapestry 5 extensibly addresses type conversion\n* FormProcessing\n* DynamicPageState -- tracking changes to page state during the render\n* EnvironmentalServices -- how components cooperate during page render</div>
+<div tiddler="MasterIndex" modifier="HowardLewisShip" modified="200610051221" created="200609202214" tags="">* PropBinding -- Notes on the workhorse &quot;prop:&quot; binding prefix\n* TypeCoercion -- How Tapestry 5 extensibly addresses type conversion\n* FormProcessing\n* DynamicPageState -- tracking changes to page state during the render\n* EnvironmentalServices -- how components cooperate during page render\n* ComponentMixins -- A new fundamental way to build web functionality</div>
 <div tiddler="OGNL" modifier="HowardLewisShip" modified="200609202255" created="200609202254" tags="">The [[Object Graph Navigation Library|http://ognl.org]] was an essential part of Tapestry 4.\n\nOGNL is both exceptionally powerful (especially the higher order things it can do, such as list selections and projections). However, for the highest\nend sites, it is also a performance problem, both because of its heavy use of reflection, and because it uses a lot of code inside synchronized blocks.\n\nIt will be optional in Tapestry 5. I believe it will not be part of the tapestry-core, but may be packaged as tapestry-ognl.\n\nThe &quot;prop:&quot; binding prefix is a partial replacement for OGNL in Tapestry 5.  \n\nAs of this writing (Sep 20 2006), the built in support is limited to just simple property names.  At some point in the near future, the PropBindingImprovements will be implemented.</div>
-<div tiddler="PropBinding" modifier="YourName" modified="200610012127" created="200609202203" tags="bindings">&quot;prop:&quot; the default in a  lot of cases, i.e., in any Java code.\n\nThis binding prefix  supports several common idioms even though they are not, precisely, the names of properties.  In many cases, this will save developers the bother of using a &quot;literal:&quot; prefix.\n\nThe goal of the &quot;prop:&quot; prefix is to be highly efficient and useful in 90%+ of the cases. [[OGNL]], or synthetic properties in the component class, will pick up the remaining cases.\n\n!Numeric literals\n\nSimple numeric literals should be parsed into read-only, invariant bindings.\n{{{\nprop:5\n\nprop:-22.7\n}}}\n\n\nThe resulting objects will be of type Long or type Double. TypeCoercion will ensure that component parameters get values (say, int or float) of the correct type.\n\n!Boolean literals\n\n&quot;true&quot; and &quot;false&quot; should also be converted to invariant
  bindings.\n{{{\nprop:true\n\nprop:false\n}}}\n\n!String literals\n\n//Simple// string literals, enclosed in single quotes.  Example:\n{{{\nprop:'Hello World'\n}}}\n\n//Remember that the binding expression will always be enclosed in double quotes.//\n\n!This literal\n\nIn some cases, it is useful to be able to identify the current component:\n{{{\nprop:this\n}}}\n\nEven though a component is not immutable, the value of //this// does not ever change,\nand this binding is also invariant.\n\n!Null literal\n\n{{{\nprop:null\n}}}\n\nThis value is always exactly null. This can be used to set a parameter who'se default value is non-null to the explicit value null.\n\n!Property paths\n\nMulti-step property paths are extremely important.\n\n{{{\nprop:poll.title\n\nprop:identity.user.name\n}}}\n\nThe initial terms need to be readable, they are never updated. Only the final property name must be read/write, and in fact, it is valid to be read-only or write-only.\n\nThe prop: binding fa
 ctory builds a Java expression to read and update properties. It does not use reflection at runtime. Therefore, the properties of the //declared// type are used. By contrast, [[OGNL]] uses the //actual// type, which is reflection-intensive. Also, unlike OGNL, errors (such as missing properties in the property path) are identified when the page is loaded, rather than when the expression is evaluated.\n'\n</div>
+<div tiddler="PropBinding" modifier="HowardLewisShip" modified="200610051235" created="200609202203" tags="bindings">&quot;prop:&quot; the default in a  lot of cases, i.e., in any Java code.\n\nThis binding prefix  supports several common idioms even though they are not, precisely, the names of properties.  In many cases, this will save developers the bother of using a &quot;literal:&quot; prefix.\n\nThe goal of the &quot;prop:&quot; prefix is to be highly efficient and useful in 90%+ of the cases. [[OGNL]], or synthetic properties in the component class, will pick up the remaining cases.\n\n!Numeric literals\n\nSimple numeric literals should be parsed into read-only, invariant bindings.\n{{{\nprop:5\n\nprop:-22.7\n}}}\n\n\nThe resulting objects will be of type Long or type Double. TypeCoercion will ensure that component parameters get values (say, int or float) of the correct type.\n\n!Boolean literals\n\n&quot;true&quot; and &quot;false&quot; should also be converted to in
 variant bindings.\n{{{\nprop:true\n\nprop:false\n}}}\n\n!String literals\n\n//Simple// string literals, enclosed in single quotes.  Example:\n{{{\nprop:'Hello World'\n}}}\n\n//Remember that the binding expression will always be enclosed in double quotes.//\n\n!This literal\n\nIn some cases, it is useful to be able to identify the current component:\n{{{\nprop:this\n}}}\n\nEven though a component is not immutable, the value of //this// does not ever change,\nand this binding is also invariant.\n\n!Null literal\n\n{{{\nprop:null\n}}}\n\nThis value is always exactly null. This can be used to set a parameter who'se default value is non-null to the explicit value null.\n\n!Property paths\n\nMulti-step property paths are extremely important.\n\n{{{\nprop:poll.title\n\nprop:identity.user.name\n}}}\n\nThe initial terms need to be readable, they are never updated. Only the final property name must be read/write, and in fact, it is valid to be read-only or write-only.\n\nThe prop: bin
 ding factory builds a Java expression to read and update properties. It does not use reflection at runtime. Therefore, the properties of the //declared// type are used. By contrast, [[OGNL]] uses the //actual// type, which is reflection-intensive. Also, unlike OGNL, errors (such as missing properties in the property path) are identified when the page is loaded, rather than when the expression is evaluated.\n'\n</div>
 <div tiddler="SideBarTabs" modifier="HowardLewisShip" modified="200609210652" created="200609210651" tags="">&lt;&lt;tabs txtMainTab Timeline Timeline TabTimeline All 'All tiddlers' TabAll Tags 'All tags' TabTags More 'More lists' TabMore&gt;&gt;\n</div>
 <div tiddler="SiteSubtitle" modifier="HowardLewisShip" modified="200609202249" created="200609202155" tags="">\nThe quick and dirty one-stop shopping of random ideas for Tapestry 5.</div>
 <div tiddler="SiteTitle" modifier="HowardLewisShip" modified="200609202249" created="200609202155" tags="">Tapestry 5 Brain Dump</div>
 <div tiddler="SiteUrl" modifier="HowardLewisShip" modified="200609210703" created="200609210641" tags="">http://tapestry.apache.org/tapestry5/tap5devwiki.html</div>
 <div tiddler="TabAll" modifier="HowardLewisShip" modified="200609210650" created="200609210650" tags="">&lt;&lt;list all&gt;&gt;</div>
-<div tiddler="TypeCoercion" modifier="HowardLewisShip" modified="200609232252" created="200609202217" tags="parameters types">Automatic coercion of types is essential.  This primarily applies to component parameters.\n\nParameters are tied to the [[Binding|http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/Binding.html]] interface.\n\nTapestry component parameters look like simple instance variables, but Tapestry's RuntimeTransformation of component classes means that reading the value of a parameter instance variable //may// invoke Binding.get(), and changing the value of a parameter instance variable will invoke Binding.set().\n\n!Reading From Parameters\n\nReading a parameter value involves two steps:\n* Invoking Binding.get()\n* Converting the result to the type of the parameter (where different)\n\nWhen reading parameters, the binding will provide an object of the type of the bound property.  Various kinds of invariant bindings will returned a fixed type, 
 typically a String.\n\nThe parameter will be assigned to a variable that has a known type, possibly a primtive type (int, boolean) or an object type (Map, Date).\n\n!Writing To Parameters\n\nWriting to, or updating, a parameter is in two steps:\n* Converting the new value into a type appropriate for the binding\n* Invoking Binding.set()\n\nWe will be adding a getPropertyType() method to the Binding interface, that will identify the property type of the property bound to the parameter.\n\nThe component will be responsible for performing a coercion from the value provided to the proper type, before invoking Binding.set().\n\n!Coercion Tuples\n\nAt the core of this will be a service that performs type coercions.\n\nCoercions are based on //coercion tuples// that define:\n* A source type\n* A target type\n* An object to perform the coercion from source to target\n* A &quot;cost&quot; for the conversion (possibly, but usually with a standard default value) ''(not yet implemented)
 ''\n\nAs a special case, the type of null will be treated as type void (i.e., void.class).  Thus we can use the same mechanism to identify how to convert from null to other types, such as Boolean or Integer.\n\nThere should be a large number of these tuples available.  The most common tuples may be conversions between various types and String.\n\n!Coercion Algorithm\n* Determine the source type (treating null as void.class)\n* Determine the target type (converting primitive types to equivalent wrapper types)\n* If the source type is assignable to the target type, then the input value is valid and the process is complete\n* Find a converter that converts between the source type and the target type, pass the source value through the converter to get a target value\n\nThat last part needs a bit of expansion.\n\nFirst off, there will often ''not'' be a tuple for coercing directly form the source type to the target type.\n\nIn that scenario, the conversion will involve a search  
 to find a sequence of tuples that will perform the coercion.  This will take the form a breadth-first search where we look for tuples that coerce from the source type to an intermediate type, then search for tuples from the intermediate type to the target type.  This may involve more than two coercions.\n\nYou can think of the set of tuples as a kind of directed graph.  Each type is a node on the graph, and each tuple represents a connection between one type and another type (say, from String to Double).  What we're trying to do is find a path form a source type (or some super-class or super-interface of the source type) to some target type (or sub-class or sub-interface of the target type).\n\nMay need to express a &quot;cost&quot; of the coercion from start type to target type; this might be useful if there are multiple paths for the conversion. Cost may factor in both the computing expense, and any loss of detail.  Basic cost is established in terms of the number of steps
  and enforced by the order in which tuples are considered and combined.\n\nFor example, a coercion tuple from Number to Float may be represented as the tuple:\n(Number, Float, {{{ return new Float(input.floatValue()); }}})\n\n{{{\npublic interface Coercion&lt;S,T&gt;\n{\n  T coerce(S input);\n}\n}}}\n\nIf the input type is an Integer, then a search for Integer-&gt;Float will find no entries. At that point, it will be necessary to &quot;climb&quot; the inheritance tree and look for coercions from Number (the super class of Integer); this will find the Number-&gt;Float tuple.\n\nAgain, in terms of cost, we might also find a pair of tuples:  Object-&gt;String and String-&gt;Float.  This will have a higher cost than the Number-&gt;Float tuple and should be rejected in favor of the lower cost coercion.\n\n//Note: cost hasn't been implemented, and likely won't be, unless and until the algorithm as it stands is shown to provide less than optimal results.//\n\nThe algorithm caches t
 he result of this search, with proper guards for concurrent access. The cache is cleared when an invalidation of the component class loader occurs.\n\n!Configuring the service\n\nThis has been implemented as service tapestry.TypeCoercer.\n\nThe configuration of this service is an unordered collection of CoercionTuple.</div>
+<div tiddler="TypeCoercion" modifier="HowardLewisShip" modified="200610051240" created="200609202217" tags="parameters types">Automatic coercion of types is essential.  This primarily applies to component parameters.\n\nParameters are tied to the [[Binding|http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/Binding.html]] interface.\n\nTapestry component parameters look like simple instance variables, but Tapestry's RuntimeTransformation of component classes means that reading the value of a parameter instance variable //may// invoke Binding.get(), and changing the value of a parameter instance variable will invoke Binding.set().\n\n!Reading From Parameters\n\nReading a parameter value involves two steps:\n* Invoking Binding.get()\n* Converting the result to the type of the parameter (where different)\n\nWhen reading parameters, the binding will provide an object of the type of the bound property.  Various kinds of invariant bindings will returned a fixed type, 
 typically a String.\n\nThe parameter will be assigned to a variable that has a known type, possibly a primtive type (int, boolean) or an object type (Map, Date).\n\n!Writing To Parameters\n\nWriting to, or updating, a parameter is in two steps:\n* Converting the new value into a type appropriate for the binding\n* Invoking Binding.set()\n\nWe will be adding a getPropertyType() method to the Binding interface, that will identify the property type of the property bound to the parameter.\n\nThe component will be responsible for performing a coercion from the value provided to the proper type, before invoking Binding.set().\n\n!Coercion Tuples\n\nAt the core of this will be a service that performs type coercions.\n\nCoercions are based on //coercion tuples// that define:\n* A source type\n* A target type\n* An object to perform the coercion from source to target\n* A &quot;cost&quot; for the conversion (possibly, but usually with a standard default value) ''(not yet implemented)
 ''\n\nAs a special case, the type of null will be treated as type void (i.e., void.class).  Thus we can use the same mechanism to identify how to convert from null to other types, such as Boolean or Integer.\n\nThere should be a large number of these tuples available.  The most common tuples may be conversions between various types and String.\n\n!Coercion Algorithm\n* Determine the source type (treating null as void.class)\n* Determine the target type (converting primitive types to equivalent wrapper types)\n* If the source type is assignable to the target type, then the input value is valid and the process is complete\n* Find a converter that converts between the source type and the target type, pass the source value through the converter to get a target value\n\nThat last part needs a bit of expansion.\n\nFirst off, there will often ''not'' be a tuple for coercing directly form the source type to the target type.\n\nIn that scenario, the conversion will involve a search  
 to find a sequence of tuples that will perform the coercion.  This will take the form a breadth-first search where we look for tuples that coerce from the source type to an intermediate type, then search for tuples from the intermediate type to the target type.  This may involve more than two coercions.\n\nYou can think of the set of tuples as a kind of directed graph.  Each type is a node on the graph, and each tuple represents a connection between one type and another type (say, from String to Double).  What we're trying to do is find a path form a source type (or some super-class or super-interface of the source type) to some target type (or sub-class or sub-interface of the target type).\n\nMay need to express a &quot;cost&quot; of the coercion from start type to target type; this might be useful if there are multiple paths for the conversion. Cost may factor in both the computing expense, and any loss of detail.  Basic cost is established in terms of the number of steps
  and enforced by the order in which tuples are considered and combined.\n\nFor example, a coercion tuple from Number to Float may be represented as the tuple:\n(Number, Float, {{{ return new Float(input.floatValue()); }}})\n\n{{{\npublic interface Coercion&lt;S,T&gt;\n{\n  T coerce(S input);\n}\n}}}\n\nIf the input type is an Integer, then a search for Integer-&gt;Float will find no entries. At that point, it will be necessary to &quot;climb&quot; the inheritance tree and look for coercions from Number (the super class of Integer); this will find the Number-&gt;Float tuple.\n\nAgain, in terms of cost, we might also find a pair of tuples:  Object-&gt;String and String-&gt;Float.  This will have a higher cost than the Number-&gt;Float tuple and should be rejected in favor of the lower cost coercion.\n\n//Note: cost hasn't been implemented, and likely won't be, unless and until the algorithm as it stands is shown to provide less than optimal results.//\n\nThe algorithm caches t
 he result of this search, with proper guards for concurrent access. The cache is cleared when an invalidation of the component class loader occurs.\n\n!Configuring the service\n\nThis has been implemented as service tapestry.TypeCoercer.\n\nThe configuration of this service is an unordered collection of CoercionTuple.</div>
 		</div>
 <!--POST-BODY-START-->
 

Modified: tapestry/tapestry5/tapestry-core/trunk/src/site/resources/tap5devwiki.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/site/resources/tap5devwiki.xml?view=diff&rev=453414&r1=453413&r2=453414
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/site/resources/tap5devwiki.xml (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/site/resources/tap5devwiki.xml Thu Oct  5 15:49:11 2006
@@ -6,36 +6,43 @@
 <description>The quick and dirty one-stop shopping of random ideas for Tapestry 5.</description>
 <language>en-us</language>
 <copyright>Copyright 2006 HowardLewisShip</copyright>
-<pubDate>Tue, 26 Sep 2006 01:45:14 GMT</pubDate>
-<lastBuildDate>Tue, 26 Sep 2006 01:45:14 GMT</lastBuildDate>
+<pubDate>Thu, 05 Oct 2006 12:43:18 GMT</pubDate>
+<lastBuildDate>Thu, 05 Oct 2006 12:43:18 GMT</lastBuildDate>
 <docs>http://blogs.law.harvard.edu/tech/rss</docs>
 <generator>TiddlyWiki 2.0.11</generator>
 <item>
-<title>EnvironmentalServices</title>
-<description>Frequently, different components need to //cooperate// during the rendering process.&lt;br /&gt;&lt;br /&gt;This is an established pattern from Tapestry 4, which an enclosing component provides services to the components it encloses. By //encloses// we mean, any components that are rendered as part of the Form's body; give the use of the Block/~RenderBlock components, this can not be determined statically, but is instead determined dynamically, as part of the rendering process.&lt;br /&gt;&lt;br /&gt;The canoncial example of this pattern is Form component, and the complex relationship it has with each form element component it encloses.&lt;br /&gt;&lt;br /&gt;In Tapestry 4, this mechanism was based on the ~IRequestCycle which could store named attributes. The service providing component would store itself into the cycle using a well known name, and service consuming components would retrieve the service using the same well known name.&lt;br /&gt;&lt;br /&gt;For 
 Tapestry 5, this will be formalized. A new service will be used to manage this information:&lt;br /&gt;&lt;br /&gt;{{{&lt;br /&gt;public interface Enviroment&lt;br /&gt;{&lt;br /&gt;  &lt;T&gt; T push(Class&lt;T&gt; type, T instance);&lt;br /&gt;&lt;br /&gt;  &lt;T&gt; peek(Class&lt;T&gt; type);&lt;br /&gt;&lt;br /&gt;  &lt;T&gt; T pop(Class&lt;T&gt; type);&lt;br /&gt;}&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;The Environment is unique to a request.</description>
-<link>http://tapestry.apache.org/tapestry5/tap5devwiki.html#EnvironmentalServices</link>
-<pubDate>Tue, 26 Sep 2006 01:45:14 GMT</pubDate>
+<title>ComponentMixins</title>
+<description>One of the more exciting ideas in Tapestry 5 is //mixins//; the ability to add behavior to a component without writing code. &lt;br /&gt;&lt;br /&gt;It is expected that much common behavior, especially for form control components, will be provided by mixins. Further, many Ajax techniques will take the form of mixins applied to otherwise ordinary components.&lt;br /&gt;&lt;br /&gt;A mixin is an additional component class that operates //with// the main component. For a component element within the page, the functionality is provided by the main component class and by&lt;br /&gt;the mixin.  &lt;br /&gt;&lt;br /&gt;Mixins are primarily about rendering. Mixin render methods are //mixed in// to the components' render methods. In effect, the different rendering phases of a component are different AOP-like //joinpoints//, and the mixins can provide //before advice//.&lt;br /&gt;&lt;br /&gt;Mixins can be specified for an //instance// of a component, or can be specified 
 as part of the //implementation// of a component.&lt;br /&gt;&lt;br /&gt;In the former case, the @Component annotation will be supplemented with a @Mixin annotation. The @Mixin is a list of one or more mixin classes for that component.&lt;br /&gt;&lt;br /&gt;''Todo: Template syntax for mixins?''&lt;br /&gt;&lt;br /&gt;In the latter case, the @ComponentClass annotation will be supplemented with a @Mixin annotation.&lt;br /&gt;&lt;br /&gt;Mixins can be configured.  They can have parameters, just like ordinary components. When a formal parameter name is ambiguous, it will be prefixed with the unqualified class name. Thus, you might have to say, &quot;MyMixin.parameterName=someProperty&quot; if &quot;parameterName&quot; is ambiguous (by ambiguous, we mean, a parameter of more than one mixin or of the component itself).  &lt;br /&gt;&lt;br /&gt;This disambiguation is //simple//. It is assumed that the unqualified class name will be sufficient to uniquely identify a mixin. That is
 , it is expected that you will not have the same class name even in different packages (as mixins, on a single component). In a //degenerate case// where this is not so, it will be necessary to disambiguate the mixin name by create a subclass of the mixin with a new name.&lt;br /&gt;&lt;br /&gt;''Todo: how are mixins on a component implementation configured?''&lt;br /&gt;&lt;br /&gt;Mixins may have persistent state, just as with ordinary components.&lt;br /&gt;&lt;br /&gt;</description>
+<category>mixins</category>
+<link>http://tapestry.apache.org/tapestry5/tap5devwiki.html#ComponentMixins</link>
+<pubDate>Thu, 05 Oct 2006 12:43:18 GMT</pubDate>
 </item>
 <item>
-<title>MasterIndex</title>
-<description>* PropBinding -- Notes on the workhorse &quot;prop:&quot; binding prefix&lt;br /&gt;* TypeCoercion -- How Tapestry 5 extensibly addresses type conversion&lt;br /&gt;* FormProcessing&lt;br /&gt;* DynamicPageState -- tracking changes to page state during the render&lt;br /&gt;* EnvironmentalServices -- how components cooperate during page render</description>
-<link>http://tapestry.apache.org/tapestry5/tap5devwiki.html#MasterIndex</link>
-<pubDate>Mon, 25 Sep 2006 15:41:00 GMT</pubDate>
+<title>TypeCoercion</title>
+<description>Automatic coercion of types is essential.  This primarily applies to component parameters.&lt;br /&gt;&lt;br /&gt;Parameters are tied to the [[Binding|http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/Binding.html]] interface.&lt;br /&gt;&lt;br /&gt;Tapestry component parameters look like simple instance variables, but Tapestry's RuntimeTransformation of component classes means that reading the value of a parameter instance variable //may// invoke Binding.get(), and changing the value of a parameter instance variable will invoke Binding.set().&lt;br /&gt;&lt;br /&gt;!Reading From Parameters&lt;br /&gt;&lt;br /&gt;Reading a parameter value involves two steps:&lt;br /&gt;* Invoking Binding.get()&lt;br /&gt;* Converting the result to the type of the parameter (where different)&lt;br /&gt;&lt;br /&gt;When reading parameters, the binding will provide an object of the type of the bound property.  Various kinds of invariant bindings will returned a fixed
  type, typically a String.&lt;br /&gt;&lt;br /&gt;The parameter will be assigned to a variable that has a known type, possibly a primtive type (int, boolean) or an object type (Map, Date).&lt;br /&gt;&lt;br /&gt;!Writing To Parameters&lt;br /&gt;&lt;br /&gt;Writing to, or updating, a parameter is in two steps:&lt;br /&gt;* Converting the new value into a type appropriate for the binding&lt;br /&gt;* Invoking Binding.set()&lt;br /&gt;&lt;br /&gt;We will be adding a getPropertyType() method to the Binding interface, that will identify the property type of the property bound to the parameter.&lt;br /&gt;&lt;br /&gt;The component will be responsible for performing a coercion from the value provided to the proper type, before invoking Binding.set().&lt;br /&gt;&lt;br /&gt;!Coercion Tuples&lt;br /&gt;&lt;br /&gt;At the core of this will be a service that performs type coercions.&lt;br /&gt;&lt;br /&gt;Coercions are based on //coercion tuples// that define:&lt;br /&gt;* A source ty
 pe&lt;br /&gt;* A target type&lt;br /&gt;* An object to perform the coercion from source to target&lt;br /&gt;* A &quot;cost&quot; for the conversion (possibly, but usually with a standard default value) ''(not yet implemented)''&lt;br /&gt;&lt;br /&gt;As a special case, the type of null will be treated as type void (i.e., void.class).  Thus we can use the same mechanism to identify how to convert from null to other types, such as Boolean or Integer.&lt;br /&gt;&lt;br /&gt;There should be a large number of these tuples available.  The most common tuples may be conversions between various types and String.&lt;br /&gt;&lt;br /&gt;!Coercion Algorithm&lt;br /&gt;* Determine the source type (treating null as void.class)&lt;br /&gt;* Determine the target type (converting primitive types to equivalent wrapper types)&lt;br /&gt;* If the source type is assignable to the target type, then the input value is valid and the process is complete&lt;br /&gt;* Find a converter that converts 
 between the source type and the target type, pass the source value through the converter to get a target value&lt;br /&gt;&lt;br /&gt;That last part needs a bit of expansion.&lt;br /&gt;&lt;br /&gt;First off, there will often ''not'' be a tuple for coercing directly form the source type to the target type.&lt;br /&gt;&lt;br /&gt;In that scenario, the conversion will involve a search  to find a sequence of tuples that will perform the coercion.  This will take the form a breadth-first search where we look for tuples that coerce from the source type to an intermediate type, then search for tuples from the intermediate type to the target type.  This may involve more than two coercions.&lt;br /&gt;&lt;br /&gt;You can think of the set of tuples as a kind of directed graph.  Each type is a node on the graph, and each tuple represents a connection between one type and another type (say, from String to Double).  What we're trying to do is find a path form a source type (or some supe
 r-class or super-interface of the source type) to some target type (or sub-class or sub-interface of the target type).&lt;br /&gt;&lt;br /&gt;May need to express a &quot;cost&quot; of the coercion from start type to target type; this might be useful if there are multiple paths for the conversion. Cost may factor in both the computing expense, and any loss of detail.  Basic cost is established in terms of the number of steps and enforced by the order in which tuples are considered and combined.&lt;br /&gt;&lt;br /&gt;For example, a coercion tuple from Number to Float may be represented as the tuple:&lt;br /&gt;(Number, Float, {{{ return new Float(input.floatValue()); }}})&lt;br /&gt;&lt;br /&gt;{{{&lt;br /&gt;public interface Coercion&lt;S,T&gt;&lt;br /&gt;{&lt;br /&gt;  T coerce(S input);&lt;br /&gt;}&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;If the input type is an Integer, then a search for Integer-&gt;Float will find no entries. At that point, it will be necessary to &quot;cl
 imb&quot; the inheritance tree and look for coercions from Number (the super class of Integer); this will find the Number-&gt;Float tuple.&lt;br /&gt;&lt;br /&gt;Again, in terms of cost, we might also find a pair of tuples:  Object-&gt;String and String-&gt;Float.  This will have a higher cost than the Number-&gt;Float tuple and should be rejected in favor of the lower cost coercion.&lt;br /&gt;&lt;br /&gt;//Note: cost hasn't been implemented, and likely won't be, unless and until the algorithm as it stands is shown to provide less than optimal results.//&lt;br /&gt;&lt;br /&gt;The algorithm caches the result of this search, with proper guards for concurrent access. The cache is cleared when an invalidation of the component class loader occurs.&lt;br /&gt;&lt;br /&gt;!Configuring the service&lt;br /&gt;&lt;br /&gt;This has been implemented as service tapestry.TypeCoercer.&lt;br /&gt;&lt;br /&gt;The configuration of this service is an unordered collection of CoercionTuple.</d
 escription>
+<category>parameters</category>
+<category>types</category>
+<link>http://tapestry.apache.org/tapestry5/tap5devwiki.html#TypeCoercion</link>
+<pubDate>Thu, 05 Oct 2006 12:40:29 GMT</pubDate>
 </item>
 <item>
 <title>PropBinding</title>
-<description>&quot;prop:&quot; the default in a  lot of cases, i.e., in any Java code.&lt;br /&gt;&lt;br /&gt;This binding prefix  supports several common idioms even though they are not, precisely, the names of properties.  In many cases, this will save developers the bother of using a &quot;literal:&quot; prefix.&lt;br /&gt;&lt;br /&gt;The goal of the &quot;prop:&quot; prefix is to be highly efficient and useful in 90%+ of the cases. [[OGNL]], or synthetic properties in the component class, will pick up the remaining cases.&lt;br /&gt;&lt;br /&gt;!Numeric literals&lt;br /&gt;&lt;br /&gt;Simple numeric literals should be parsed into read-only, invariant bindings.&lt;br /&gt;{{{&lt;br /&gt;prop:5&lt;br /&gt;&lt;br /&gt;prop:-22.7&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The resulting objects will be of type Long or type Double. TypeCoercion will ensure that component parameters get values (say, int or float) of the correct type.&lt;br /&gt;&lt;br /&gt;!Boolean liter
 als&lt;br /&gt;&lt;br /&gt;&quot;true&quot; and &quot;false&quot; should also be converted to invariant bindings.&lt;br /&gt;{{{&lt;br /&gt;prop:true&lt;br /&gt;&lt;br /&gt;prop:false&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;!String literals&lt;br /&gt;&lt;br /&gt;//Simple// string literals, enclosed in single quotes.  Example:&lt;br /&gt;{{{&lt;br /&gt;prop:'Hello World'&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;//Remember that the binding expression will always be enclosed in double quotes.//&lt;br /&gt;&lt;br /&gt;!This literal&lt;br /&gt;&lt;br /&gt;In some cases, it is useful to be able to identify the current component:&lt;br /&gt;{{{&lt;br /&gt;prop:this&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;Even though a component is not immutable, the value of //this// does not ever change,&lt;br /&gt;and this binding is also invariant.&lt;br /&gt;&lt;br /&gt;!Null literal&lt;br /&gt;&lt;br /&gt;{{{&lt;br /&gt;prop:null&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;This value is always exactly nul
 l. This can be used to set a parameter who'se default value is non-null to the explicit value null.&lt;br /&gt;&lt;br /&gt;!Property paths&lt;br /&gt;&lt;br /&gt;Multi-step property paths are extremely important.&lt;br /&gt;&lt;br /&gt;{{{&lt;br /&gt;prop:poll.title&lt;br /&gt;&lt;br /&gt;prop:identity.user.name&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;The initial terms need to be readable, they are never updated. Only the final property name must be read/write, and in fact, it is valid to be read-only or write-only.&lt;br /&gt;&lt;br /&gt;The prop: binding factory builds a Java expression to read and update properties. It does not use reflection at runtime. Therefore, the properties of the //declared// type are used. By contrast, [[OGNL]] uses the //actual// type, which is reflection-intensive.&lt;br /&gt;&lt;br /&gt;''Currently, only simple properties, not property paths, are implemented.''&lt;br /&gt;</description>
+<description>&quot;prop:&quot; the default in a  lot of cases, i.e., in any Java code.&lt;br /&gt;&lt;br /&gt;This binding prefix  supports several common idioms even though they are not, precisely, the names of properties.  In many cases, this will save developers the bother of using a &quot;literal:&quot; prefix.&lt;br /&gt;&lt;br /&gt;The goal of the &quot;prop:&quot; prefix is to be highly efficient and useful in 90%+ of the cases. [[OGNL]], or synthetic properties in the component class, will pick up the remaining cases.&lt;br /&gt;&lt;br /&gt;!Numeric literals&lt;br /&gt;&lt;br /&gt;Simple numeric literals should be parsed into read-only, invariant bindings.&lt;br /&gt;{{{&lt;br /&gt;prop:5&lt;br /&gt;&lt;br /&gt;prop:-22.7&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The resulting objects will be of type Long or type Double. TypeCoercion will ensure that component parameters get values (say, int or float) of the correct type.&lt;br /&gt;&lt;br /&gt;!Boolean liter
 als&lt;br /&gt;&lt;br /&gt;&quot;true&quot; and &quot;false&quot; should also be converted to invariant bindings.&lt;br /&gt;{{{&lt;br /&gt;prop:true&lt;br /&gt;&lt;br /&gt;prop:false&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;!String literals&lt;br /&gt;&lt;br /&gt;//Simple// string literals, enclosed in single quotes.  Example:&lt;br /&gt;{{{&lt;br /&gt;prop:'Hello World'&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;//Remember that the binding expression will always be enclosed in double quotes.//&lt;br /&gt;&lt;br /&gt;!This literal&lt;br /&gt;&lt;br /&gt;In some cases, it is useful to be able to identify the current component:&lt;br /&gt;{{{&lt;br /&gt;prop:this&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;Even though a component is not immutable, the value of //this// does not ever change,&lt;br /&gt;and this binding is also invariant.&lt;br /&gt;&lt;br /&gt;!Null literal&lt;br /&gt;&lt;br /&gt;{{{&lt;br /&gt;prop:null&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;This value is always exactly nul
 l. This can be used to set a parameter who'se default value is non-null to the explicit value null.&lt;br /&gt;&lt;br /&gt;!Property paths&lt;br /&gt;&lt;br /&gt;Multi-step property paths are extremely important.&lt;br /&gt;&lt;br /&gt;{{{&lt;br /&gt;prop:poll.title&lt;br /&gt;&lt;br /&gt;prop:identity.user.name&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;The initial terms need to be readable, they are never updated. Only the final property name must be read/write, and in fact, it is valid to be read-only or write-only.&lt;br /&gt;&lt;br /&gt;The prop: binding factory builds a Java expression to read and update properties. It does not use reflection at runtime. Therefore, the properties of the //declared// type are used. By contrast, [[OGNL]] uses the //actual// type, which is reflection-intensive. Also, unlike OGNL, errors (such as missing properties in the property path) are identified when the page is loaded, rather than when the expression is evaluated.&lt;br /&gt;'&lt;br /&gt
 ;</description>
 <category>bindings</category>
 <link>http://tapestry.apache.org/tapestry5/tap5devwiki.html#PropBinding</link>
-<pubDate>Sat, 23 Sep 2006 22:52:00 GMT</pubDate>
+<pubDate>Thu, 05 Oct 2006 12:35:34 GMT</pubDate>
 </item>
 <item>
-<title>TypeCoercion</title>
-<description>Automatic coercion of types is essential.  This primarily applies to component parameters.&lt;br /&gt;&lt;br /&gt;Parameters are tied to the [[Binding|http://tapestry.apache.org/tapestry5/apidocs/org/apache/tapestry/Binding.html]] interface.&lt;br /&gt;&lt;br /&gt;Tapestry component parameters look like simple instance variables, but Tapestry's RuntimeTransformation of component classes means that reading the value of a parameter instance variable //may// invoke Binding.get(), and changing the value of a parameter instance variable will invoke Binding.set().&lt;br /&gt;&lt;br /&gt;!Reading From Parameters&lt;br /&gt;&lt;br /&gt;Reading a parameter value involves two steps:&lt;br /&gt;* Invoking Binding.get()&lt;br /&gt;* Converting the result to the type of the parameter (where different)&lt;br /&gt;&lt;br /&gt;When reading parameters, the binding will provide an object of the type of the bound property.  Various kinds of invariant bindings will returned a fixed
  type, typically a String.&lt;br /&gt;&lt;br /&gt;The parameter will be assigned to a variable that has a known type, possibly a primtive type (int, boolean) or an object type (Map, Date).&lt;br /&gt;&lt;br /&gt;!Writing To Parameters&lt;br /&gt;&lt;br /&gt;Writing to, or updating, a parameter is in two steps:&lt;br /&gt;* Converting the new value into a type appropriate for the binding&lt;br /&gt;* Invoking Binding.set()&lt;br /&gt;&lt;br /&gt;We will be adding a getPropertyType() method to the Binding interface, that will identify the property type of the property bound to the parameter.&lt;br /&gt;&lt;br /&gt;The component will be responsible for performing a coercion from the value provided to the proper type, before invoking Binding.set().&lt;br /&gt;&lt;br /&gt;!Coercion Tuples&lt;br /&gt;&lt;br /&gt;At the core of this will be a service that performs type coercions.&lt;br /&gt;&lt;br /&gt;Coercions are based on //coercion tuples// that define:&lt;br /&gt;* A source ty
 pe&lt;br /&gt;* A target type&lt;br /&gt;* An object to perform the coercion from source to target&lt;br /&gt;* A &quot;cost&quot; for the conversion (possibly, but usually with a standard default value) ''(not yet implemented)''&lt;br /&gt;&lt;br /&gt;As a special case, the type of null will be treated as type void (i.e., void.class).  Thus we can use the same mechanism to identify how to convert from null to other types, such as Boolean or Integer.&lt;br /&gt;&lt;br /&gt;There should be a large number of these tuples available.  The most common tuples may be conversions between various types and String.&lt;br /&gt;&lt;br /&gt;!Coercion Algorithm&lt;br /&gt;* Determine the source type (treating null as void.class)&lt;br /&gt;* Determine the target type (converting primitive types to equivalent wrapper types)&lt;br /&gt;* If the source type is assignable to the target type, then the input value is valid and the process is complete&lt;br /&gt;* Find a converter that converts 
 between the source type and the target type, pass the source value through the converter to get a target value&lt;br /&gt;&lt;br /&gt;That last part needs a bit of expansion.&lt;br /&gt;&lt;br /&gt;First off, there will often ''not'' be a tuple for coercing directly form the source type to the target type.&lt;br /&gt;&lt;br /&gt;In that scenario, the conversion will involve a search  to find a sequence of tuples that will perform the coercion.  This will take the form a breadth-first search where we look for tuples that coerce from the source type to an intermediate type, then search for tuples from the intermediate type to the target type.  This may involve more than two coercions.&lt;br /&gt;&lt;br /&gt;You can think of the set of tuples as a kind of directed graph.  Each type is a node on the graph, and each tuple represents a connection between one type and another type (say, from String to Double).  What we're trying to do is find a path form a source type (or some supe
 r-class or super-interface of the source type) to some target type (or sub-class or sub-interface of the target type).&lt;br /&gt;&lt;br /&gt;May need to express a &quot;cost&quot; of the coercion from start type to target type; this might be useful if there are multiple paths for the conversion. Cost may factor in both the computing expense, and any loss of detail.  Basic cost is established in terms of the number of steps and enforced by the order in which tuples are considered and combined.&lt;br /&gt;&lt;br /&gt;For example, a coercion tuple from Number to Float may be represented as the tuple:&lt;br /&gt;(Number, Float, {{{ return new Float(input.floatValue()); }}})&lt;br /&gt;&lt;br /&gt;{{{&lt;br /&gt;public interface Coercion&lt;S,T&gt;&lt;br /&gt;{&lt;br /&gt;  T coerce(S input);&lt;br /&gt;}&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;If the input type is an Integer, then a search for Integer-&gt;Float will find no entries. At that point, it will be necessary to &quot;cl
 imb&quot; the inheritance tree and look for coercions from Number (the super class of Integer); this will find the Number-&gt;Float tuple.&lt;br /&gt;&lt;br /&gt;Again, in terms of cost, we might also find a pair of tuples:  Object-&gt;String and String-&gt;Float.  This will have a higher cost than the Number-&gt;Float tuple and should be rejected in favor of the lower cost coercion.&lt;br /&gt;&lt;br /&gt;//Note: cost hasn't been implemented, and likely won't be, unless and until the algorithm as it stands is shown to provide less than optimal results.//&lt;br /&gt;&lt;br /&gt;The algorithm caches the result of this search, with proper guards for concurrent access. The cache is cleared when an invalidation of the component class loader occurs.&lt;br /&gt;&lt;br /&gt;!Configuring the service&lt;br /&gt;&lt;br /&gt;This has been implemented as service tapestry.TypeCoercer.&lt;br /&gt;&lt;br /&gt;The configuration of this service is an unordered collection of CoercionTuple.</d
 escription>
-<category>parameters</category>
-<category>types</category>
-<link>http://tapestry.apache.org/tapestry5/tap5devwiki.html#TypeCoercion</link>
-<pubDate>Sat, 23 Sep 2006 22:52:00 GMT</pubDate>
+<title>MasterIndex</title>
+<description>* PropBinding -- Notes on the workhorse &quot;prop:&quot; binding prefix&lt;br /&gt;* TypeCoercion -- How Tapestry 5 extensibly addresses type conversion&lt;br /&gt;* FormProcessing&lt;br /&gt;* DynamicPageState -- tracking changes to page state during the render&lt;br /&gt;* EnvironmentalServices -- how components cooperate during page render&lt;br /&gt;* ComponentMixins -- A new fundamental way to build web functionality</description>
+<link>http://tapestry.apache.org/tapestry5/tap5devwiki.html#MasterIndex</link>
+<pubDate>Thu, 05 Oct 2006 12:21:32 GMT</pubDate>
+</item>
+<item>
+<title>EnvironmentalServices</title>
+<description>Frequently, different components need to //cooperate// during the rendering process.&lt;br /&gt;&lt;br /&gt;This is an established pattern from Tapestry 4, which an enclosing component provides services to the components it encloses. By //encloses// we mean, any components that are rendered as part of the Form's body; give the use of the Block/~RenderBlock components, this can not be determined statically, but is instead determined dynamically, as part of the rendering process.&lt;br /&gt;&lt;br /&gt;The canoncial example of this pattern is Form component, and the complex relationship it has with each form element component it encloses.&lt;br /&gt;&lt;br /&gt;In Tapestry 4, this mechanism was based on the ~IRequestCycle which could store named attributes. The service providing component would store itself into the cycle using a well known name, and service consuming components would retrieve the service using the same well known name.&lt;br /&gt;&lt;br /&gt;For 
 Tapestry 5, this will be formalized. A new service will be used to manage this information:&lt;br /&gt;&lt;br /&gt;{{{&lt;br /&gt;public interface Enviroment&lt;br /&gt;{&lt;br /&gt;  &lt;T&gt; T push(Class&lt;T&gt; type, T instance);&lt;br /&gt;&lt;br /&gt;  &lt;T&gt; peek(Class&lt;T&gt; type);&lt;br /&gt;&lt;br /&gt;  &lt;T&gt; T pop(Class&lt;T&gt; type);&lt;br /&gt;}&lt;br /&gt;}}}&lt;br /&gt;&lt;br /&gt;The Environment is unique to a request.</description>
+<link>http://tapestry.apache.org/tapestry5/tap5devwiki.html#EnvironmentalServices</link>
+<pubDate>Tue, 26 Sep 2006 01:45:00 GMT</pubDate>
 </item>
 <item>
 <title>DynamicPageState</title>

Modified: tapestry/tapestry5/tapestry-core/trunk/src/test/app1/index.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/app1/index.html?view=diff&rev=453414&r1=453413&r2=453414
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/app1/index.html (original)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/app1/index.html Thu Oct  5 15:49:11 2006
@@ -31,6 +31,8 @@
                 <li>
                 <a href="MissingPage.html">Missing Page</a> -- Used to test exception reporting
                 </li>
+                <li>
+                <a href="BadTemplate.html">BadTemplate Page</a> -- More exception reporting
             </ul>
         </p>
         <p> Feast your eyes: </p>

Added: tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/pages/BadTemplate.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/pages/BadTemplate.java?view=auto&rev=453414
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/pages/BadTemplate.java (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/java/org/apache/tapestry/integration/app1/pages/BadTemplate.java Thu Oct  5 15:49:11 2006
@@ -0,0 +1,12 @@
+package org.apache.tapestry.integration.app1.pages;
+
+import org.apache.tapestry.annotations.ComponentClass;
+
+/**
+ * @author Howard M. Lewis Ship
+ */
+@ComponentClass
+public class BadTemplate
+{
+
+}

Added: tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html?view=auto&rev=453414
==============================================================================
--- tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html (added)
+++ tapestry/tapestry5/tapestry-core/trunk/src/test/resources/org/apache/tapestry/integration/app1/pages/BadTemplate.html Thu Oct  5 15:49:11 2006
@@ -0,0 +1,10 @@
+<t:comp type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+    <p>
+        This template is missing its close tag (&lt;/t:comp&gt;) and that's going to
+        cause some havoc!
+    </p>
+    
+    <p>
+        This page is used to test exception reporting.
+    </p>
\ No newline at end of file