Author: apetrelli
Date: Mon Jul 2 03:51:45 2007
New Revision: 552462
URL: http://svn.apache.org/viewvc?view=rev&rev=552462
Log:
TILES-192
Added support to the "flush" attribute in JSP tags that extend RenderTagSupport.
Added Selenium tests.
Added:
tiles/framework/trunk/tiles-test/src/main/webapp/layout_flush.jsp (with
props)
tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_flush.jsp
(with props)
tiles/framework/trunk/tiles-test/src/main/webapp/testput_flush.jsp (with
props)
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionFlushTest.html
(with props)
tiles/framework/trunk/tiles-test/src/test/selenium/PutTagFlushTest.html
(with props)
Modified:
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.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/test/selenium/TestSuite.html
Modified:
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java?view=diff&rev=552462&r1=552461&r2=552462
==============================================================================
---
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java
(original)
+++
tiles/framework/trunk/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/RenderTagSupport.java
Mon Jul 2 03:51:45 2007
@@ -169,6 +169,9 @@
container.prepare(preparer, pageContext);
}
render();
+ if (flush) {
+ pageContext.getOut().flush();
+ }
}
/**
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?view=diff&rev=552462&r1=552461&r2=552462
==============================================================================
--- 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 Mon
Jul 2 03:51:45 2007
@@ -47,6 +47,12 @@
<put-attribute name="body" value="/body.jsp"/>
</definition>
+ <definition name="test.definition.flush" template="/layout_flush.jsp">
+ <put-attribute name="title" value="This is the title."/>
+ <put-attribute name="header" value="/header.jsp"/>
+ <put-attribute name="body" value="/body.jsp"/>
+ </definition>
+
<definition name="test.definition.exception" template="/layout.jsp">
<put-attribute name="title" value="This is the title."/>
<put-attribute name="header" value="/exception.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?view=diff&rev=552462&r1=552461&r2=552462
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp (original)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/index.jsp Mon Jul 2
03:51:45 2007
@@ -33,6 +33,7 @@
<h3>Standard Render/Attribute Tests</h3>
<a href="testinsertdefinition.jsp">Test Insert Configured
Definition</a><br/>
+ <a href="testinsertdefinition_flush.jsp">Test Insert Configured Definition
with Flush</a><br/>
<a href="testinsertdefinition_preparer.jsp">Test Insert Configured
Definition with Preparer</a><br/>
<a href="testinsertdefinition_preparer_configured.jsp">Test Insert
Configured Definition with Preparer configured in the definition itself</a><br/>
<a href="testinsertdefinition_classpath.jsp">Test Insert Configured
Classpath Definition</a><br/>
@@ -42,6 +43,7 @@
<a href="testinsertdefinition_composite.jsp">Test Insert Configured
Definition that contains another definition inside</a><br/>
<a href="testinsertdefinition_exception.jsp">Test Insert Configured
Definition with an exception in an attribute page</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/>
<a href="testput_servlet.jsp">Test Put Tag using a servlet mapping as a
template</a><br/>
<a href="testputlist.jsp">Test Put List Tag</a><br/>
Added: tiles/framework/trunk/tiles-test/src/main/webapp/layout_flush.jsp
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/layout_flush.jsp?view=auto&rev=552462
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/layout_flush.jsp (added)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/layout_flush.jsp Mon Jul
2 03:51:45 2007
@@ -0,0 +1,36 @@
+<%--
+/*
+ * $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" %>
+
+<table border="2" width="300" bordercolor="Gray">
+ <tr>
+ <td bgcolor="Blue"><strong><tiles:getAsString name="title"/></strong></td>
+ </tr>
+ <tr>
+ <td><tiles:insertAttribute name="header" flush="true"/></td>
+ </tr>
+ <tr>
+ <td><tiles:insertAttribute name="body" flush="true"/></td>
+ </tr>
+</table>
\ No newline at end of file
Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/layout_flush.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/layout_flush.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added:
tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_flush.jsp
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_flush.jsp?view=auto&rev=552462
==============================================================================
---
tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_flush.jsp
(added)
+++
tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_flush.jsp
Mon Jul 2 03:51:45 2007
@@ -0,0 +1,26 @@
+<%--
+/*
+ * $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.definition.flush" flush="true"/>
Propchange:
tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_flush.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tiles/framework/trunk/tiles-test/src/main/webapp/testinsertdefinition_flush.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: tiles/framework/trunk/tiles-test/src/main/webapp/testput_flush.jsp
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/main/webapp/testput_flush.jsp?view=auto&rev=552462
==============================================================================
--- tiles/framework/trunk/tiles-test/src/main/webapp/testput_flush.jsp (added)
+++ tiles/framework/trunk/tiles-test/src/main/webapp/testput_flush.jsp Mon Jul
2 03:51:45 2007
@@ -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.
+ *
+ */
+--%>
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+
+<tiles:insertTemplate template="/layout.jsp" flush="true">
+ <tiles:putAttribute name="title" value="This is the title." />
+ <tiles:putAttribute name="header" value="/header.jsp" />
+ <tiles:putAttribute name="body" value="/body.jsp" />
+</tiles:insertTemplate>
\ No newline at end of file
Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/testput_flush.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: tiles/framework/trunk/tiles-test/src/main/webapp/testput_flush.jsp
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added:
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionFlushTest.html
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionFlushTest.html?view=auto&rev=552462
==============================================================================
---
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionFlushTest.html
(added)
+++
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionFlushTest.html
Mon Jul 2 03:51:45 2007
@@ -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 with Flush Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Configured Definition with Flush 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 Flush</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>This is a body</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Propchange:
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionFlushTest.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tiles/framework/trunk/tiles-test/src/test/selenium/ConfiguredDefinitionFlushTest.html
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Added: tiles/framework/trunk/tiles-test/src/test/selenium/PutTagFlushTest.html
URL:
http://svn.apache.org/viewvc/tiles/framework/trunk/tiles-test/src/test/selenium/PutTagFlushTest.html?view=auto&rev=552462
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/PutTagFlushTest.html
(added)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/PutTagFlushTest.html Mon
Jul 2 03:51:45 2007
@@ -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 with Flush Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Put Tag with Flush 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 with Flush</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>This is a body</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
Propchange:
tiles/framework/trunk/tiles-test/src/test/selenium/PutTagFlushTest.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
tiles/framework/trunk/tiles-test/src/test/selenium/PutTagFlushTest.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?view=diff&rev=552462&r1=552461&r2=552462
==============================================================================
--- tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html (original)
+++ tiles/framework/trunk/tiles-test/src/test/selenium/TestSuite.html Mon Jul
2 03:51:45 2007
@@ -34,6 +34,9 @@
<td><a href="ConfiguredDefinitionTest.html">Configured Definition
Test</a></td>
</tr>
<tr>
+ <td><a href="ConfiguredDefinitionFlushTest.html">Configured Definition
with Flush Test</a></td>
+ </tr>
+ <tr>
<td><a href="ConfiguredDefinitionWithPreparerTest.html">Configured
Definition with Preparer Test</a></td>
</tr>
<tr>
@@ -59,6 +62,9 @@
</tr>
<tr>
<td><a href="PutTagTest.html">Put Tag Test</a></td>
+ </tr>
+ <tr>
+ <td><a href="PutTagFlushTest.html">Put Tag with Flush Test</a></td>
</tr>
<tr>
<td><a href="PutTagWithELTest.html">Put Tag using EL Test</a></td>