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/21 10:58:24 UTC

svn commit: r736275 [2/2] - in /tiles/framework/trunk: tiles-api/src/main/java/org/apache/tiles/ tiles-api/src/test/java/org/apache/tiles/ tiles-compat/src/main/java/org/apache/tiles/compat/definition/digester/ tiles-core/src/main/java/org/apache/tiles...

Added: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspPrintWriterAdapter.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspPrintWriterAdapter.java?rev=736275&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspPrintWriterAdapter.java (added)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspPrintWriterAdapter.java Wed Jan 21 01:58:20 2009
@@ -0,0 +1,391 @@
+/*
+ * $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.jsp.context;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.jsp.JspWriter;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * Adapts a {@link JspWriter} to a {@link PrintWriter}, swallowing {@link IOException}.
+ *
+ * @version $Rev$ $Date$
+ * @since 2.1.2
+ */
+public class JspPrintWriterAdapter extends PrintWriter {
+
+    /**
+     * The JSP writer.
+     */
+    private JspWriter writer;
+
+    /**
+     * The logging object.
+     */
+    private Log log = LogFactory.getLog(this.getClass());
+
+    /**
+     * Constructor.
+     *
+     * @param writer The JSP writer.
+     * @since 2.1.2
+     */
+    public JspPrintWriterAdapter(JspWriter writer) {
+        super(writer);
+        this.writer = writer;
+    }
+
+    /**
+     * Returns the original JSP writer.
+     *
+     * @return The JSP writer.
+     * @since 2.1.2
+     */
+    public JspWriter getJspWriter() {
+        return writer;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public PrintWriter append(char c) {
+        try {
+            writer.append(c);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public PrintWriter append(CharSequence csq, int start, int end) {
+        try {
+            writer.append(csq, start, end);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public PrintWriter append(CharSequence csq) {
+        try {
+            writer.append(csq);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+        return this;
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void close() {
+        try {
+            writer.close();
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void flush() {
+        try {
+            writer.flush();
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void print(boolean b) {
+        try {
+            writer.print(b);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void print(char c) {
+        try {
+            writer.print(c);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void print(char[] s) {
+        try {
+            writer.print(s);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void print(double d) {
+        try {
+            writer.print(d);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void print(float f) {
+        try {
+            writer.print(f);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void print(int i) {
+        try {
+            writer.print(i);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void print(long l) {
+        try {
+            writer.print(l);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void print(Object obj) {
+        try {
+            writer.print(obj);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void print(String s) {
+        try {
+            writer.print(s);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void println() {
+        try {
+            writer.println();
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void println(boolean x) {
+        try {
+            writer.println(x);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void println(char x) {
+        try {
+            writer.println(x);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void println(char[] x) {
+        try {
+            writer.println(x);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void println(double x) {
+        try {
+            writer.println(x);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void println(float x) {
+        try {
+            writer.println(x);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void println(int x) {
+        try {
+            writer.println(x);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void println(long x) {
+        try {
+            writer.println(x);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void println(Object x) {
+        try {
+            writer.println(x);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void println(String x) {
+        try {
+            writer.println(x);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void write(char[] buf, int off, int len) {
+        try {
+            writer.write(buf, off, len);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void write(char[] buf) {
+        try {
+            writer.write(buf);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void write(int c) {
+        try {
+            writer.write(c);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void write(String s, int off, int len) {
+        try {
+            writer.write(s, off, len);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public void write(String s) {
+        try {
+            writer.write(s);
+        } catch (IOException e) {
+            log.error("Error when writing in JspWriter", e);
+            setError();
+        }
+    }
+}

Propchange: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspPrintWriterAdapter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspPrintWriterAdapter.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspTilesRequestContext.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspTilesRequestContext.java?rev=736275&r1=736274&r2=736275&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspTilesRequestContext.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspTilesRequestContext.java Wed Jan 21 01:58:20 2009
@@ -31,6 +31,8 @@
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.jsp.PageContext;
 import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.Writer;
 
 /**
  * Context implementation used for executing tiles within a
@@ -52,6 +54,11 @@
     private JspWriterResponse response;
 
     /**
+     * The request objects, lazily initialized.
+     */
+    private Object[] requestObjects;
+
+    /**
      * Constructor.
      *
      * @param enclosedRequest The request that is wrapped here.
@@ -101,6 +108,44 @@
     }
 
     /** {@inheritDoc} */
+    @Override
+    public PrintWriter getPrintWriter() throws IOException {
+        return new JspPrintWriterAdapter(pageContext.getOut());
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public Writer getWriter() throws IOException {
+        return pageContext.getOut();
+    }
+
+    /** {@inheritDoc} */
+    @Override
+    public Object[] getRequestObjects() {
+        if (requestObjects == null) {
+            requestObjects = new Object[1];
+            requestObjects[0] = pageContext;
+        }
+        return requestObjects;
+    }
+
+    /**
+     * Returns the page context that originated the request.
+     *
+     * @return The page context.
+     */
+    public PageContext getPageContext() {
+        return pageContext;
+    }
+
+    /**
+     * Returns the response object, obtained by the JSP page context. The print
+     * writer will use the object obtained by {@link PageContext#getOut()}.
+     *
+     * @return The response object.
+     * @deprecated Use {@link #getPageContext()} or {@link #getPrintWriter()}.
+     */
+    @Deprecated
     public HttpServletResponse getResponse() {
         if (response == null) {
             response = new JspWriterResponse(pageContext);

Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspWriterResponse.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspWriterResponse.java?rev=736275&r1=736274&r2=736275&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspWriterResponse.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/context/JspWriterResponse.java Wed Jan 21 01:58:20 2009
@@ -59,7 +59,7 @@
     /** {@inheritDoc} */
     public PrintWriter getWriter() throws IOException {
         if (writer == null) {
-            writer = new PrintWriter(context.getOut());
+            writer = new JspPrintWriterAdapter(context.getOut());
         }
         return writer;
     }

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=736275&r1=736274&r2=736275&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 21 01:58:20 2009
@@ -231,7 +231,7 @@
      * definition files.
      */
     protected void render(Attribute attr) throws IOException {
-        container.render(attr, pageContext.getOut(), pageContext);
+        container.render(attr, pageContext);
     }
 
     /**

Modified: tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java?rev=736275&r1=736274&r2=736275&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java (original)
+++ tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertTemplateTag.java Wed Jan 21 01:58:20 2009
@@ -23,6 +23,7 @@
 
 import java.io.IOException;
 
+import org.apache.tiles.Attribute;
 import org.apache.tiles.jsp.context.JspUtil;
 
 /**
@@ -72,9 +73,11 @@
     /** {@inheritDoc} */
     @Override
     protected void render() throws IOException {
-        attributeContext.setTemplate(template);
+        Attribute templateAttribute = Attribute
+                .createTemplateAttribute(template);
+        templateAttribute.setRole(role);
         attributeContext.setPreparer(preparer);
-        attributeContext.setRole(role);
+        attributeContext.setTemplateAttribute(templateAttribute);
         renderContext();
     }
 

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=736275&r1=736274&r2=736275&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 21 01:58:20 2009
@@ -186,9 +186,11 @@
     public int doStartTag() throws TilesJspException {
         definition = new Definition();
         definition.setName(name);
-        definition.setTemplate(template);
+        Attribute templateAttribute = Attribute
+                .createTemplateAttribute(template);
+        templateAttribute.setRole(role);
+        definition.setTemplateAttribute(templateAttribute);
         definition.setExtends(extend);
-        definition.setRole(role);
         definition.setPreparer(preparer);
 
         TilesContainer c = JspUtil.getCurrentContainer(pageContext);

Added: tiles/framework/trunk/tiles-jsp/src/test/java/org/apache/tiles/jsp/context/JspPrintWriterAdapterTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/test/java/org/apache/tiles/jsp/context/JspPrintWriterAdapterTest.java?rev=736275&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-jsp/src/test/java/org/apache/tiles/jsp/context/JspPrintWriterAdapterTest.java (added)
+++ tiles/framework/trunk/tiles-jsp/src/test/java/org/apache/tiles/jsp/context/JspPrintWriterAdapterTest.java Wed Jan 21 01:58:20 2009
@@ -0,0 +1,469 @@
+/*
+ * $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.jsp.context;
+
+import java.io.IOException;
+
+import javax.servlet.jsp.JspWriter;
+
+import org.easymock.classextension.EasyMock;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests {@link JspPrintWriterAdapter}.
+ *
+ * @version $Rev$ $Date$
+ */
+public class JspPrintWriterAdapterTest extends TestCase {
+
+    /**
+     * The string length.
+     */
+    private static final int STRING_LENGTH = 10;
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#write(int)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testWriteInt() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.write(1);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.write(1);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#write(char[])}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testWriteCharArray() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        String result = "this is a test";
+        writer.write(EasyMock.aryEq(result.toCharArray()));
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.write(result.toCharArray());
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#write(char[], int, int)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testWriteCharArrayIntInt() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        String result = "this is a test";
+        writer.write(EasyMock.aryEq(result.toCharArray()), EasyMock.eq(0),
+                EasyMock.eq(STRING_LENGTH));
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.write(result.toCharArray(), 0, STRING_LENGTH);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#flush()}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testFlush() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.flush();
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.flush();
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#close()}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testClose() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.close();
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.close();
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#print(boolean)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintBoolean() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.print(true);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.print(true);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#print(char)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintChar() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.print('c');
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.print('c');
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#print(int)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintInt() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.print(1);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.print(1);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#print(long)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintLong() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.print(1L);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.print(1L);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#print(float)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintFloat() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.print(1f);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.print(1f);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#print(double)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintDouble() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.print(1d);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.print(1d);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#print(char[])}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintCharArray() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        String result = "this is a test";
+        writer.print(EasyMock.aryEq(result.toCharArray()));
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.print(result.toCharArray());
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#println()}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintln() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.println();
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.println();
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#println(boolean)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintlnBoolean() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.println(true);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.println(true);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#println(char)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintlnChar() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.println('c');
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.println('c');
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#println(int)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintlnInt() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.println(1);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.println(1);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#println(long)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintlnLong() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.println(1L);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.println(1L);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#println(float)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintlnFloat() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.println(1f);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.println(1f);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#println(double)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintlnDouble() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.println(1d);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.println(1d);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#println(char[])}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintlnCharArray() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        String result = "this is a test";
+        writer.println(EasyMock.aryEq(result.toCharArray()));
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.println(result.toCharArray());
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#getJspWriter()}.
+     */
+    public void testGetJspWriter() {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        assertEquals(writer, adapter.getJspWriter());
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#append(char)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testAppendChar() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        EasyMock.expect(writer.append('c')).andReturn(writer);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        assertEquals(adapter, adapter.append('c'));
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for
+     * {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#append(java.lang.CharSequence, int, int)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testAppendCharSequenceIntInt() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        CharSequence sequence = EasyMock.createMock(CharSequence.class);
+        EasyMock.expect(writer.append(sequence, 0, STRING_LENGTH)).andReturn(writer);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        assertEquals(adapter, adapter.append(sequence, 0, STRING_LENGTH));
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#append(java.lang.CharSequence)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testAppendCharSequence() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        CharSequence sequence = EasyMock.createMock(CharSequence.class);
+        EasyMock.expect(writer.append(sequence)).andReturn(writer);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        assertEquals(adapter, adapter.append(sequence));
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#print(java.lang.Object)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintObject() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        Object obj = EasyMock.createMock(Object.class);
+        writer.print(obj);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.print(obj);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#print(java.lang.String)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintString() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.print("this is a string");
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.print("this is a string");
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#println(java.lang.Object)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintlnObject() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        Object obj = EasyMock.createMock(Object.class);
+        writer.println(obj);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.println(obj);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#println(java.lang.String)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testPrintlnString() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        writer.println("this is a string");
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.println("this is a string");
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#write(java.lang.String, int, int)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testWriteStringIntInt() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        String result = "this is a test";
+        writer.write(result, 0, STRING_LENGTH);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.write(result, 0, STRING_LENGTH);
+        EasyMock.verify(writer);
+    }
+
+    /**
+     * Test method for {@link org.apache.tiles.jsp.context.JspPrintWriterAdapter#write(java.lang.String)}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testWriteString() throws IOException {
+        JspWriter writer = EasyMock.createMock(JspWriter.class);
+        String result = "this is a test";
+        writer.write(result);
+        JspPrintWriterAdapter adapter = new JspPrintWriterAdapter(writer);
+        EasyMock.replay(writer);
+        adapter.write(result);
+        EasyMock.verify(writer);
+    }
+}

Propchange: tiles/framework/trunk/tiles-jsp/src/test/java/org/apache/tiles/jsp/context/JspPrintWriterAdapterTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-jsp/src/test/java/org/apache/tiles/jsp/context/JspPrintWriterAdapterTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/framework/trunk/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletTilesRequestContext.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletTilesRequestContext.java?rev=736275&r1=736274&r2=736275&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletTilesRequestContext.java (original)
+++ tiles/framework/trunk/tiles-portlet/src/main/java/org/apache/tiles/portlet/context/PortletTilesRequestContext.java Wed Jan 21 01:58:20 2009
@@ -21,6 +21,9 @@
 package org.apache.tiles.portlet.context;
 
 import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.Writer;
 import java.util.Collections;
 import java.util.Locale;
 import java.util.Map;
@@ -84,6 +87,11 @@
 
 
     /**
+     * The request objects, lazily initialized.
+     */
+    private Object[] requestObjects;
+
+    /**
      * <p>The lazily instantiated <code>Map</code> of session scope
      * attributes.</p>
      */
@@ -287,6 +295,31 @@
     }
 
     /** {@inheritDoc} */
+    public OutputStream getOutputStream() throws IOException {
+        return ((RenderResponse) response).getPortletOutputStream();
+    }
+
+    /** {@inheritDoc} */
+    public PrintWriter getPrintWriter() throws IOException {
+        return ((RenderResponse) response).getWriter();
+    }
+
+    /** {@inheritDoc} */
+    public Writer getWriter() throws IOException {
+        return ((RenderResponse) response).getWriter();
+    }
+
+    /** {@inheritDoc} */
+    public Object[] getRequestObjects() {
+        if (requestObjects == null) {
+            requestObjects = new Object[2];
+            requestObjects[0] = request;
+            requestObjects[1] = response;
+        }
+        return requestObjects;
+    }
+
+    /** {@inheritDoc} */
     public Locale getRequestLocale() {
         if (request != null) {
             return request.getLocale();

Modified: tiles/framework/trunk/tiles-servlet/pom.xml
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-servlet/pom.xml?rev=736275&r1=736274&r2=736275&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-servlet/pom.xml (original)
+++ tiles/framework/trunk/tiles-servlet/pom.xml Wed Jan 21 01:58:20 2009
@@ -165,6 +165,13 @@
     </dependency>
 
     <dependency>
+      <groupId>org.easymock</groupId>
+      <artifactId>easymockclassextension</artifactId>
+      <version>2.3</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
       <groupId>org.apache.shale</groupId>
       <artifactId>shale-test</artifactId>
       <version>1.0.4</version>

Modified: tiles/framework/trunk/tiles-servlet/src/main/java/org/apache/tiles/servlet/context/ServletTilesRequestContext.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-servlet/src/main/java/org/apache/tiles/servlet/context/ServletTilesRequestContext.java?rev=736275&r1=736274&r2=736275&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-servlet/src/main/java/org/apache/tiles/servlet/context/ServletTilesRequestContext.java (original)
+++ tiles/framework/trunk/tiles-servlet/src/main/java/org/apache/tiles/servlet/context/ServletTilesRequestContext.java Wed Jan 21 01:58:20 2009
@@ -21,6 +21,9 @@
 package org.apache.tiles.servlet.context;
 
 import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.Writer;
 import java.util.Locale;
 import java.util.Map;
 
@@ -53,6 +56,21 @@
     private HttpServletResponse response;
 
     /**
+     * The request objects, lazily initialized.
+     */
+    private Object[] requestObjects;
+
+    /**
+     * The response output stream, lazily initialized.
+     */
+    private OutputStream outputStream;
+
+    /**
+     * The response writer, lazily initialized.
+     */
+    private PrintWriter writer;
+
+    /**
      * <p>The lazily instantiated <code>Map</code> of header name-value
      * combinations (immutable).</p>
      */
@@ -247,11 +265,42 @@
     }
 
     /** {@inheritDoc} */
+    public OutputStream getOutputStream() throws IOException {
+        if (outputStream == null) {
+            outputStream = response.getOutputStream();
+        }
+        return outputStream;
+    }
+
+    /** {@inheritDoc} */
+    public Writer getWriter() throws IOException {
+        return getPrintWriter();
+    }
+
+    /** {@inheritDoc} */
+    public PrintWriter getPrintWriter() throws IOException {
+        if (writer == null) {
+            writer = response.getWriter();
+        }
+        return writer;
+    }
+
+    /** {@inheritDoc} */
     public Locale getRequestLocale() {
         return request.getLocale();
     }
 
     /** {@inheritDoc} */
+    public Object[] getRequestObjects() {
+        if (requestObjects == null) {
+            requestObjects = new Object[2];
+            requestObjects[0] = request;
+            requestObjects[1] = response;
+        }
+        return requestObjects;
+    }
+
+    /** {@inheritDoc} */
     public HttpServletRequest getRequest() {
         return request;
     }

Modified: tiles/framework/trunk/tiles-servlet/src/test/java/org/apache/tiles/servlet/context/ServletTilesRequestContextTest.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-servlet/src/test/java/org/apache/tiles/servlet/context/ServletTilesRequestContextTest.java?rev=736275&r1=736274&r2=736275&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-servlet/src/test/java/org/apache/tiles/servlet/context/ServletTilesRequestContextTest.java (original)
+++ tiles/framework/trunk/tiles-servlet/src/test/java/org/apache/tiles/servlet/context/ServletTilesRequestContextTest.java Wed Jan 21 01:58:20 2009
@@ -22,21 +22,23 @@
 package org.apache.tiles.servlet.context;
 
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.servlet.ServletOutputStream;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import junit.framework.TestCase;
+
 import org.apache.shale.test.mock.MockHttpServletRequest;
 import org.apache.shale.test.mock.MockHttpServletResponse;
 import org.apache.shale.test.mock.MockHttpSession;
 import org.apache.shale.test.mock.MockServletContext;
 import org.apache.tiles.TilesApplicationContext;
 import org.apache.tiles.context.TilesRequestContext;
-import org.easymock.EasyMock;
-
-import junit.framework.TestCase;
+import org.easymock.classextension.EasyMock;
 
 /**
  * @version $Rev$ $Date$
@@ -203,6 +205,69 @@
     }
 
     /**
+     * Tests {@link ServletTilesRequestContext#getOutputStream()}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testGetOutputStream() throws IOException {
+        HttpServletRequest request = EasyMock
+                .createMock(HttpServletRequest.class);
+        HttpServletResponse response = EasyMock
+                .createMock(HttpServletResponse.class);
+        TilesApplicationContext applicationContext = EasyMock
+                .createMock(TilesApplicationContext.class);
+        ServletOutputStream os = EasyMock.createMock(ServletOutputStream.class);
+        EasyMock.expect(response.getOutputStream()).andReturn(os);
+        EasyMock.replay(request, response, applicationContext, os);
+        ServletTilesRequestContext requestContext = new ServletTilesRequestContext(
+                applicationContext, request, response);
+        assertEquals(os, requestContext.getOutputStream());
+        EasyMock.verify(request, response, applicationContext, os);
+    }
+
+    /**
+     * Tests {@link ServletTilesRequestContext#getWriter()}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testGetWriter() throws IOException {
+        HttpServletRequest request = EasyMock
+                .createMock(HttpServletRequest.class);
+        HttpServletResponse response = EasyMock
+                .createMock(HttpServletResponse.class);
+        TilesApplicationContext applicationContext = EasyMock
+                .createMock(TilesApplicationContext.class);
+        PrintWriter writer = EasyMock.createMock(PrintWriter.class);
+        EasyMock.expect(response.getWriter()).andReturn(writer);
+        EasyMock.replay(request, response, applicationContext, writer);
+        ServletTilesRequestContext requestContext = new ServletTilesRequestContext(
+                applicationContext, request, response);
+        assertEquals(writer, requestContext.getWriter());
+        EasyMock.verify(request, response, applicationContext, writer);
+    }
+
+    /**
+     * Tests {@link ServletTilesRequestContext#getPrintWriter()}.
+     *
+     * @throws IOException If something goes wrong.
+     */
+    public void testGetPrintWriter() throws IOException {
+        HttpServletRequest request = EasyMock
+                .createMock(HttpServletRequest.class);
+        HttpServletResponse response = EasyMock
+                .createMock(HttpServletResponse.class);
+        TilesApplicationContext applicationContext = EasyMock
+                .createMock(TilesApplicationContext.class);
+        PrintWriter writer = EasyMock.createMock(PrintWriter.class);
+        EasyMock.expect(response.getWriter()).andReturn(writer);
+        EasyMock.replay(request, response, applicationContext, writer);
+        ServletTilesRequestContext requestContext = new ServletTilesRequestContext(
+                applicationContext, request, response);
+        assertEquals(writer, requestContext.getPrintWriter());
+        EasyMock.verify(request, response, applicationContext, writer);
+    }
+
+    /**
      * Tests the forced inclusion in the request.
      *
      * @throws IOException If something goes wrong.

Modified: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/definition/dao/LocaleDbDefinitionDAO.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/definition/dao/LocaleDbDefinitionDAO.java?rev=736275&r1=736274&r2=736275&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/definition/dao/LocaleDbDefinitionDAO.java (original)
+++ tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/definition/dao/LocaleDbDefinitionDAO.java Wed Jan 21 01:58:20 2009
@@ -200,7 +200,7 @@
          */
         public DbDefinition(String name, String template,
                 Map<String, Attribute> attributes) {
-            super(name, template, attributes);
+            super(name, Attribute.createTemplateAttribute(template), attributes);
         }
 
         /**
@@ -233,7 +233,8 @@
             DbDefinition definition = new DbDefinition();
             definition.setId(numberToLong((Number) rs.getObject("ID")));
             definition.setName(rs.getString("NAME"));
-            definition.setTemplate(rs.getString("TEMPLATE"));
+            definition.setTemplateAttribute(Attribute
+                    .createTemplateAttribute(rs.getString("TEMPLATE")));
             definition.setPreparer(rs.getString("PREPARER"));
             definition.setExtends(rs.getString("PARENT_NAME"));
             return definition;

Added: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/listener/package.html
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/listener/package.html?rev=736275&view=auto
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/listener/package.html (added)
+++ tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/listener/package.html Wed Jan 21 01:58:20 2009
@@ -0,0 +1,30 @@
+<!--
+/*
+ * $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>
+    <title>Listeners for Tiles initialization.</title>
+</head>
+<body>
+These listeners are used to initialize Tiles.
+</body>
+</html>
\ No newline at end of file

Propchange: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/listener/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/listener/package.html
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Modified: tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/renderer/ReverseStringAttributeRenderer.java
URL: http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/renderer/ReverseStringAttributeRenderer.java?rev=736275&r1=736274&r2=736275&view=diff
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/renderer/ReverseStringAttributeRenderer.java (original)
+++ tiles/framework/trunk/tiles-test/src/main/java/org/apache/tiles/test/renderer/ReverseStringAttributeRenderer.java Wed Jan 21 01:58:20 2009
@@ -21,7 +21,6 @@
 package org.apache.tiles.test.renderer;
 
 import java.io.IOException;
-import java.io.Writer;
 
 import org.apache.tiles.Attribute;
 import org.apache.tiles.context.TilesRequestContext;
@@ -37,7 +36,7 @@
     /** {@inheritDoc} */
     @Override
     public void write(Object value, Attribute attribute,
-            Writer writer, TilesRequestContext request, Object... requestItems)
+            TilesRequestContext request)
             throws IOException {
         String original = attribute.getValue().toString();
         char[] array = original.toCharArray();
@@ -45,6 +44,6 @@
         for (int i = 0; i < array.length; i++) {
             newArray[array.length - i - 1] = array[i];
         }
-        writer.write(String.valueOf(newArray));
+        request.getWriter().write(String.valueOf(newArray));
     }
 }