You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tiles.apache.org by ap...@apache.org on 2009/01/14 14:39:58 UTC

svn commit: r734389 - in /tiles/framework/trunk: tiles-api/src/main/java/org/apache/tiles/ tiles-api/src/test/java/org/apache/tiles/ tiles-core/src/main/java/org/apache/tiles/definition/dao/ tiles-core/src/main/java/org/apache/tiles/definition/digester...

Author: apetrelli
Date: Wed Jan 14 05:38:06 2009
New Revision: 734389

URL: http://svn.apache.org/viewvc?rev=734389&view=rev
Log:
Security bug 1, I will change this log later when I've finished committing.

Added:
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/AbstractAttributeEvaluator.java   (with props)
    tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_el_singleeval.jsp   (with props)
    tiles/framework/trunk/tiles-test/src/main/webapp/testput_el_singleeval.jsp   (with props)
    tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionELSingleEvalTest.html   (with props)
    tiles/framework/trunk/tiles-test/src/test/selenium/PutTagWithELSingleEvalTest.html   (with props)
Modified:
    tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Attribute.java
    tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/AttributeContext.java
    tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/BasicAttributeContext.java
    tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Definition.java
    tiles/framework/trunk/tiles-api/src/test/java/org/apache/tiles/BasicAttributeContextTest.java
    tiles/framework/trunk/tiles-api/src/test/java/org/apache/tiles/TestDefinition.java
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/el/ELAttributeEvaluator.java
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluator.java
    tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java
    tiles/framework/trunk/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_1.dtd
    tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/el/ELAttributeEvaluatorTest.java
    tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluatorTest.java
    tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java
    tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/StringAttributeRendererTest.java
    tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/TemplateAttributeRendererTest.java
    tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/UntypedAttributeRendererTest.java
    tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java
    tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java
    tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java
    tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTag.java
    tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java
    tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/RequestSettingViewPreparer.java
    tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs.xml
    tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp
    tiles/framework/trunk/tiles-test/src/main/webapp/testput_el.jsp
    tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html

Modified: tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Attribute.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Attribute.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Attribute.java (original)
+++ tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Attribute.java Wed Jan 14 05:38:06 2009
@@ -125,6 +125,14 @@
     protected Object value = null;
 
     /**
+     * The expression to evaluate. Ignored if {@link #value} is not
+     * <code>null</code>.
+     *
+     * @since 2.1.2
+     */
+    protected String expression = null;
+
+    /**
      * The renderer name of the attribute. Default names are <code>string</code>,
      * <code>template</code>, <code>definition</code>, <code>object</code>.
      */
@@ -194,7 +202,7 @@
      * @param value Object to store.
      * @param role Associated role.
      * @param type Attribute type.
-     * @deprecated Use {@link Attribute#Attribute(Object, String, String)}.
+     * @deprecated Use {@link Attribute#Attribute(Object, String, String, String)}.
      */
     @Deprecated
     public Attribute(Object value, String role, AttributeType type) {
@@ -206,13 +214,17 @@
     /**
      * Constructor.
      *
-     * @param value Object to store.
+     * @param value Object to store. If specified, the <code>expression</code>
+     * parameter will be ignored.
+     * @param expression The expression to be evaluated. Ignored if the
+     * <code>value</code> is not null.
      * @param role Associated role.
      * @param rendererName The renderer name.
-     * @since 2.1.0
+     * @since 2.1.2
      */
-    public Attribute(Object value, String role, String rendererName) {
+    public Attribute(Object value, String expression, String role, String rendererName) {
         this.value = value;
+        this.expression = expression;
         this.renderer = rendererName;
         setRole(role);
     }
@@ -312,6 +324,28 @@
         this.value = value;
     }
 
+    /**
+     * Returns The expression to evaluate. Ignored if {@link #value} is not
+     * <code>null</code>.
+     *
+     * @return The expression to be evaluated.
+     * @since 2.1.2
+     */
+    public String getExpression() {
+        return expression;
+    }
+
+    /**
+     * Sets The expression to evaluate. Ignored if {@link #value} is not
+     * <code>null</code>.
+     *
+     * @param expression The expression to be evaluated.
+     * @since 2.1.2
+     */
+    public void setExpression(String expression) {
+        this.expression = expression;
+    }
+
     /** {@inheritDoc} */
     public String toString() {
         if (value != null) {

Modified: tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/AttributeContext.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/AttributeContext.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/AttributeContext.java (original)
+++ tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/AttributeContext.java Wed Jan 14 05:38:06 2009
@@ -40,6 +40,14 @@
     String getTemplate();
 
     /**
+     * Returns the template expression to evaluate. If {@link #getTemplate()} is
+     * not <code>null</code> it is ignored.
+     *
+     * @return The template expression.
+     */
+    String getTemplateExpression();
+
+    /**
      * Sets the value of the template property.
      *
      * @param template the new value of the path property

Modified: tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/BasicAttributeContext.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/BasicAttributeContext.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/BasicAttributeContext.java (original)
+++ tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/BasicAttributeContext.java Wed Jan 14 05:38:06 2009
@@ -46,6 +46,14 @@
     protected String template = null;
 
     /**
+     * Template expression to evaluate. If {@link #template} is not
+     * <code>null</code> it is ignored.
+     *
+     * @since 2.1.2
+     */
+    protected String templateExpression = null;
+
+    /**
      * The roles that can render this definition.
      *
      * @since 2.1.0
@@ -104,6 +112,7 @@
             copyBasicAttributeContext((BasicAttributeContext) context);
         } else {
             this.template = context.getTemplate();
+            this.templateExpression = context.getTemplateExpression();
             Set<String> roles = context.getRoles();
             if (roles != null && !roles.isEmpty()) {
                 this.roles = new HashSet<String>(roles);
@@ -137,6 +146,26 @@
         this.template = template;
     }
 
+    /**
+     * Returns the template expression to evaluate. If {@link #getTemplate()} is
+     * not <code>null</code> it is ignored.
+     *
+     * @return The template expression.
+     */
+    public String getTemplateExpression() {
+        return templateExpression;
+    }
+
+    /**
+     * Sets the template expression to evaluate. If {@link #getTemplate()} is
+     * not <code>null</code> it is ignored.
+     *
+     * @param templateExpression The template expression.
+     */
+    public void setTemplateExpression(String templateExpression) {
+        this.templateExpression = templateExpression;
+    }
+
     /** {@inheritDoc} */
     public String getRole() {
         String retValue = null;
@@ -212,6 +241,9 @@
             if (template == null) {
                 template = parent.getTemplate();
             }
+            if (templateExpression == null) {
+                templateExpression = parent.getTemplateExpression();
+            }
             Set<String> parentRoles = parent.getRoles();
             if ((roles == null || roles.isEmpty()) && parentRoles != null
                     && !parentRoles.isEmpty()) {
@@ -265,6 +297,9 @@
         if (template == null) {
             template = parent.template;
         }
+        if (templateExpression == null) {
+            templateExpression = parent.templateExpression;
+        }
         if ((roles == null || roles.isEmpty()) && parent.roles != null
                 && !parent.roles.isEmpty()) {
             roles = new HashSet<String>(parent.roles);
@@ -435,6 +470,7 @@
     /** {@inheritDoc} */
     public void clear() {
         template = null;
+        templateExpression = null;
         preparer = null;
         roles = null;
         attributes.clear();
@@ -448,6 +484,7 @@
      */
     private void copyBasicAttributeContext(BasicAttributeContext context) {
         template = context.template;
+        templateExpression = context.templateExpression;
         Set<String> roles = context.roles;
         if (roles != null && !roles.isEmpty()) {
             this.roles = new HashSet<String>(roles);

Modified: tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Definition.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Definition.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Definition.java (original)
+++ tiles/framework/trunk/tiles-api/src/main/java/org/apache/tiles/Definition.java Wed Jan 14 05:38:06 2009
@@ -158,7 +158,7 @@
      */
     @Deprecated
     public void put(String name, Object content, String role) {
-        Attribute attribute = new Attribute(content, role, (String) null);
+        Attribute attribute = new Attribute(content, null, role, (String) null);
         putAttribute(name, attribute);
     }
 

Modified: tiles/framework/trunk/tiles-api/src/test/java/org/apache/tiles/BasicAttributeContextTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-api/src/test/java/org/apache/tiles/BasicAttributeContextTest.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-api/src/test/java/org/apache/tiles/BasicAttributeContextTest.java (original)
+++ tiles/framework/trunk/tiles-api/src/test/java/org/apache/tiles/BasicAttributeContextTest.java Wed Jan 14 05:38:06 2009
@@ -94,6 +94,7 @@
         EasyMock.expect(toCopy.getCascadedAttribute("cascaded2")).andReturn(
                 new Attribute("value4")).anyTimes();
         EasyMock.expect(toCopy.getTemplate()).andReturn("/template.jsp");
+        EasyMock.expect(toCopy.getTemplateExpression()).andReturn("expression");
         Set<String> roles = new HashSet<String>();
         roles.add("role1");
         roles.add("role2");
@@ -103,6 +104,8 @@
         BasicAttributeContext context = new BasicAttributeContext(toCopy);
         assertEquals("The template has not been set correctly",
                 "/template.jsp", context.getTemplate());
+        assertEquals("The template expression has not been set correctly",
+                "expression", context.getTemplateExpression());
         assertEquals("The roles are not the same", roles, context.getRoles());
         assertEquals("The preparer has not been set correctly",
                 "my.preparer.Preparer", context.getPreparer());

Modified: tiles/framework/trunk/tiles-api/src/test/java/org/apache/tiles/TestDefinition.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-api/src/test/java/org/apache/tiles/TestDefinition.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-api/src/test/java/org/apache/tiles/TestDefinition.java (original)
+++ tiles/framework/trunk/tiles-api/src/test/java/org/apache/tiles/TestDefinition.java Wed Jan 14 05:38:06 2009
@@ -70,7 +70,7 @@
         def.setName("test1");
         def.setTemplate("/page1.jsp");
         Attribute attr1 = new Attribute("test.definition.name", null,
-                "definition");
+                null, "definition");
         def.putAttribute("attr1",  attr1);
 
         attr1 = def.getAttribute("attr1");
@@ -113,6 +113,7 @@
         toCopy.setPreparer("ExtendedPreparer");
         toCopy.setRole("extendedRole");
         toCopy.setTemplate("extendedTemplate.jsp");
+        toCopy.setTemplateExpression("expression");
         context = new Definition();
         context.inherit(toCopy);
         assertEquals("Preparer not inherited", "ExtendedPreparer", context
@@ -123,10 +124,13 @@
                 "extendedRole"));
         assertEquals("Template not inherited", "extendedTemplate.jsp", context
                 .getTemplate());
+        assertEquals("Template expression not inherited", "expression", context
+                .getTemplateExpression());
         context = new Definition();
         context.setPreparer("LocalPreparer");
         context.setRole("localRole");
         context.setTemplate("localTemplate.jsp");
+        context.setTemplateExpression("localExpression");
         assertEquals("Preparer inherited", "LocalPreparer", context
                 .getPreparer());
         assertNotNull("Roles not correct", context.getRoles());
@@ -135,6 +139,7 @@
                 "localRole"));
         assertEquals("Template inherited", "localTemplate.jsp", context
                 .getTemplate());
+        assertEquals("Template expression inherited", "localExpression",
+                context.getTemplateExpression());
     }
-
 }

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/dao/CachingLocaleUrlDefinitionDAO.java Wed Jan 14 05:38:06 2009
@@ -336,6 +336,7 @@
         nudef.setPreparer(replace(d.getPreparer(), vars));
         nudef.setRole(replace(d.getRole(), vars));
         nudef.setTemplate(replace(d.getTemplate(), vars));
+        nudef.setTemplateExpression(d.getTemplateExpression());
 
         for (String attributeName : d.getLocalAttributeNames()) {
             Attribute attr = d.getLocalAttribute(attributeName);
@@ -343,6 +344,7 @@
 
             nuattr.setRole(replace(attr.getRole(), vars));
             nuattr.setRenderer(attr.getRenderer());
+            nuattr.setExpression(attr.getExpression());
 
             Object value = attr.getValue();
             if (value instanceof String) {

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/definition/digester/DigesterDefinitionsReader.java Wed Jan 14 05:38:06 2009
@@ -165,6 +165,7 @@
                 throws Exception {
             Attribute attribute = (Attribute) digester.peek();
             attribute.setValue(attributes.getValue("value"));
+            attribute.setExpression(attributes.getValue("expression"));
             attribute.setRole(attributes.getValue("role"));
             attribute.setRenderer(attributes.getValue("type"));
         }

Added: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/AbstractAttributeEvaluator.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/AbstractAttributeEvaluator.java?rev=734389&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/AbstractAttributeEvaluator.java (added)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/AbstractAttributeEvaluator.java Wed Jan 14 05:38:06 2009
@@ -0,0 +1,49 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.tiles.evaluator;
+
+import org.apache.tiles.Attribute;
+import org.apache.tiles.context.TilesRequestContext;
+
+/**
+ * Abstract class to link a correct evaluation of an attribute, by evaluating
+ * {@link Attribute#getValue()} and then {@link Attribute#getExpression()}.
+ *
+ * @version $Rev$ $Date$
+ * @since 2.1.2
+ */
+public abstract class AbstractAttributeEvaluator implements AttributeEvaluator {
+
+    /** {@inheritDoc} */
+    public Object evaluate(Attribute attribute, TilesRequestContext request) {
+        if (attribute == null) {
+            throw new IllegalArgumentException("The attribute cannot be null");
+        }
+
+        Object retValue = attribute.getValue();
+
+        if (retValue == null) {
+            retValue = evaluate(attribute.getExpression(), request);
+        }
+
+        return retValue;
+    }
+}

Propchange: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/AbstractAttributeEvaluator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/AbstractAttributeEvaluator.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/el/ELAttributeEvaluator.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/el/ELAttributeEvaluator.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/el/ELAttributeEvaluator.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/el/ELAttributeEvaluator.java Wed Jan 14 05:38:06 2009
@@ -32,11 +32,10 @@
 import javax.el.ResourceBundleELResolver;
 import javax.el.ValueExpression;
 
-import org.apache.tiles.Attribute;
 import org.apache.tiles.TilesApplicationContext;
 import org.apache.tiles.awareness.TilesApplicationContextAware;
 import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.evaluator.AttributeEvaluator;
+import org.apache.tiles.evaluator.AbstractAttributeEvaluator;
 import org.apache.tiles.reflect.ClassUtil;
 
 /**
@@ -48,7 +47,7 @@
  * @version $Rev$ $Date$
  * @since 2.1.0
  */
-public class ELAttributeEvaluator implements AttributeEvaluator,
+public class ELAttributeEvaluator extends AbstractAttributeEvaluator implements
         TilesApplicationContextAware {
 
     /**
@@ -154,20 +153,9 @@
         context.putContext(TilesRequestContext.class, request);
         context.putContext(TilesApplicationContext.class,
                 applicationContext);
-        ValueExpression valueExpression = expressionFactory.createValueExpression(
-                context, expression.toString(), Object.class);
+        ValueExpression valueExpression = expressionFactory
+                .createValueExpression(context, expression, Object.class);
 
         return valueExpression.getValue(context);
     }
-
-    /** {@inheritDoc} */
-    public Object evaluate(Attribute attribute, TilesRequestContext request) {
-        Object retValue = attribute.getValue();
-
-        if (retValue instanceof String) {
-            retValue = evaluate((String) retValue, request);
-        }
-
-        return retValue;
-    }
 }

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluator.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluator.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluator.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluator.java Wed Jan 14 05:38:06 2009
@@ -22,9 +22,8 @@
 
 import java.util.Map;
 
-import org.apache.tiles.Attribute;
 import org.apache.tiles.context.TilesRequestContext;
-import org.apache.tiles.evaluator.AttributeEvaluator;
+import org.apache.tiles.evaluator.AbstractAttributeEvaluator;
 
 /**
  * Resolves a string and returns the string itself. It is useful for backward
@@ -33,7 +32,7 @@
  * @version $Rev$ $Date$
  * @since 2.1.0
  */
-public class DirectAttributeEvaluator implements AttributeEvaluator {
+public class DirectAttributeEvaluator extends AbstractAttributeEvaluator {
 
     /** {@inheritDoc} */
     public void init(Map<String, String> initParameters) {
@@ -44,13 +43,4 @@
     public Object evaluate(String expression, TilesRequestContext request) {
         return expression;
     }
-
-    /** {@inheritDoc} */
-    public Object evaluate(Attribute attribute, TilesRequestContext request) {
-        if (attribute == null) {
-            throw new IllegalArgumentException("The attribute cannot be null");
-        }
-
-        return attribute.getValue();
-    }
 }

Modified: tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java (original)
+++ tiles/framework/trunk/tiles-core/src/main/java/org/apache/tiles/impl/BasicTilesContainer.java Wed Jan 14 05:38:06 2009
@@ -673,33 +673,53 @@
                 prepare(request, attributeContext.getPreparer(), true);
             }
 
-            String dispatchPath = attributeContext.getTemplate();
+            String dispatchPath = computeDispatchPath(request, attributeContext);
 
-            if (dispatchPath != null) {
-                Object value = evaluator.evaluate(dispatchPath, request);
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Dispatching to definition path '"
+                        + attributeContext.getTemplate() + " '");
+            }
+            request.dispatch(dispatchPath);
+        } catch (IOException e) {
+            throw new CannotRenderException(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * Calculates the dispatch path, that will be the path it will be dispatched to.
+     *
+     * @param request The Tiles request.
+     * @param attributeContext The Tiles attribute context.
+     * @return The calculated dispatch path.
+     * @throws InvalidTemplateException If the template is not valid.
+     */
+    private String computeDispatchPath(TilesRequestContext request,
+            AttributeContext attributeContext) {
+        String dispatchPath = attributeContext.getTemplate();
+
+        if (dispatchPath != null) {
+            return dispatchPath;
+        }
+
+        String expression = attributeContext.getTemplateExpression();
+        if (expression != null) {
+            Object value = evaluator.evaluate(expression, request);
+
+            if (value != null) {
                 if (value instanceof String) {
-                    dispatchPath = (String) value;
+                    return (String) value;
                 } else {
                     throw new InvalidTemplateException(
                             "Cannot render a template that is not an object: "
                                     + value.toString());
                 }
-            }
-
-            if (dispatchPath == null) {
+            } else {
                 throw new InvalidTemplateException(
-                        "Cannot render a null template");
-            }
-
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Dispatching to definition path '"
-                        + attributeContext.getTemplate() + " '");
+                "Cannot render a null template");
             }
-            request.dispatch(dispatchPath);
-
-            // tiles exception so that it doesn't need to be rethrown.
-        } catch (IOException e) {
-            throw new CannotRenderException(e.getMessage(), e);
+        } else {
+            throw new InvalidTemplateException(
+                    "No template or template expression has been specified");
         }
     }
 

Modified: tiles/framework/trunk/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_1.dtd
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_1.dtd?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_1.dtd (original)
+++ tiles/framework/trunk/tiles-core/src/main/resources/org/apache/tiles/resources/tiles-config_2_1.dtd Wed Jan 14 05:38:06 2009
@@ -125,6 +125,12 @@
                      containing appropriate attributes will be available.
 -->
 <!ATTLIST definition       template         %RequestPath;    #IMPLIED>
+<!--
+@attr expression     The expression that will evaluate to a template for this definition.
+					 This attribute will be ignored if template is specified.
+					 
+-->
+<!ATTLIST definition       templateExpression       CDATA    #IMPLIED>
 
 
 <!-- The "put-attribute" element describes an attribute of a definition. It allows to
@@ -150,6 +156,12 @@
 -->
 <!ATTLIST put-attribute     value            CDATA           #IMPLIED>
 <!--
+@attr expression     The expression associated to this tiles attribute. This
+					 attribute will be ignored if value is specified.
+					 
+-->
+<!ATTLIST put-attribute     expression       CDATA           #IMPLIED>
+<!--
 @attr role           Security role name that is allowed access to this attribute
                      object. The attribute is inserted only if the role name is
                      allowed.
@@ -212,6 +224,12 @@
 -->
 <!ATTLIST add-attribute              value            CDATA           #IMPLIED>
 <!--
+@attr expression     The expression associated to this tiles attribute. This
+					 attribute will be ignored if value is specified.
+					 
+-->
+<!ATTLIST add-attribute              expression       CDATA           #IMPLIED>
+<!--
 @attr role           Security role name that is allowed access to this attribute
                      object. The attribute will be added to the parent list
                      anyway. It is delegated to the user of this attribute to

Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/el/ELAttributeEvaluatorTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/el/ELAttributeEvaluatorTest.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/el/ELAttributeEvaluatorTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/el/ELAttributeEvaluatorTest.java Wed Jan 14 05:38:06 2009
@@ -82,33 +82,36 @@
      */
     public void testEvaluate() {
         Attribute attribute = new Attribute();
-        attribute.setValue("${requestScope.object1}");
+        attribute.setExpression("${requestScope.object1}");
         assertEquals("The value is not correct", "value", evaluator.evaluate(
                 attribute, request));
-        attribute.setValue("${sessionScope.object2}");
+        attribute.setExpression("${sessionScope.object2}");
         assertEquals("The value is not correct", new Integer(1), evaluator
                 .evaluate(attribute, request));
-        attribute.setValue("${applicationScope.object3}");
+        attribute.setExpression("${applicationScope.object3}");
         assertEquals("The value is not correct", new Float(2.0), evaluator
                 .evaluate(attribute, request));
-        attribute.setValue("${object1}");
+        attribute.setExpression("${object1}");
         assertEquals("The value is not correct", "value", evaluator.evaluate(
                 attribute, request));
-        attribute.setValue("${object2}");
+        attribute.setExpression("${object2}");
         assertEquals("The value is not correct", new Integer(1), evaluator
                 .evaluate(attribute, request));
-        attribute.setValue("${object3}");
+        attribute.setExpression("${object3}");
         assertEquals("The value is not correct", new Float(2.0), evaluator
                 .evaluate(attribute, request));
-        attribute.setValue("${paulaBean.paula}");
+        attribute.setExpression("${paulaBean.paula}");
         assertEquals("The value is not correct", "Brillant", evaluator
                 .evaluate(attribute, request));
-        attribute.setValue("String literal");
+        attribute.setExpression("String literal");
         assertEquals("The value is not correct", "String literal", evaluator
                 .evaluate(attribute, request));
         attribute.setValue(new Integer(2));
         assertEquals("The value is not correct", new Integer(2), evaluator
                 .evaluate(attribute, request));
+        attribute.setValue("${object1}");
+        assertEquals("The value has been evaluated", "${object1}", evaluator
+                .evaluate(attribute, request));
     }
 
     /**

Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluatorTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluatorTest.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluatorTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluatorTest.java Wed Jan 14 05:38:06 2009
@@ -47,12 +47,13 @@
      */
     public void testEvaluate() {
         String expression = "This is an expression";
-        Attribute attribute = new Attribute(expression);
+        Attribute attribute = new Attribute(null, expression, null,
+                (String) null);
         Object result = evaluator.evaluate(attribute, null);
         assertEquals("The expression has not been evaluated correctly", result,
                 expression);
         expression = "${attributeName}";
-        attribute.setValue(expression);
+        attribute.setExpression(expression);
         result = evaluator.evaluate(attribute, null);
         assertEquals("The expression has not been evaluated correctly", result,
                 expression);

Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java Wed Jan 14 05:38:06 2009
@@ -60,7 +60,7 @@
      */
     public void testWrite() throws IOException {
         StringWriter writer = new StringWriter();
-        Attribute attribute = new Attribute("my.definition", null, "definition");
+        Attribute attribute = new Attribute("my.definition", null, null, "definition");
         TilesApplicationContext applicationContext = EasyMock
                 .createMock(TilesApplicationContext.class);
         TilesRequestContextFactory contextFactory = EasyMock

Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/StringAttributeRendererTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/StringAttributeRendererTest.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/StringAttributeRendererTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/StringAttributeRendererTest.java Wed Jan 14 05:38:06 2009
@@ -59,7 +59,7 @@
      */
     public void testWrite() throws IOException {
         StringWriter writer = new StringWriter();
-        Attribute attribute = new Attribute("Result", null, "string");
+        Attribute attribute = new Attribute("Result", null, null, "string");
         TilesApplicationContext applicationContext = EasyMock
                 .createMock(TilesApplicationContext.class);
         TilesRequestContextFactory contextFactory = EasyMock

Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/TemplateAttributeRendererTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/TemplateAttributeRendererTest.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/TemplateAttributeRendererTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/TemplateAttributeRendererTest.java Wed Jan 14 05:38:06 2009
@@ -59,7 +59,7 @@
      */
     public void testWrite() throws IOException {
         StringWriter writer = new StringWriter();
-        Attribute attribute = new Attribute("/myTemplate.jsp", null, "template");
+        Attribute attribute = new Attribute("/myTemplate.jsp", null, null, "template");
         TilesApplicationContext applicationContext = EasyMock
                 .createMock(TilesApplicationContext.class);
         TilesRequestContextFactory contextFactory = EasyMock

Modified: tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/UntypedAttributeRendererTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/UntypedAttributeRendererTest.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/UntypedAttributeRendererTest.java (original)
+++ tiles/framework/trunk/tiles-core/src/test/java/org/apache/tiles/renderer/impl/UntypedAttributeRendererTest.java Wed Jan 14 05:38:06 2009
@@ -61,7 +61,7 @@
      */
     public void testWriteDefinition() throws IOException {
         StringWriter writer = new StringWriter();
-        Attribute attribute = new Attribute("my.definition", null, "definition");
+        Attribute attribute = new Attribute("my.definition", null, null, "definition");
         TilesApplicationContext applicationContext = EasyMock
                 .createMock(TilesApplicationContext.class);
         TilesRequestContextFactory contextFactory = EasyMock
@@ -92,7 +92,7 @@
      */
     public void testWriteString() throws IOException {
         StringWriter writer = new StringWriter();
-        Attribute attribute = new Attribute("Result", null, "string");
+        Attribute attribute = new Attribute("Result", null, null, "string");
         TilesApplicationContext applicationContext = EasyMock
                 .createMock(TilesApplicationContext.class);
         TilesRequestContextFactory contextFactory = EasyMock
@@ -122,7 +122,7 @@
      */
     public void testWriteTemplate() throws IOException {
         StringWriter writer = new StringWriter();
-        Attribute attribute = new Attribute("/myTemplate.jsp", null, "template");
+        Attribute attribute = new Attribute("/myTemplate.jsp", null, null, "template");
         TilesApplicationContext applicationContext = EasyMock
                 .createMock(TilesApplicationContext.class);
         TilesRequestContextFactory contextFactory = EasyMock

Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/AddListAttributeTag.java Wed Jan 14 05:38:06 2009
@@ -77,8 +77,8 @@
      * @param nestedTag the put tag desciendent.
      */
     public void processNestedTag(AddAttributeTag nestedTag) {
-        Attribute attribute = new Attribute(nestedTag.getValue(), nestedTag
-                .getRole(), nestedTag.getType());
+        Attribute attribute = new Attribute(nestedTag.getValue(), null, nestedTag
+                        .getRole(), nestedTag.getType());
 
         this.addValue(attribute);
     }

Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java Wed Jan 14 05:38:06 2009
@@ -270,7 +270,7 @@
                 attribute = (Attribute) defaultValue;
             } else if (defaultValue instanceof String) {
                 attribute = new Attribute(defaultValue,
-                        defaultValueRole, defaultValueType);
+                        null, defaultValueRole, defaultValueType);
             }
         }
         return attribute;

Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/PutListAttributeTag.java Wed Jan 14 05:38:06 2009
@@ -118,8 +118,8 @@
      * @param nestedTag the put tag desciendent.
      */
     public void processNestedTag(AddAttributeTag nestedTag) {
-        Attribute attribute = new Attribute(nestedTag.getValue(), nestedTag
-                .getRole(), nestedTag.getType());
+        Attribute attribute = new Attribute(nestedTag.getValue(), null, nestedTag
+                        .getRole(), nestedTag.getType());
 
         this.addValue(attribute);
     }

Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTag.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTag.java Wed Jan 14 05:38:06 2009
@@ -277,8 +277,8 @@
      */
     public void processNestedTag(PutAttributeTag nestedTag) {
         Attribute attribute = new Attribute(
-            nestedTag.getValue(), nestedTag.getRole(),
-            nestedTag.getType());
+            nestedTag.getValue(), null,
+            nestedTag.getRole(), nestedTag.getType());
 
         attributeContext.putAttribute(nestedTag.getName(), attribute, nestedTag
                 .isCascade());

Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/definition/DefinitionTag.java Wed Jan 14 05:38:06 2009
@@ -222,7 +222,7 @@
      */
     public void processNestedTag(PutAttributeTag nestedTag) throws TilesJspException {
         Attribute attr = new Attribute(nestedTag.getValue(),
-            nestedTag.getRole(), nestedTag.getType());
+            null, nestedTag.getRole(), nestedTag.getType());
         definition.putAttribute(nestedTag.getName(), attr, nestedTag
                 .isCascade());
     }

Modified: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/RequestSettingViewPreparer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/RequestSettingViewPreparer.java?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/RequestSettingViewPreparer.java (original)
+++ tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/preparer/RequestSettingViewPreparer.java Wed Jan 14 05:38:06 2009
@@ -20,6 +20,8 @@
  */
 package org.apache.tiles.test.preparer;
 
+import java.util.Map;
+
 import org.apache.tiles.preparer.ViewPreparer;
 import org.apache.tiles.context.TilesRequestContext;
 import org.apache.tiles.AttributeContext;
@@ -35,7 +37,10 @@
     /** {@inheritDoc} */
     public void execute(TilesRequestContext tilesContext,
             AttributeContext attributeContext) {
-        tilesContext.getRequestScope().put("body", "test.inner.definition");
-        tilesContext.getRequestScope().put("layout", "/layout.jsp");
+        Map<String, Object> requestScope = tilesContext.getRequestScope();
+        requestScope.put("body", "test.inner.definition");
+        requestScope.put("layout", "/layout.jsp");
+        requestScope.put("doNotShow", "DO NOT SHOW!!!");
+        requestScope.put("doNotShowBody", "${requestScope.doNotShow}");
     }
 }

Modified: tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs.xml
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs.xml?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs.xml (original)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/WEB-INF/tiles-defs.xml Wed Jan 14 05:38:06 2009
@@ -220,11 +220,18 @@
       </put-list-attribute>
   </definition>
 
-  <definition name="test.composite.el.definition" template="${layout}"
+  <definition name="test.composite.el.definition" templateExpression="${layout}"
         preparer="org.apache.tiles.test.preparer.RequestSettingViewPreparer">
       <put-attribute name="title"  value="This is a configured composite definition."/>
       <put-attribute name="header" value="/header.jsp"/>
-      <put-attribute name="body"   value="${requestScope.body}"/>
+      <put-attribute name="body"   expression="${requestScope.body}"/>
+  </definition>
+
+  <definition name="test.composite.el.doNotShow.definition" templateExpression="${layout}"
+        preparer="org.apache.tiles.test.preparer.RequestSettingViewPreparer">
+      <put-attribute name="title"  value="This is a configured definition."/>
+      <put-attribute name="header" value="/header.jsp"/>
+      <put-attribute name="body"   expression="${requestScope.doNotShowBody}"/>
   </definition>
 
   <definition name="test.definition.attribute.preparer" template="/layout_preparer.jsp">

Modified: tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp (original)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp Wed Jan 14 05:38:06 2009
@@ -46,7 +46,6 @@
     <a href="testinsertdefinition_exception.jsp">Test Insert Configured Definition with an exception in an attribute page</a><br/>
     <a href="testinsertdefinition_freemarker.jsp">Test Insert Configured Definition with FreeMarker</a><br/>
     <a href="testinsertdefinition_openbody.jsp">Test Insert Configured Definition with Open Body</a><br/>
-    <a href="testinsertdefinition_defaultvalues.jsp">Test Insert Configured Definition with Default Values</a><br/>
     <a href="testput.jsp">Test Put Tag</a><br/>
     <a href="testput_flush.jsp">Test Put Tag with Flush</a><br/>
     <a href="testput_el.jsp">Test Put Tag using EL</a><br/>
@@ -90,10 +89,13 @@
     <a href="testinsertnestedlistdefinition.jsp">Test Insert Nested List Definition</a><br/>
     <a href="testinsertnestedlistdefinition_tags.jsp">Test Insert Nested List Definition only using JSP tags</a><br/>
     <a href="testinsertdefinition_el.jsp">Test Insert Configured Definition with EL</a><br/>
+    <a href="testinsertdefinition_el_singleeval.jsp">Test Insert Configured Definition with EL to test Single Evaluation</a><br/>
     <a href="testinsertdefinition_wildcard.jsp">Test Insert Configured Definition with Wildcards</a><br/>
+    <a href="testinsertdefinition_defaultvalues.jsp">Test Insert Configured Definition with Default Values</a><br/>
     <a href="testput_cascaded.jsp">Test Put Tag with Cascaded Attributes</a><br/>
     <a href="testput_cascaded_overridden.jsp">Test Put Tag with Overridden Cascaded Attributes</a><br/>
     <a href="testput_cascaded_template.jsp">Test Put Tag with Cascaded Attributes and Template</a><br/>
+    <a href="testput_el_singleeval.jsp">Test Put Tag using EL to test Single Evaluation</a><br/>
     <a href="testput_reversed.jsp">Test Put Tag with Reversed Attribute</a><br/>
     <a href="testput_reversed_explicit.jsp">Test Put Tag with Reversed Explicit Attribute</a><br/>
     <a href="testputlist_cascaded.jsp">Test Put List Cascaded Tag</a><br/>

Added: tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_el_singleeval.jsp
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_el_singleeval.jsp?rev=734389&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_el_singleeval.jsp (added)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_el_singleeval.jsp Wed Jan 14 05:38:06 2009
@@ -0,0 +1,27 @@
+<%@ page session="false" %>
+<%--
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *
+ */
+--%>
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+
+<tiles:insertDefinition name="test.composite.el.doNotShow.definition" />

Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_el_singleeval.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_el_singleeval.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/framework/trunk/tiles-test/src/main/webapp/testput_el.jsp
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/testput_el.jsp?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/testput_el.jsp (original)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/testput_el.jsp Wed Jan 14 05:38:06 2009
@@ -27,7 +27,7 @@
 
 <c:set var="bodyContent" value="Body Content defined by and el" />
 
-<tiles:insertTemplate template="/layout.jsp">
+<tiles:insertTemplate template="/layout.jsp" preparer="org.apache.tiles.test.preparer.RequestSettingViewPreparer">
   <tiles:putAttribute name="title"  value="This is the title." />
   <tiles:putAttribute name="header" value="/header.jsp" />
   <tiles:putAttribute name="body"   value="${bodyContent}" />

Added: tiles/framework/trunk/tiles-test/src/main/webapp/testput_el_singleeval.jsp
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/testput_el_singleeval.jsp?rev=734389&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/testput_el_singleeval.jsp (added)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/testput_el_singleeval.jsp Wed Jan 14 05:38:06 2009
@@ -0,0 +1,34 @@
+<%@ page session="false" %>
+<%--
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ *
+ */
+--%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+
+<c:set var="doNotShowBody" value="${'${'}requestScope.doNotShow}" />
+
+<tiles:insertTemplate template="/layout.jsp">
+  <tiles:putAttribute name="title"  value="This is the title." />
+  <tiles:putAttribute name="header" value="/header.jsp" />
+  <tiles:putAttribute name="body"   value="${doNotShowBody}" />
+</tiles:insertTemplate>
\ No newline at end of file

Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/testput_el_singleeval.jsp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/testput_el_singleeval.jsp
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionELSingleEvalTest.html
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionELSingleEvalTest.html?rev=734389&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionELSingleEvalTest.html (added)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionELSingleEvalTest.html Wed Jan 14 05:38:06 2009
@@ -0,0 +1,61 @@
+<!--
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Configured Definition EL with Single Evaluation Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Configured Definition EL with Single Evaluation Test</td></tr>
+</thead><tbody>
+<tr>
+	<td>open</td>
+	<td>/tiles-test/index.jsp</td>
+	<td></td>
+</tr>
+<tr>
+	<td>clickAndWait</td>
+	<td>link=Test Insert Configured Definition with EL to test Single Evaluation</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertTextPresent</td>
+	<td>This is a configured definition.</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertTextPresent</td>
+	<td>This is the header</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertTextPresent</td>
+	<td>${requestScope.doNotShow}</td>
+	<td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>

Propchange: tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionELSingleEvalTest.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionELSingleEvalTest.html
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Added: tiles/framework/trunk/tiles-test/src/test/selenium/PutTagWithELSingleEvalTest.html
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/PutTagWithELSingleEvalTest.html?rev=734389&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/PutTagWithELSingleEvalTest.html (added)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/PutTagWithELSingleEvalTest.html Wed Jan 14 05:38:06 2009
@@ -0,0 +1,61 @@
+<!--
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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.
+ */
+-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Put Tag using EL with Single Evaluation Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Put Tag using EL with Single Evaluation Test</td></tr>
+</thead><tbody>
+<tr>
+	<td>open</td>
+	<td>/tiles-test/index.jsp</td>
+	<td></td>
+</tr>
+<tr>
+	<td>clickAndWait</td>
+	<td>link=Test Put Tag using EL to test Single Evaluation</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertTextPresent</td>
+	<td>This is the title.</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertTextPresent</td>
+	<td>This is the header</td>
+	<td></td>
+</tr>
+<tr>
+	<td>assertTextPresent</td>
+	<td>${requestScope.doNotShow}</td>
+	<td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>

Propchange: tiles/framework/trunk/tiles-test/src/test/selenium/PutTagWithELSingleEvalTest.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-test/src/test/selenium/PutTagWithELSingleEvalTest.html
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html?rev=734389&r1=734388&r2=734389&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html (original)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html Wed Jan 14 05:38:06 2009
@@ -103,6 +103,9 @@
         <td><a href="ConfiguredDefinitionELTest.html">Configured Definition EL Test</a></td>
     </tr>
     <tr>
+        <td><a href="ConfiguredDefinitionELSingleEvalTest.html">Configured Definition EL with Single Evaluation Test</a></td>
+    </tr>
+    <tr>
         <td><a href="ConfiguredDefinitionOpenBodyTest.html">Configured Definition with Open Body Test</a></td>
     </tr>
     <tr>
@@ -121,6 +124,9 @@
         <td><a href="PutTagWithELTest.html">Put Tag using EL Test</a></td>
     </tr>
     <tr>
+        <td><a href="PutTagWithELSingleEvalTest.html">Put Tag using EL with Single Evaluation Test</a></td>
+    </tr>
+    <tr>
         <td><a href="PutTagWithServletTest.html">Put Tag with Servlet as Template Test</a></td>
     </tr>
     <tr>