You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2004/10/05 19:28:56 UTC

cvs commit: jakarta-tapestry/junit/src/org/apache/tapestry/enhance TestJavaTypeUtils.java

hlship      2004/10/05 10:28:56

  Modified:    src/documentation/content/xdocs/UsersGuide components.xml
                        spec.xml state.xml common.ent template.xml
               framework/src/java/org/apache/tapestry/param
                        ParameterManager.java
               framework/src/java/org/apache/tapestry/enhance
                        ComponentClassFactory.java
               junit/src/org/apache/tapestry/junit/parse
                        TestSpecificationParser.java
               framework/src/java/org/apache/tapestry/html
                        ExceptionDisplay.jwc
               doc/src/UsersGuide template.xml
               framework/src/java/org/apache/tapestry/parse
                        SpecificationParser.java Tapestry_3_1.dtd
               framework/src/java/org/apache/tapestry/pages Exception.page
  Added:       framework/src/java/org/apache/tapestry/enhance
                        JavaTypeUtils.java
               junit/src/org/apache/tapestry/junit/parse Binding31.jwc
               junit/src/org/apache/tapestry/enhance TestJavaTypeUtils.java
  Log:
  Define the Tapestry 3.1 Specification DTD and being simplifying it (from the 3.0 DTD).
  
  Revision  Changes    Path
  1.4       +5 -8      jakarta-tapestry/src/documentation/content/xdocs/UsersGuide/components.xml
  
  Index: components.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/src/documentation/content/xdocs/UsersGuide/components.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- components.xml	5 Sep 2004 18:53:57 -0000	1.3
  +++ components.xml	5 Oct 2004 17:28:55 -0000	1.4
  @@ -277,7 +277,7 @@
   </p>
   
   <p>
  -Because bindings are in the form of &OGNL; expressions, the property bound to a component parameter
  +Because bindings are often in the form of &OGNL; expressions, the property bound to a component parameter
   may not directly be a property of the page ... using a property sequence allows great flexibility.	
   </p>
   
  @@ -293,12 +293,9 @@
   
   
   <p>
  -Not all parameter bindings are writable. So far, the examples have been for parameters bound using
  -the &spec.binding; specification element (or the equivalent use of the ognl:	prefix
  -in an HTML template).  <em>Invariant bindings</em> are also possible--these are bindings directly to fixed
  -values that never change and can't be updated.  The &spec.static-binding; element is invariant; it's
  -HTML template equivalent is a attribute with no prefix. Likewise, the
  -&spec.message-binding; element, and the message: prefix on an attribute, are invariant.
  +Not all parameter bindings are writable. OGNL expressions may be writeable, if the expression
  +identifies a property that is itself writeable. Other types of bindings, such as message bindings
  +(the message: prefix), or literal bindings (no prefix) are read only.
   </p>
   	
   <section id="components.parameters.bindings">
  @@ -324,7 +321,7 @@
   <p>
   Updating a parameter is the same way, except that the method is
   <code>setObject()</code>. Most of the implementations of &IBinding; (those for literal strings
  -and localize messages), will throw an exception immediately, since they are invariant.
  +and localized messages), will throw an exception immediately, since they are invariant.
   </p>
   
   <figure alt="Updating a parameter" src="&imageroot;/write-binding.png"/>
  
  
  
  1.3       +44 -167   jakarta-tapestry/src/documentation/content/xdocs/UsersGuide/spec.xml
  
  Index: spec.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/src/documentation/content/xdocs/UsersGuide/spec.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- spec.xml	5 Oct 2004 03:25:38 -0000	1.2
  +++ spec.xml	5 Oct 2004 17:28:55 -0000	1.3
  @@ -109,6 +109,15 @@
     <li>The &lt;service&gt; element (inside &spec.application; or &spec.library-specification;) is no longer supported in 
       release 3.1. 3.0 DTD specifications that use &lt;service&gt; will generate a warning. Use the 
       &tapestry.services.ApplicationServices; configuration point instead.</li>
  +  <li>
  +    In the 3.0 DTD, the &spec.binding; element was for specifying OGNL expressions only, and had an
  +    expression attribute.  In the 3.1 DTD, it is used for setting all types of attributes, and has
  +    a value attribute (using a prefix to determine which type of binding is to be used).
  +  </li>
  +  <li>The &lt;static-binding&gt; and &lt;message-binding&gt; elements have been removed, replaced with
  +    the &spec.binding; element and the ognl: and message: prefixes, respectively.</li>
  +  <li>The &lt;inherited-binding&gt; element has been removed; parameters of parent components may be
  +    accessed as properties.</li>
   </ul>
   
   </section>  <!-- changes -->
  @@ -269,8 +278,7 @@
   </p>
   
   <p>
  -Binds a parameter of an embedded component to an OGNL expression rooted
  -in its container.
  +Binds a parameter of an embedded component to particular value.
   </p>
   
   <p>
  @@ -279,9 +287,9 @@
   </p>
   
   <p>
  -If the expression attribute is omitted, then
  -the body of the element must contain the OGNL expression.  This is useful when the
  -expression is long, or contains problematic characters (such as a mix
  +If the value attribute is omitted, then
  +the body of the element must contain the value.  This is useful when the
  +value is long, or contains problematic characters (such as a mix
   of single and double quotes).
   </p>
   
  @@ -304,15 +312,43 @@
   	<td>The name of the parameter to bind.</td>
   </tr>
   <tr>
  -	<td>expression</td>
  +	<td>value</td>
   	<td>string</td>
   	<td>yes</td>
   	<td/>
  -	<td>The OGNL expression, relative to the container, to be bound to the parameter.</td>
  +	<td>The value to bind to the parameter.</td>
   </tr>
   
   </table>
   
  +<p>
  +The value may be literal or interpreted; interpreted values are divided into a
  +<em>prefix</em> and a <em>locator</em>.  The prefix identifies how the locator is 
  +interpreted.
  +</p>
  +
  +<table>
  +  <tr>
  +    <th>Prefix</th>
  +    <th>Locator Description</th>
  +  </tr>
  +  
  +  <tr>
  +    <td>ognl:</td>
  +    <td>The locator is an &OGNL; expression.  The expression is evaluated with the page or component as its root object (this is the page
  +      or component defined by the specification).  This is the only type of expression that may be writeable. </td>
  +  </tr>
  +  
  +  <tr>
  +    <td>message:</td>
  +    <td>The locator is a key used to obtain a localized message for the page or component.</td>
  +  </tr>
  +</table>
  +
  +<note>
  +  More prefixes are forthcoming in release 3.1, and it is is also possible to define your own prefixes.
  +</note>
  +
   
   </section> <!-- spec.binding -->
   
  @@ -402,7 +438,7 @@
   <p>&component; Elements</p>
   <source>
     &spec.property; *,
  -  (&spec.binding; | &spec.inherited-binding; | &spec.listener-binding; | &spec.static-binding; | &spec.message-binding;) *
  +  (&spec.binding; | &spec.listener-binding;) *
   </source>
   
   	
  @@ -781,61 +817,8 @@
   
   </table>
   
  -
  -
   </section> <!-- spec.external-asset -->
   
  -
  -<section id="spec.inherited-binding">
  -	<title>&lt;inherited-binding&gt; element</title>
  -
  -<p>
  -Appears in: &spec.component;
  -</p>
  -
  -<p>
  -Binds a parameter of an embedded component to a parameter
  -of its container.
  -</p>
  -
  -
  -<p>
  -In an instantiated component, bindings can be accessed with
  -the OGNL expression bindings.<em>name</em>.
  -</p>
  -
  -
  -<table>
  -
  -<tr>
  -  <th>Name</th>
  -  <th>Type</th>
  -  <th>Required ?</th>
  -  <th>Default Value</th>
  -  <th>Description</th>
  -</tr>
  -
  -<tr>
  -	<td>name</td>
  -	<td>string</td>
  -	<td>yes</td>
  -	<td/>
  -	<td>The name of the parameter to bind.</td>
  -</tr>
  -<tr>
  -	<td>parameter-name</td>
  -	<td>string</td>
  -	<td>yes</td>
  -	<td/>
  -	<td>The name of a parameter of the containing component.
  -	</td>
  -</tr>
  -
  -</table>
  -
  -
  -</section> <!-- spec.inherited-binding -->
  -
   <section id="spec.library">
   	<title>&lt;library&gt; element</title>
   	
  @@ -983,54 +966,6 @@
   </section> <!-- spec.listener-binding -->
   
   
  -<section id="spec.message-binding">
  -	<title>&lt;message-binding&gt; element</title>
  -
  -<p>
  -Appears in: &spec.component;
  -</p>
  -
  -<p>
  -Binds a parameter of an embedded component to a localized
  -string of its containing page or component.
  -</p>
  -
  -<p>
  -In an instantiated component, bindings can be accessed with
  -the OGNL expression bindings.<em>name</em>.
  -</p>
  -
  -
  -<table>
  -
  -<tr>
  -  <th>Name</th>
  -  <th>Type</th>
  -  <th>Required ?</th>
  -  <th>Default Value</th>
  -  <th>Description</th>
  -</tr>
  -
  -<tr>
  -	<td>name</td>
  -	<td>string</td>
  -	<td>yes</td>
  -	<td/>
  -	<td>The name of the parameter to bind.</td>
  -</tr>
  -<tr>
  -	<td>key</td>
  -	<td>string</td>
  -	<td>yes</td>
  -	<td/>
  -	<td>The localized property key to retrieve.
  -	</td>
  -</tr>
  -
  -</table>
  -
  -</section> <!-- spec.message-binding -->
  -
   <section id="spec.page">
   	<title>&lt;page&gt; element</title>
   
  @@ -1592,64 +1527,6 @@
   
   
   </section> <!-- spec.set-property -->
  -
  -
  -
  -<section id="spec.static-binding">
  -	<title>&lt;static-binding&gt; element</title>
  -
  -<p>
  -Appears in: &spec.component;
  -</p>
  -
  -<p>
  -Binds a parameter of an embedded component to a static value.  The value,
  -which is stored as a string, is specified
  -as the value attribute, or as
  -the wrapped contents
  -of the &lt;static-binding&gt; tag.  Leading
  -and trailing whitespace is removed.
  -</p>
  -
  -<p>
  -In an instantiated component, bindings can be accessed with
  -the OGNL expression bindings.<em>name</em>.
  -</p>
  -
  -
  -
  -<table>
  -
  -<tr>
  -  <th>Name</th>
  -  <th>Type</th>
  -  <th>Required ?</th>
  -  <th>Default Value</th>
  -  <th>Description</th>
  -</tr>
  -
  -<tr>
  -	<td>name</td>
  -	<td>string</td>
  -	<td>yes</td>
  -	<td/>
  -	<td>The name of the parameter to bind.</td>
  -</tr>
  -<tr>
  -	<td>value</td>
  -	<td>string</td>
  -	<td>no</td>
  -	<td/>
  -	<td>The string value to be used.  If omitted, the wrapped character data
  -	is used instead (which is more convienient if the value is large, or
  -	contains problematic punctuation).</td>
  -</tr>
  -
  -</table>
  -
  -
  -
  -</section> <!-- spec.static-binding -->
   
   </body>
   </document>
  
  
  
  1.2       +0 -1      jakarta-tapestry/src/documentation/content/xdocs/UsersGuide/state.xml
  
  Index: state.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/src/documentation/content/xdocs/UsersGuide/state.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- state.xml	5 Sep 2004 15:30:51 -0000	1.1
  +++ state.xml	5 Oct 2004 17:28:55 -0000	1.2
  @@ -216,7 +216,6 @@
   </p>
   
   <source><![CDATA[
  -<![CDATA[
   <application name="My Application">
     <property name="org.apache.tapestry.visit-class" value="mypackage.MyVisit"/>
   
  
  
  
  1.7       +0 -3      jakarta-tapestry/src/documentation/content/xdocs/UsersGuide/common.ent
  
  Index: common.ent
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/src/documentation/content/xdocs/UsersGuide/common.ent,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- common.ent	5 Oct 2004 03:25:38 -0000	1.6
  +++ common.ent	5 Oct 2004 17:28:55 -0000	1.7
  @@ -31,11 +31,9 @@
   <!ENTITY spec.description			'<link href="spec.html#spec.description">&lt;description&gt;</link>'>
   <!ENTITY spec.extension				'<link href="spec.html#spec.extension">&lt;extension&gt;</link>'>
   <!ENTITY spec.external-asset		'<link href="spec.html#spec.external-asset">&lt;external-asset&gt;</link>'>
  -<!ENTITY spec.inherited-binding		'<link href="spec.html#spec.inherited-binding">&lt;inherited-binding&gt;</link>'>
   <!ENTITY spec.library				'<link href="spec.html#spec.library">&lt;library&gt;</link>'>
   <!ENTITY spec.library-specification	'<link href="spec.html#spec.library-specification">&lt;library-specification&gt;</link>'>
   <!ENTITY spec.listener-binding		'<link href="spec.html#spec.listener-binding">&lt;listener-binding&gt;</link>'>
  -<!ENTITY spec.message-binding		'<link href="spec.html#spec.message-binding">&lt;message-binding&gt;</link>'>
   <!ENTITY spec.page					'<link href="spec.html#spec.page">&lt;page&gt;</link>'>
   <!ENTITY spec.page-specification	'<link href="spec.html#spec.page-specification">&lt;page-specification&gt;</link>'>
   <!ENTITY spec.parameter				'<link href="spec.html#spec.parameter">&lt;parameter&gt;</link>'>
  @@ -46,7 +44,6 @@
   <!ENTITY spec.reserved-parameter	'<link href="spec.html#spec.reserved-parameter">&lt;reserved-parameter&gt;</link>'>
   <!ENTITY spec.set-message-property	'<link href="spec.html#spec.set-message-property">&lt;set-message-property&gt;</link>'>
   <!ENTITY spec.set-property			'<link href="spec.html#spec.set-property">&lt;set-property&gt;</link>'>
  -<!ENTITY spec.static-binding		'<link href="spec.html#spec.static-binding">&lt;static-binding&gt;</link>'>
   
   <!ENTITY imageroot					'&projectroot;images/UsersGuide'>
   
  
  
  
  1.3       +12 -12    jakarta-tapestry/src/documentation/content/xdocs/UsersGuide/template.xml
  
  Index: template.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/src/documentation/content/xdocs/UsersGuide/template.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- template.xml	5 Sep 2004 18:53:57 -0000	1.2
  +++ template.xml	5 Oct 2004 17:28:55 -0000	1.3
  @@ -281,8 +281,7 @@
   		
   <p>
   Component parameters may always be specified in the page or component 
  -specification, using the
  -&spec.binding;, &spec.static-binding; and &spec.message-binding; elements. Prior to Tapestry 3.0, that
  +specification, using the &spec.binding; element. Prior to Tapestry 3.0, that
   was the only way ... but with 3.0, it is possible to specify parameters directly within the
   HTML template.
   </p>	
  @@ -290,24 +289,26 @@
   <p>
   Using either style of component (declared or implicit), parameters of the component may be <em>bound</em>
   by adding attributes to the tag.
  -Most attributes bind parameters to a static (unchanging) value, equivalent to using
  -the &spec.static-binding; element in the specification. Static bindings are just the
  -literal text, the attribute value from the HTML template.
  +Most attributes bind parameters to a literal value, the exact value provided in the attribute.
   </p>
   
   <p>
   Prefixing an attribute value with <code>ognl:</code>	 indicates that the value
  -is really an &OGNL; expression, equivalent to using the &spec.binding; element in the specification.
  +is really an &OGNL; expression.
   </p>
   
   <p>
  -Finally, prefixing an attribute value with <code>message:</code> indicates that the value
  -is really a key used to get a localized message, equivalent to the &spec.message-binding; element
  -in the specification. Every page, and every component, is allowed to have its own set of messages (stored
  +Prefixing an attribute value with <code>message:</code> indicates that the value
  +is really a key used to obtain a localized message. 
  +Every page, and every component, is allowed to have its own set of messages (stored
   in a set of .properties files), and the <code>message:</code> prefix allows access
   to the localized messages stored in the files.
   </p>
   
  +<note>
  +Additional prefixes will be available in Tapestry 3.1, and it will also be possible to define your own prefixes.
  +</note>
  +
   <section>
   <title>Seperation of Concerns</title>	
   
  @@ -448,8 +449,7 @@
   
   <p>
   As we've seen, it is possible to access the messages for a page or component using the
  -<code>message:</code>	 prefix on a component parameter (or use
  -the &spec.message-binding; element in a page or component specification).
  +<code>message:</code>	 prefix on a component parameter.
   </p>
   
   <p>
  
  
  
  1.4       +4 -1      jakarta-tapestry/framework/src/java/org/apache/tapestry/param/ParameterManager.java
  
  Index: ParameterManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/param/ParameterManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ParameterManager.java	16 Sep 2004 14:58:32 -0000	1.3
  +++ ParameterManager.java	5 Oct 2004 17:28:55 -0000	1.4
  @@ -33,6 +33,7 @@
   import org.apache.tapestry.IComponent;
   import org.apache.tapestry.IRequestCycle;
   import org.apache.tapestry.Tapestry;
  +import org.apache.tapestry.enhance.JavaTypeUtils;
   import org.apache.tapestry.spec.Direction;
   import org.apache.tapestry.spec.IComponentSpecification;
   import org.apache.tapestry.spec.IParameterSpecification;
  @@ -309,6 +310,8 @@
           if (result != null)
               return result;
   
  -        return resolver.findClass(name);
  +        // Convert array references into the format needed by the resolver.
  +        
  +        return resolver.findClass(JavaTypeUtils.getJVMClassName(name));
       }
   }
  
  
  
  1.4       +73 -155   jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/ComponentClassFactory.java
  
  Index: ComponentClassFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/ComponentClassFactory.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ComponentClassFactory.java	16 Sep 2004 00:26:17 -0000	1.3
  +++ ComponentClassFactory.java	5 Oct 2004 17:28:55 -0000	1.4
  @@ -38,12 +38,11 @@
   import org.apache.tapestry.spec.IPropertySpecification;
   
   /**
  - *  Contains the logic for analyzing and enhancing a single component class.
  - *  Internally, this class makes use of {@link IEnhancedClassFactory}.
  - *
  - *  @author Howard Lewis Ship
  - *  @since 3.0
  - *
  + * Contains the logic for analyzing and enhancing a single component class. Internally, this class
  + * makes use of {@link IEnhancedClassFactory}.
  + * 
  + * @author Howard Lewis Ship
  + * @since 3.0
    */
   
   public class ComponentClassFactory
  @@ -51,46 +50,31 @@
       private static final Log LOG = LogFactory.getLog(ComponentClassFactory.class);
   
       /**
  -     *  Package prefix used for classes that come out of the java. or javax. packages.
  +     * Package prefix used for classes that come out of the java. or javax. packages.
        */
       private static final String ENHANCED_PACKAGE = "org.apache.tapestry.enhanced.";
   
       /**
  -     *  UID used to generate new class names.
  +     * UID used to generate new class names.
        */
       private static int _uid = 0;
   
  -    /**
  -     *  Mapping between a primitive type and its Java VM representation
  -     *  Used for the encoding of array types
  -     */
  -    private static Map _primitiveTypes = new HashMap();
  -
  -    static {
  -        _primitiveTypes.put("boolean", "Z");
  -        _primitiveTypes.put("short", "S");
  -        _primitiveTypes.put("int", "I");
  -        _primitiveTypes.put("long", "J");
  -        _primitiveTypes.put("float", "F");
  -        _primitiveTypes.put("double", "D");
  -        _primitiveTypes.put("char", "C");
  -        _primitiveTypes.put("byte", "B");
  -    }
  -
       private EnhancementWorklist _worklist;
  +
       private Map _beanProperties = new HashMap();
   
       private ClassResolver _resolver;
  +
       private IComponentSpecification _specification;
  +
       private Class _componentClass;
  +
       private ClassFactory _classFactory;
  +
       private JavaClassMapping _classMapping = new JavaClassMapping();
   
  -    public ComponentClassFactory(
  -        ClassResolver resolver,
  -        IComponentSpecification specification,
  -        Class componentClass,
  -        ClassFactory classFactory)
  +    public ComponentClassFactory(ClassResolver resolver, IComponentSpecification specification,
  +            Class componentClass, ClassFactory classFactory)
       {
           _resolver = resolver;
           _specification = specification;
  @@ -101,11 +85,10 @@
       }
   
       /**
  -     * We synchronize this method to, hopefully, prevent multiple
  -     * threads from introspecting any singe class at one time.
  -     * The Introspector is not thread safe.  Unforunately, PropertyUtils, OGNL, here
  -     * (and elsewhere?) may attempt to introspect at the same time ... we're safe
  -     * as long as its not the same class being introspected.
  +     * We synchronize this method to, hopefully, prevent multiple threads from introspecting any
  +     * singe class at one time. The Introspector is not thread safe. Unforunately, PropertyUtils,
  +     * OGNL, here (and elsewhere?) may attempt to introspect at the same time ... we're safe as long
  +     * as its not the same class being introspected.
        */
       private synchronized void buildBeanProperties()
       {
  @@ -118,9 +101,9 @@
           }
           catch (IntrospectionException ex)
           {
  -            throw new ApplicationRuntimeException(
  -                EnhanceMessages.unabelToIntrospectClass(_componentClass, ex),
  -                ex);
  +            throw new ApplicationRuntimeException(EnhanceMessages.unabelToIntrospectClass(
  +                    _componentClass,
  +                    ex), ex);
           }
   
           PropertyDescriptor[] descriptors = info.getPropertyDescriptors();
  @@ -137,10 +120,8 @@
       }
   
       /**
  -     *  Invokes {@link #scanForEnhancements()} to identify any
  -     *  enhancements needed on the class, returning true
  -     *  if there are any enhancements to be performed. 
  -     * 
  +     * Invokes {@link #scanForEnhancements()}to identify any enhancements needed on the class,
  +     * returning true if there are any enhancements to be performed.
        */
   
       public boolean needsEnhancement()
  @@ -173,7 +154,7 @@
       }
   
       /**
  -     * @return true if m is not null and not abstract  
  +     * @return true if m is not null and not abstract
        */
       public boolean isImplemented(Method m)
       {
  @@ -184,13 +165,13 @@
       }
   
       /**
  -     *  Given a class name, returns the corresponding class.  In addition,
  -     *  scalar types, arrays of scalar types, java.lang.Object[] and
  -     *  java.lang.String[] are supported.
  -     * 
  -     *  @param type to convert to a Class
  -     *  @param location of the involved specification element (for exception reporting)
  +     * Given a class name, returns the corresponding class. In addition, scalar types, arrays of
  +     * scalar types, java.lang.Object[] and java.lang.String[] are supported.
        * 
  +     * @param type
  +     *            to convert to a Class
  +     * @param location
  +     *            of the involved specification element (for exception reporting)
        */
   
       public Class convertPropertyType(String type, Location location)
  @@ -201,15 +182,13 @@
           {
               try
               {
  -                String typeName = translateClassName(type);
  +                String typeName = JavaTypeUtils.getJVMClassName(type);
                   result = _resolver.findClass(typeName);
               }
               catch (Exception ex)
               {
  -                throw new ApplicationRuntimeException(
  -                    EnhanceMessages.badPropertyType(type, ex),
  -                    location,
  -                    ex);
  +                throw new ApplicationRuntimeException(EnhanceMessages.badPropertyType(type, ex),
  +                        location, ex);
               }
   
               _classMapping.recordType(type, result);
  @@ -218,55 +197,20 @@
           return result;
       }
   
  -    /**
  -     *  Translates types from standard Java format to Java VM format.
  -     *  For example, java.util.Locale remains java.util.Locale, but
  -     *  int[][] is translated to [[I and java.lang.Object[] to 
  -     *  [Ljava.lang.Object;   
  -     *  This method and its static Map should go into a utility class
  -     */
  -    private String translateClassName(String type)
  -    {
  -        // if it is not an array, just return the type itself
  -        if (!type.endsWith("[]"))
  -            return type;
  -
  -        // if it is an array, convert it to JavaVM-style format
  -        StringBuffer javaType = new StringBuffer();
  -        while (type.endsWith("[]"))
  -        {
  -            javaType.append("[");
  -            type = type.substring(0, type.length() - 2);
  -        }
  -
  -        String primitiveIdentifier = (String) _primitiveTypes.get(type);
  -        if (primitiveIdentifier != null)
  -            javaType.append(primitiveIdentifier);
  -        else
  -            javaType.append("L" + type + ";");
  -
  -        return javaType.toString();
  -    }
  -
  -	private void checkPropertyType(PropertyDescriptor pd, Class propertyType, Location location)
  +    private void checkPropertyType(PropertyDescriptor pd, Class propertyType, Location location)
       {
           if (!pd.getPropertyType().equals(propertyType))
  -            throw new ApplicationRuntimeException(
  -                EnhanceMessages.propertyTypeMismatch(
  +            throw new ApplicationRuntimeException(EnhanceMessages.propertyTypeMismatch(
                       _componentClass,
                       pd.getName(),
                       pd.getPropertyType(),
  -                    propertyType),
  -                location,
  -                null);
  +                    propertyType), location, null);
       }
   
       /**
  -     *  Checks to see that that class either doesn't provide the property, or does
  -     *  but the accessor(s) are abstract.  Returns the name of the read accessor if found,
  -     * or fabricates an appropriate name (if not). Returns null only if the property does
  -     * not exist.
  -     * 
  +     * Checks to see that that class either doesn't provide the property, or does but the
  +     * accessor(s) are abstract. Returns the name of the read accessor if found, or fabricates an
  +     * appropriate name (if not). Returns null only if the property does not exist.
        */
   
       private String findReadMethodName(String propertyName, Class propertyType, Location location)
  @@ -282,16 +226,12 @@
           Method read = d.getReadMethod();
   
           if (isImplemented(write))
  -            throw new ApplicationRuntimeException(
  -                EnhanceMessages.nonAbstractWrite(write.getDeclaringClass(), propertyName),
  -                location,
  -                null);
  +            throw new ApplicationRuntimeException(EnhanceMessages.nonAbstractWrite(write
  +                    .getDeclaringClass(), propertyName), location, null);
   
           if (isImplemented(read))
  -            throw new ApplicationRuntimeException(
  -                EnhanceMessages.nonAbstractRead(read.getDeclaringClass(), propertyName),
  -                location,
  -                null);
  +            throw new ApplicationRuntimeException(EnhanceMessages.nonAbstractRead(read
  +                    .getDeclaringClass(), propertyName), location, null);
   
           if (read != null)
               return read.getName();
  @@ -299,7 +239,7 @@
           return CreateAccessorUtils.buildMethodName("get", propertyName);
       }
   
  -	private boolean isMissingProperty(String propertyName)
  +    private boolean isMissingProperty(String propertyName)
       {
           PropertyDescriptor pd = getPropertyDescriptor(propertyName);
   
  @@ -307,13 +247,11 @@
       }
   
       /**
  -     *  Invoked by {@link org.apache.tapestry.enhance.DefaultComponentClassEnhancer} to
  -     *  create an enahanced
  -     *  subclass of the component class.  This means creating a default constructor,
  -     *  new fields, and new accessor and mutator methods.  Properties are created
  -     *  for connected parameters, for all formal parameters (the binding property),
  -     *  and for all specified parameters (which may be transient or persistent).
  -     * 
  +     * Invoked by {@link org.apache.tapestry.enhance.DefaultComponentClassEnhancer}to create an
  +     * enahanced subclass of the component class. This means creating a default constructor, new
  +     * fields, and new accessor and mutator methods. Properties are created for connected
  +     * parameters, for all formal parameters (the binding property), and for all specified
  +     * parameters (which may be transient or persistent).
        */
   
       public Class createEnhancedSubclass()
  @@ -324,10 +262,7 @@
           String subclassName = worklist.getClassName();
   
           if (LOG.isDebugEnabled())
  -            LOG.debug(
  -                "Enhancing subclass of "
  -                    + startClassName
  -                    + " for "
  +            LOG.debug("Enhancing subclass of " + startClassName + " for "
                       + _specification.getSpecificationLocation());
   
           Class result = worklist.createEnhancedSubclass();
  @@ -339,26 +274,23 @@
       }
   
       /**
  -     *  Invoked by {@link #needsEnhancement()} to find any enhancements
  -     *  that may be needed.  Should create an {@link org.apache.tapestry.enhance.IEnhancer}
  -     *  for each one, and add it to the queue.
  -     * 
  +     * Invoked by {@link #needsEnhancement()}to find any enhancements that may be needed. Should
  +     * create an {@link org.apache.tapestry.enhance.IEnhancer}for each one, and add it to the
  +     * queue.
        */
   
  -	private void scanForEnhancements()
  +    private void scanForEnhancements()
       {
           scanForParameterEnhancements();
           scanForSpecifiedPropertyEnhancements();
       }
   
       /**
  -     *  Invoked by {@link #scanForEnhancements()} to locate
  -     *  any enhancements needed for component parameters (this includes
  -     *  binding properties and connected parameter property).
  -     * 
  +     * Invoked by {@link #scanForEnhancements()}to locate any enhancements needed for component
  +     * parameters (this includes binding properties and connected parameter property).
        */
   
  -	private void scanForParameterEnhancements()
  +    private void scanForParameterEnhancements()
       {
           List names = _specification.getParameterNames();
           int count = names.size();
  @@ -376,7 +308,7 @@
   
       }
   
  -	private void scanForSpecifiedPropertyEnhancements()
  +    private void scanForSpecifiedPropertyEnhancements()
       {
           List names = _specification.getPropertySpecificationNames();
           int count = names.size();
  @@ -391,7 +323,7 @@
           }
       }
   
  -	private void scanForBindingProperty(String parameterName, IParameterSpecification ps)
  +    private void scanForBindingProperty(String parameterName, IParameterSpecification ps)
       {
           String propertyName = parameterName + Tapestry.PARAMETER_PROPERTY_NAME_SUFFIX;
           PropertyDescriptor pd = getPropertyDescriptor(propertyName);
  @@ -414,7 +346,7 @@
           addEnhancer(enhancer);
       }
   
  -	private void scanForParameterProperty(String parameterName, IParameterSpecification ps)
  +    private void scanForParameterProperty(String parameterName, IParameterSpecification ps)
       {
           Direction direction = ps.getDirection();
   
  @@ -440,48 +372,38 @@
   
           String readMethodName = findReadMethodName(propertyName, propertyType, location);
   
  -        IEnhancer enhancer =
  -            new CreatePropertyEnhancer(propertyName, propertyType, readMethodName, false);
  +        IEnhancer enhancer = new CreatePropertyEnhancer(propertyName, propertyType, readMethodName,
  +                false);
   
           addEnhancer(enhancer);
       }
   
  -	private void addAutoParameterEnhancer(String parameterName, IParameterSpecification ps)
  +    private void addAutoParameterEnhancer(String parameterName, IParameterSpecification ps)
       {
           Location location = ps.getLocation();
           String propertyName = ps.getPropertyName();
   
           if (!ps.isRequired() && ps.getDefaultValue() == null)
  -            throw new ApplicationRuntimeException(
  -                EnhanceMessages.autoMustBeRequired(propertyName),
  -                location,
  -                null);
  +            throw new ApplicationRuntimeException(EnhanceMessages.autoMustBeRequired(propertyName),
  +                    location, null);
   
           Class propertyType = convertPropertyType(ps.getType(), location);
   
           String readMethodName = findReadMethodName(propertyName, propertyType, location);
   
  -        IEnhancer enhancer =
  -            new CreateAutoParameterEnhancer(
  -                propertyName,
  -                parameterName,
  -                propertyType,
  -                readMethodName);
  +        IEnhancer enhancer = new CreateAutoParameterEnhancer(propertyName, parameterName,
  +                propertyType, readMethodName);
   
           addEnhancer(enhancer);
       }
   
  -	private void addEnhancer(IEnhancer eh)
  +    private void addEnhancer(IEnhancer eh)
       {
           if (_worklist == null)
           {
               String subclassName = constructEnhancedClassName();
   
  -            _worklist =
  -                new EnhancementWorklistImpl(
  -                    subclassName,
  -                    _componentClass,
  -                    _resolver,
  +            _worklist = new EnhancementWorklistImpl(subclassName, _componentClass, _resolver,
                       _classFactory);
           }
   
  @@ -499,8 +421,8 @@
           String packageName = lastdot < 1 ? "" : startClassName.substring(0, lastdot + 1);
           String rawName = startClassName.substring(lastdot + 1);
   
  -        // If the new class is located in a 'restricted' package, 
  -        // use a neutral package name 
  +        // If the new class is located in a 'restricted' package,
  +        // use a neutral package name
   
           if (packageName.startsWith("java.") || packageName.startsWith("javax."))
               packageName = ENHANCED_PACKAGE;
  @@ -508,7 +430,7 @@
           return packageName + "$" + rawName + "_" + generateUID();
       }
   
  -	private void scanForSpecifiedProperty(IPropertySpecification ps)
  +    private void scanForSpecifiedProperty(IPropertySpecification ps)
       {
           String propertyName = ps.getName();
           Location location = ps.getLocation();
  @@ -526,11 +448,7 @@
   
           String readMethodName = findReadMethodName(propertyName, propertyType, location);
   
  -        IEnhancer enhancer =
  -            new CreatePropertyEnhancer(
  -                propertyName,
  -                propertyType,
  -                readMethodName,
  +        IEnhancer enhancer = new CreatePropertyEnhancer(propertyName, propertyType, readMethodName,
                   ps.isPersistent());
   
           addEnhancer(enhancer);
  
  
  
  1.1                  jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/JavaTypeUtils.java
  
  Index: JavaTypeUtils.java
  ===================================================================
  // Copyright 2004 The Apache Software Foundation
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //     http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
  
  package org.apache.tapestry.enhance;
  
  import java.util.HashMap;
  import java.util.Map;
  
  /**
   * Holds a utility method that converts java type names (as they might appear in source code) into
   * JVM class names.
   * 
   * @author Howard M. Lewis Ship
   * @since 3.1
   */
  public class JavaTypeUtils
  {
      /**
       * Mapping between a primitive type and its Java VM representation Used for the encoding of
       * array types
       */
      private static Map PRIMITIVE_TYPES = new HashMap();
  
      static
      {
          PRIMITIVE_TYPES.put("boolean", "Z");
          PRIMITIVE_TYPES.put("short", "S");
          PRIMITIVE_TYPES.put("int", "I");
          PRIMITIVE_TYPES.put("long", "J");
          PRIMITIVE_TYPES.put("float", "F");
          PRIMITIVE_TYPES.put("double", "D");
          PRIMITIVE_TYPES.put("char", "C");
          PRIMITIVE_TYPES.put("byte", "B");
      }
  
      private JavaTypeUtils()
      {
          // Prevent instantiation
      }
  
      /**
       * Translates types from standard Java format to Java VM format. For example, java.util.Locale
       * remains java.util.Locale, but int[][] is translated to [[I and java.lang.Object[] to
       * [Ljava.lang.Object;
       */
      public static String getJVMClassName(String type)
      {
          // if it is not an array, just return the type itself
          if (!type.endsWith("[]"))
              return type;
  
          // if it is an array, convert it to JavaVM-style format
          StringBuffer buffer = new StringBuffer();
  
          while (type.endsWith("[]"))
          {
              buffer.append("[");
              type = type.substring(0, type.length() - 2);
          }
  
          String primitiveIdentifier = (String) PRIMITIVE_TYPES.get(type);
          if (primitiveIdentifier != null)
              buffer.append(primitiveIdentifier);
          else
          {
              buffer.append("L");
              buffer.append(type);
              buffer.append(";");
          }
  
          return buffer.toString();
      }
  }
  
  
  1.25      +21 -2     jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/TestSpecificationParser.java
  
  Index: TestSpecificationParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/TestSpecificationParser.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- TestSpecificationParser.java	5 Oct 2004 03:25:38 -0000	1.24
  +++ TestSpecificationParser.java	5 Oct 2004 17:28:55 -0000	1.25
  @@ -66,6 +66,26 @@
       }
   
       /**
  +     * Tests the new style &lt;binding&gt; element in 3.1 DTD.
  +     */
  +
  +    public void testBinding31() throws Exception
  +    {
  +        IComponentSpecification spec = parseComponent("Binding31.jwc");
  +        IContainedComponent cc = spec.getComponent("component");
  +
  +        IBindingSpecification bs = cc.getBinding("simple");
  +
  +        assertEquals(BindingType.PREFIXED, bs.getType());
  +        assertEquals("message:some-key", bs.getValue());
  +
  +        bs = cc.getBinding("enclosed");
  +
  +        assertEquals(BindingType.PREFIXED, bs.getType());
  +        assertEquals("ognl:zip.zap.zoop", bs.getValue());
  +    }
  +
  +    /**
        * Test valid parameter name.
        * 
        * @since 2.2
  @@ -782,7 +802,6 @@
       }
   
       /**
  -     * 
        * Check that &lt;service&gt; elements are ignored properly.
        * 
        * @since 3.1
  @@ -794,6 +813,6 @@
   
           parseLib("ServiceElement.library");
   
  -        assertLoggedMessagePattern("The <service> element is no longer supported");        
  +        assertLoggedMessagePattern("The <service> element is no longer supported");
       }
   }
  
  
  
  1.1                  jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/Binding31.jwc
  
  Index: Binding31.jwc
  ===================================================================
  <?xml version="1.0"?>
  <!--
     Copyright 2004 The Apache Software Foundation
    
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
    
         http://www.apache.org/licenses/LICENSE-2.0
    
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
  -->
  <!DOCTYPE component-specification PUBLIC 
    "-//Apache Software Foundation//Tapestry Specification 3.1//EN" 
    "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_1.dtd">
  	
  <component-specification>
  
    <component id="component" type="SomeComponent">
      <binding name="simple" value="message:some-key"/>
      <binding name="enclosed">
        ognl:zip.zap.zoop
      </binding>
    </component>
    
    
  </component-specification>
  
  
  
  1.2       +18 -18    jakarta-tapestry/framework/src/java/org/apache/tapestry/html/ExceptionDisplay.jwc
  
  Index: ExceptionDisplay.jwc
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/html/ExceptionDisplay.jwc,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ExceptionDisplay.jwc	3 Sep 2004 17:46:10 -0000	1.1
  +++ ExceptionDisplay.jwc	5 Oct 2004 17:28:55 -0000	1.2
  @@ -15,8 +15,8 @@
      limitations under the License.
   -->
   <!DOCTYPE component-specification PUBLIC 
  -  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
  -  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
  +  "-//Apache Software Foundation//Tapestry Specification 3.1//EN" 
  +  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_1.dtd">
   		
   <component-specification class="org.apache.tapestry.html.ExceptionDisplay" 
   	allow-body="no" 
  @@ -26,7 +26,7 @@
     Used to present a detail exception description.
     </description>
     
  -  <parameter name="exceptions" required="yes">
  +  <parameter name="exceptions" type="org.apache.tapestry.util.exception.ExceptionDescription[]" direction="in" required="yes">
       <description>
       An array of ExceptionDescription objects.
       </description>
  @@ -35,48 +35,48 @@
     <bean name="evenOdd" class="org.apache.tapestry.bean.EvenOdd"/>
       
     <component id="eException" type="Foreach">
  -    <inherited-binding name="source" parameter-name="exceptions"/>
  -    <binding name="value" expression="exception"/>
  -    <binding name="index" expression="index"/>
  +    <binding name="source" value="ognl:exceptions"/>
  +    <binding name="value" value="ognl:exception"/>
  +    <binding name="index" value="ognl:index"/>
     </component>
     
     <component id="insertClass" type="Insert">
  -    <binding name="value" expression="exception.exceptionClassName"/>
  +    <binding name="value" value="ognl:exception.exceptionClassName"/>
     </component>
     
     <component id="insertMessage" type="Insert">
  -    <binding name="value" expression="exception.message"/>
  +    <binding name="value" value="ognl:exception.message"/>
     </component>
     
     <component id="eProperty" type="Foreach">
  -  	<static-binding name="element" value="tr"/>
  -  	<binding name="class" expression="beans.evenOdd.next"/>
  -    <binding name="source" expression="exception.properties"/>
  +  	<binding name="element" value="tr"/>
  +  	<binding name="class" value="ognl:beans.evenOdd.next"/>
  +    <binding name="source" value="ognl:exception.properties"/>
     </component>
     
     <component id="insertPropertyName" type="Insert">
  -    <binding name="value" expression="components.eProperty.value.name"/>
  +    <binding name="value" value="ognl:components.eProperty.value.name"/>
     </component>
     
     <component id="insertPropertyValue" type="Insert">
  -    <binding name="value" expression="components.eProperty.value.value"/>
  +    <binding name="value" value="ognl:components.eProperty.value.value"/>
     </component>
     
     <component id="ifLast" type="Conditional">
  -    <binding name="condition" expression="last"/>
  +    <binding name="condition" value="ognl:last"/>
     </component>
     
     <component id="ifNotLast" type="Conditional">
  -    <binding name="condition" expression="! last"/>
  +    <binding name="condition" value="ognl:! last"/>
     </component>
     
     <component id="eStack" type="Foreach">
  -    <static-binding name="element" value="li"/>
  -    <binding name="source" expression="exception.stackTrace"/>
  +    <binding name="element" value="li"/>
  +    <binding name="source" value="ognl:exception.stackTrace"/>
     </component>
     
     <component id="insertStackTrace" type="Insert">
  -    <binding name="value" expression="components.eStack.value"/>
  +    <binding name="value" value="ognl:components.eStack.value"/>
     </component>
     
   </component-specification>
  
  
  
  1.5       +2 -2      jakarta-tapestry/doc/src/UsersGuide/template.xml
  
  Index: template.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/doc/src/UsersGuide/template.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- template.xml	2 Mar 2004 22:35:34 -0000	1.4
  +++ template.xml	5 Oct 2004 17:28:55 -0000	1.5
  @@ -410,7 +410,7 @@
   
   <para>
   Another conflict can occur when the HTML template specified an attribute that the component needs
  -to render itself. For example, the &DirectLink; component generates a <literal>&lt;a&gt;</literal> tag,
  +to render itself. For example, the &DirectLink; component generates a <literal> &lt;a&gt; </literal> tag,
   and needs to control the <literal>href</literal> attribute. However, for preview purposes, it often will 
   be written into the HTML template as:
   
  
  
  
  1.5       +77 -7     jakarta-tapestry/framework/src/java/org/apache/tapestry/parse/SpecificationParser.java
  
  Index: SpecificationParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/parse/SpecificationParser.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SpecificationParser.java	5 Oct 2004 03:25:37 -0000	1.4
  +++ SpecificationParser.java	5 Oct 2004 17:28:56 -0000	1.5
  @@ -144,11 +144,21 @@
   
       public static final String LIBRARY_ID_PATTERN = Tapestry.SIMPLE_PROPERTY_NAME_PATTERN;
   
  +    /** @since 3.1 */
       private final Log _log;
   
  +    /** @since 3.1 */
       private final ErrorHandler _errorHandler;
   
       /**
  +     * Set to true if parsing the 3.1 DTD.
  +     * 
  +     * @since 3.1
  +     */
  +
  +    private boolean _DTD_3_1;
  +
  +    /**
        * Perl5 pattern for page names. Letter followed by letter, number, dash, underscore or period.
        * 
        * @since 2.2
  @@ -193,7 +203,13 @@
   
       private static final int STATE_BEAN = 4;
   
  -    private static final int STATE_BINDING = 7;
  +    /** Very different between 3.0 and 3.1 DTD */
  +
  +    private static final int STATE_BINDING_3_0 = 7;
  +
  +    /** @since 3.1 */
  +
  +    private static final int STATE_BINDING = 100;
   
       private static final int STATE_COMPONENT = 6;
   
  @@ -225,6 +241,7 @@
   
       private static final int STATE_SET_PROPERTY = 5;
   
  +    /** 3.0 DTD only */
       private static final int STATE_STATIC_BINDING = 9;
   
       /** @since 3.0 */
  @@ -426,8 +443,8 @@
       }
   
       /**
  -     * Special state for a number of types that can support the &lt;property&gt; (meta-data)
  -     * element.
  +     * Special state for a number of elements that can support the nested &lt;property&gt;
  +     * (meta-data) element.
        */
   
       private void beginAllowProperty()
  @@ -491,25 +508,27 @@
   
       private void beginComponent()
       {
  -
           if (_elementName.equals("binding"))
           {
               enterBinding();
               return;
           }
   
  +        // 3.0 DTD only
           if (_elementName.equals("static-binding"))
           {
               enterStaticBinding();
               return;
           }
   
  +        // 3.0 DTD only
           if (_elementName.equals("message-binding"))
           {
               enterMessageBinding();
               return;
           }
   
  +        // 3.0 DTD only
           if (_elementName.equals("inherited-binding"))
           {
               enterInheritedBinding();
  @@ -615,7 +634,7 @@
               return;
           }
   
  -        // Holdback from the 3.0 DTD, now ignored.
  +        // Holdover from the 3.0 DTD, now ignored.
   
           if (_elementName.equals("service"))
           {
  @@ -778,6 +797,11 @@
                   endSetProperty();
                   break;
   
  +            case STATE_BINDING_3_0:
  +
  +                endBinding_3_0();
  +                break;
  +
               case STATE_BINDING:
   
                   endBinding();
  @@ -817,7 +841,7 @@
           pop();
       }
   
  -    private void endBinding()
  +    private void endBinding_3_0()
       {
           BindingSetter bs = (BindingSetter) peekObject();
   
  @@ -955,6 +979,47 @@
   
       private void enterBinding()
       {
  +        if (!_DTD_3_1)
  +        {
  +            enterBinding_3_0();
  +            return;
  +        }
  +
  +        // 3.1 stuff
  +
  +        String name = getValidatedAttribute(
  +                "name",
  +                PARAMETER_NAME_PATTERN,
  +                "invalid-parameter-name");
  +        String value = getAttribute("value");
  +
  +        IContainedComponent cc = (IContainedComponent) peekObject();
  +
  +        BindingSetter bs = new BindingSetter(cc, name, value);
  +
  +        push(_elementName, bs, STATE_BINDING, false);
  +    }
  +
  +    private void endBinding()
  +    {
  +        BindingSetter bs = (BindingSetter) peekObject();
  +
  +        String value = getExtendedValue(bs.getValue(), "value", true);
  +
  +        IBindingSpecification spec = _factory.createBindingSpecification();
  +
  +        spec.setType(BindingType.PREFIXED);
  +        spec.setValue(value);
  +
  +        bs.apply(spec);
  +    }
  +
  +    /**
  +     * Handles a binding in a 3.0 DTD.
  +     */
  +
  +    private void enterBinding_3_0()
  +    {
           String name = getAttribute("name");
           String expression = getAttribute("expression");
   
  @@ -962,7 +1027,7 @@
   
           BindingSetter bs = new BindingSetter(cc, name, expression);
   
  -        push(_elementName, bs, STATE_BINDING, false);
  +        push(_elementName, bs, STATE_BINDING_3_0, false);
       }
   
       private void enterComponent()
  @@ -1499,6 +1564,8 @@
       protected void resetParser()
       {
           _rootObject = null;
  +        _DTD_3_1 = false;
  +
           _attributes.clear();
       }
   
  @@ -1509,7 +1576,10 @@
       public InputSource resolveEntity(String publicId, String systemId) throws SAXException
       {
           if (TAPESTRY_DTD_3_1_PUBLIC_ID.equals(publicId))
  +        {
  +            _DTD_3_1 = true;
               return getDTDInputSource("Tapestry_3_1.dtd");
  +        }
   
           if (TAPESTRY_DTD_3_0_PUBLIC_ID.equals(publicId))
               return getDTDInputSource("Tapestry_3_0.dtd");
  
  
  
  1.2       +11 -58    jakarta-tapestry/framework/src/java/org/apache/tapestry/parse/Tapestry_3_1.dtd
  
  Index: Tapestry_3_1.dtd
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/parse/Tapestry_3_1.dtd,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Tapestry_3_1.dtd	5 Oct 2004 03:25:37 -0000	1.1
  +++ Tapestry_3_1.dtd	5 Oct 2004 17:28:56 -0000	1.2
  @@ -27,6 +27,9 @@
   - The <service> element has been removed; it was used to define engine services, which
     is now accomplished using the HiveMind tapestry.services.ApplicationServices
     configuration point.
  +- The <static-binding>, <inherited-binding> and <message-binding> elements have been removed.
  +  There is now just <binding>, whose value attribute contains a prefix to interpret how
  +  the remainder of the value is interpreted (no prefix meaning a literal, or static, value).
   
   -->
   <!-- =======================================================
  @@ -102,20 +105,20 @@
   Element: binding
   Appears in: component
   
  -Binds a parameter of the component to a OGNL expression, relative
  -to its container.  The expression may be provided as an attribute, or 
  -as the body of the element.  The latter case is useful when the 
  -expression is long, or uses problematic characters (such as a 
  -mix of single and double quotes).
  +Binds a parameter of the component to a value. The value may
  +be literal, an OGNL expression, or something else, as
  +determined by its prefix. The value attribute is optional,
  +if not provided, the enclosed character data is the value
  +(but it is not allowed to specify both value and character data).
   
   Attributes:
     name: The name of the component parameter to bind.
  -  expression: The OGNL expression.
  +  value The value to bind to the parameter.
   -->
   <!ELEMENT binding (#PCDATA)>
   <!ATTLIST binding
   	name CDATA #REQUIRED
  -	expression CDATA #IMPLIED
  +	value CDATA #IMPLIED
   >
   <!-- =======================================================
   Element: configure
  @@ -152,7 +155,7 @@
   
   The Tapestry page loader ensures that either type or copy-of is specified, but not both.
   -->
  -<!ELEMENT component (property*, (binding | inherited-binding | listener-binding | static-binding | message-binding)*)>
  +<!ELEMENT component (property*, (binding | listener-binding)*)>
   <!ATTLIST component
   	id ID #REQUIRED
   	type CDATA #IMPLIED
  @@ -258,22 +261,6 @@
   	URL CDATA #REQUIRED
   >
   <!-- =======================================================
  -Element: inherited-binding
  -Appears in: component
  -
  -Binds a parameter of the component to a parameter of the container.
  -
  -Attributes:
  -  name: The name of the component parameter to bind.
  -  parameter-name: The name of the container parameter to bind the
  -    component parameter to.
  --->
  -<!ELEMENT inherited-binding EMPTY>
  -<!ATTLIST inherited-binding
  -	name CDATA #REQUIRED
  -	parameter-name CDATA #REQUIRED
  ->
  -<!-- =======================================================
   Element: library
   Appears in: application-specification, library-specification
   
  @@ -489,38 +476,4 @@
   	name CDATA #REQUIRED
   	key CDATA #REQUIRED
   >
  -<!-- =======================================================
  -Element: static-binding
  -Appears in: component
  -
  -Binds a parameter of the component to a static value defined directly
  -within this specification. The value either the value ttribute, or
  -the PCDATA wrapped by the element (with leading and trailing whitespace removed).
   
  -Attributes:
  -  name: The name of the component parameter to bind.
  -  value: The value of the binding.  If not specied, the PCDATA wrapped
  -    by the element is the binding.
  --->
  -<!ELEMENT static-binding (#PCDATA)>
  -<!ATTLIST static-binding
  -	name CDATA #REQUIRED
  -	value CDATA #IMPLIED
  ->
  -<!-- =======================================================
  -Element: message-binding
  -Appears in: component
  -
  -Binds a parameter of the component to a localized message of
  -its container.
  -
  -Attributes:
  -  name: The name of the component parameter to bind.
  -  key: The key used to access a localized string.
  -  
  --->
  -<!ELEMENT message-binding EMPTY>
  -<!ATTLIST message-binding
  -	name CDATA #REQUIRED
  -	key CDATA #REQUIRED
  ->
  
  
  
  1.2       +3 -3      jakarta-tapestry/framework/src/java/org/apache/tapestry/pages/Exception.page
  
  Index: Exception.page
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/pages/Exception.page,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Exception.page	3 Sep 2004 17:46:10 -0000	1.1
  +++ Exception.page	5 Oct 2004 17:28:56 -0000	1.2
  @@ -15,13 +15,13 @@
      limitations under the License.
   -->
   <!DOCTYPE page-specification PUBLIC 
  -  "-//Apache Software Foundation//Tapestry Specification 3.0//EN" 
  -  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
  +  "-//Apache Software Foundation//Tapestry Specification 3.1//EN" 
  +  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_1.dtd">
   	
   <page-specification class="org.apache.tapestry.pages.Exception">
     
     <component id="restart" type="ServiceLink">
  -    <binding name="service" expression="@org.apache.tapestry.Tapestry@RESTART_SERVICE"/>
  +    <binding name="service" value="ognl:@org.apache.tapestry.Tapestry@RESTART_SERVICE"/>
     </component>
     
     <private-asset name="stylesheet" resource-path="Exception.css"/>
  
  
  
  1.1                  jakarta-tapestry/junit/src/org/apache/tapestry/enhance/TestJavaTypeUtils.java
  
  Index: TestJavaTypeUtils.java
  ===================================================================
  // Copyright 2004 The Apache Software Foundation
  //
  // Licensed under the Apache License, Version 2.0 (the "License");
  // you may not use this file except in compliance with the License.
  // You may obtain a copy of the License at
  //
  //     http://www.apache.org/licenses/LICENSE-2.0
  //
  // Unless required by applicable law or agreed to in writing, software
  // distributed under the License is distributed on an "AS IS" BASIS,
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  // See the License for the specific language governing permissions and
  // limitations under the License.
  
  package org.apache.tapestry.enhance;
  
  import junit.framework.TestCase;
  
  /**
   * Tests for {@link org.apache.tapestry.enhance.JavaTypeUtils}.
   * 
   * @author Howard M. Lewis Ship
   * @since 3.1
   */
  public class TestJavaTypeUtils extends TestCase
  {
      private void test(String expected, String input)
      {
          String actual = JavaTypeUtils.getJVMClassName(input);
  
          assertEquals(expected, actual);
      }
  
      public void testNonArrayUnchanged()
      {
          test("java.lang.Object", "java.lang.Object");
          test("int", "int");
      }
  
      public void testPrimitiveArray()
      {
          test("[I", "int[]");
      }
  
      public void testObjectArray()
      {
          test("[Ljava.lang.Throwable;", "java.lang.Throwable[]");
      }
  
      public void testPrimitiveMultiArray()
      {
          test("[[B", "byte[][]");
      }
  
      // TODO: Test that all the primitives are correct
  
      public void testObjectMultiArray()
      {
          test("[[Ljava.lang.Runnable;", "java.lang.Runnable[][]");
      }
  }
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org