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/11/14 15:00:05 UTC
svn commit: r836180 [2/4] - in /tiles/sandbox/trunk:
tiles-request/tiles-request-api/src/main/java/org/apache/tiles/request/util/
tiles-request/tiles-request-freemarker/src/main/java/org/apache/tiles/freemarker/context/
tiles-request/tiles-request-free...
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_en_US.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_en_US.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_en_US.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_en_US.xml Sat Nov 14 14:00:02 2009
@@ -37,11 +37,11 @@
<!-- Doc index page description -->
<definition name="test.def1" template="/test.jsp">
<put-attribute name="country" value="US"/>
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
</definition>
</tiles-definitions>
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_fr.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_fr.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_fr.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_fr.xml Sat Nov 14 14:00:02 2009
@@ -37,11 +37,11 @@
<!-- Doc index page description -->
<definition name="test.def1" template="/test.jsp">
<put-attribute name="country" value="France"/>
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
</definition>
<definition name="test.common.french" template="/test.jsp">
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_fr_CA.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_fr_CA.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_fr_CA.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs1_fr_CA.xml Sat Nov 14 14:00:02 2009
@@ -37,11 +37,11 @@
<!-- Doc index page description -->
<definition name="test.def1" template="/test.jsp">
<put-attribute name="country" value="Canada"/>
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
</definition>
</tiles-definitions>
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs2.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs2.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs2.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs2.xml Sat Nov 14 14:00:02 2009
@@ -36,11 +36,11 @@
<!-- Doc index page description -->
<definition name="test.def2" template="/test.jsp">
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
</definition>
</tiles-definitions>
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs3.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs3.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs3.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/defs3.xml Sat Nov 14 14:00:02 2009
@@ -36,11 +36,11 @@
<!-- Doc index page description -->
<definition name="test.def3" template="/test.jsp">
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
</definition>
</tiles-definitions>
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/invalid-defs.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/invalid-defs.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/invalid-defs.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/invalid-defs.xml Sat Nov 14 14:00:02 2009
@@ -36,11 +36,11 @@
<!-- Dorked up XML tag. -->
<definitionasdfad name="doc.mainLayout" template="/layout/classicLayout.jsp">
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
</definitionasdfad>
</tiles-definitions>
\ No newline at end of file
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/malformed-defs.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/malformed-defs.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/malformed-defs.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/malformed-defs.xml Sat Nov 14 14:00:02 2009
@@ -36,9 +36,9 @@
<!-- Doc index page description -->
<definition name="doc.mainLayout" template="/layout/classicLayout.jsp">
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
</definition>
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/temp-defs.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/temp-defs.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/temp-defs.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/temp-defs.xml Sat Nov 14 14:00:02 2009
@@ -37,11 +37,11 @@
<!-- Doc index page description -->
<definition name="test.def1" template="/test.jsp">
<put-attribute name="country" value="default"/>
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
</definition>
</tiles-definitions>
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/tiles-defs.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/tiles-defs.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/tiles-defs.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/config/tiles-defs.xml Sat Nov 14 14:00:02 2009
@@ -36,11 +36,11 @@
<!-- Doc index page description -->
<definition name="doc.mainLayout" template="/layout/classicLayout.jsp">
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
<put-attribute name="bean" value="This is an object" type="object" />
</definition>
@@ -65,7 +65,7 @@
<add-attribute value="/doc/portal/revisions.jsp" />
</put-list-attribute>
</definition>
-
+
<!-- ======================================================= -->
<!-- Menus definitions -->
<!-- ======================================================= -->
@@ -87,11 +87,11 @@
<item value="Home" link="/index.jsp" />
<item value="Live Examples (new)" link="/examples/index.jsp" />
<!--
- <item> <value>Commented Examples</value>
- <link>/examples/index.jsp</link>
- <classtype>org.apache.tiles.beans.SimpleMenuItem</classtype>
- </item>
- -->
+ <item> <value>Commented Examples</value>
+ <link>/examples/index.jsp</link>
+ <classtype>org.apache.tiles.beans.SimpleMenuItem</classtype>
+ </item>
+ -->
<item value="Quick overview" link="/doc/quickOverview.jsp" />
<!--
<item value="Tutorial" link="/doc/tutorial.jsp" />
@@ -101,8 +101,8 @@
<item value="Installation" link="/doc/installation.jsp" />
<item value="User Guide" link="/doc/userGuide.jsp" />
<item value="Javadoc" link="/api/index.html" />
- <item value="Struts Home" link="http://www.apache.org" icon="/images/struts-power.gif"
- classtype="org.apache.tiles.beans.SimpleMenuItem" />
+ <item value="Struts Home" link="http://www.apache.org" icon="/images/struts-power.gif"
+ classtype="org.apache.tiles.beans.SimpleMenuItem" />
</put-list-attribute>
</definition>
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluatorTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluatorTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluatorTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/evaluator/impl/DirectAttributeEvaluatorTest.java Sat Nov 14 14:00:02 2009
@@ -40,7 +40,7 @@
/** {@inheritDoc} */
@Override
- public void setUp() throws Exception {
+ public void setUp() throws Exception {
evaluator = new DirectAttributeEvaluator();
}
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs-key-one.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs-key-one.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs-key-one.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs-key-one.xml Sat Nov 14 14:00:02 2009
@@ -29,11 +29,11 @@
<tiles-definitions>
<definition name="test.def.one" template="/test.jsp">
<put-attribute name="country" value="default"/>
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
</definition>
</tiles-definitions>
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs-key-two.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs-key-two.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs-key-two.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs-key-two.xml Sat Nov 14 14:00:02 2009
@@ -29,11 +29,11 @@
<tiles-definitions>
<definition name="test.def.two" template="/test.jsp">
<put-attribute name="country" value="default"/>
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
</definition>
</tiles-definitions>
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs.xml
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs.xml?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs.xml (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/factory/test-defs.xml Sat Nov 14 14:00:02 2009
@@ -29,11 +29,11 @@
<tiles-definitions>
<definition name="test.def1" template="/test.jsp">
<put-attribute name="country" value="default"/>
- <put-attribute name="title" value="Tiles Library Documentation" />
- <put-attribute name="header" value="/common/header.jsp" />
- <put-attribute name="menu" value="doc.menu.main" />
- <put-attribute name="footer" value="/common/footer.jsp" />
- <put-attribute name="body" value="doc.portal.body" />
+ <put-attribute name="title" value="Tiles Library Documentation" />
+ <put-attribute name="header" value="/common/header.jsp" />
+ <put-attribute name="menu" value="doc.menu.main" />
+ <put-attribute name="footer" value="/common/footer.jsp" />
+ <put-attribute name="body" value="doc.portal.body" />
</definition>
</tiles-definitions>
Modified: tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-core/src/test/java/org/apache/tiles/renderer/impl/DefinitionAttributeRendererTest.java Sat Nov 14 14:00:02 2009
@@ -69,11 +69,11 @@
TilesContainer container = createMock(TilesContainer.class);
Request requestContext = createMock(Request.class);
container.render("my.definition", requestContext);
- replay(applicationContext, requestContext, container);
+ replay(applicationContext, requestContext, container);
renderer.setApplicationContext(applicationContext);
renderer.setContainer(container);
renderer.render(attribute, requestContext);
- verify(applicationContext, requestContext, container);
+ verify(applicationContext, requestContext, container);
}
/**
@@ -89,10 +89,10 @@
TilesContainer container = createMock(TilesContainer.class);
Request requestContext = createMock(Request.class);
expect(container.isValidDefinition("my.definition", requestContext)).andReturn(Boolean.TRUE);
- replay(applicationContext, requestContext, container);
+ replay(applicationContext, requestContext, container);
renderer.setApplicationContext(applicationContext);
renderer.setContainer(container);
assertTrue(renderer.isRenderable("my.definition", attribute, requestContext));
- verify(applicationContext, requestContext, container);
+ verify(applicationContext, requestContext, container);
}
}
Modified: tiles/sandbox/trunk/tiles3/tiles-el/src/main/java/org/apache/tiles/el/ELContextImpl.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-el/src/main/java/org/apache/tiles/el/ELContextImpl.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-el/src/main/java/org/apache/tiles/el/ELContextImpl.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-el/src/main/java/org/apache/tiles/el/ELContextImpl.java Sat Nov 14 14:00:02 2009
@@ -44,7 +44,7 @@
*/
private static final FunctionMapper NULL_FUNCTION_MAPPER = new FunctionMapper() {
@Override
- public Method resolveFunction(String prefix, String localName) {
+ public Method resolveFunction(String prefix, String localName) {
return null;
}
};
@@ -61,7 +61,7 @@
/** {@inheritDoc} */
@Override
- public ValueExpression resolveVariable(String variable) {
+ public ValueExpression resolveVariable(String variable) {
if (vars == null) {
return null;
}
@@ -70,7 +70,7 @@
/** {@inheritDoc} */
@Override
- public ValueExpression setVariable(String variable,
+ public ValueExpression setVariable(String variable,
ValueExpression expression) {
if (vars == null) {
vars = new HashMap<String, ValueExpression>();
@@ -106,19 +106,19 @@
/** {@inheritDoc} */
@Override
- public ELResolver getELResolver() {
+ public ELResolver getELResolver() {
return this.resolver;
}
/** {@inheritDoc} */
@Override
- public FunctionMapper getFunctionMapper() {
+ public FunctionMapper getFunctionMapper() {
return this.functionMapper;
}
/** {@inheritDoc} */
@Override
- public VariableMapper getVariableMapper() {
+ public VariableMapper getVariableMapper() {
if (this.variableMapper == null) {
this.variableMapper = new VariableMapperImpl();
}
Modified: tiles/sandbox/trunk/tiles3/tiles-el/src/test/java/org/apache/tiles/el/TilesContextBeanELResolverTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-el/src/test/java/org/apache/tiles/el/TilesContextBeanELResolverTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-el/src/test/java/org/apache/tiles/el/TilesContextBeanELResolverTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-el/src/test/java/org/apache/tiles/el/TilesContextBeanELResolverTest.java Sat Nov 14 14:00:02 2009
@@ -51,7 +51,7 @@
/** {@inheritDoc} */
@Override
- protected void setUp() throws Exception {
+ protected void setUp() throws Exception {
super.setUp();
resolver = new TilesContextBeanELResolver();
}
Modified: tiles/sandbox/trunk/tiles3/tiles-el/src/test/java/org/apache/tiles/el/TilesContextELResolverTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-el/src/test/java/org/apache/tiles/el/TilesContextELResolverTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-el/src/test/java/org/apache/tiles/el/TilesContextELResolverTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-el/src/test/java/org/apache/tiles/el/TilesContextELResolverTest.java Sat Nov 14 14:00:02 2009
@@ -52,7 +52,7 @@
/** {@inheritDoc} */
@Override
- protected void setUp() throws Exception {
+ protected void setUp() throws Exception {
super.setUp();
resolver = new TilesContextELResolver();
}
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/context/FreeMarkerUtil.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/context/FreeMarkerUtil.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/context/FreeMarkerUtil.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/context/FreeMarkerUtil.java Sat Nov 14 14:00:02 2009
@@ -83,8 +83,8 @@
* @since 2.2.0
*/
public static void setForceInclude(Environment env, boolean forceInclude) {
- org.apache.tiles.request.servlet.ServletUtil.setForceInclude(
- FreeMarkerRequestUtil.getRequestHashModel(env).getRequest(), forceInclude);
+ org.apache.tiles.request.servlet.ServletUtil.setForceInclude(
+ FreeMarkerRequestUtil.getRequestHashModel(env).getRequest(), forceInclude);
}
/**
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/GetAsStringFMModel.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/GetAsStringFMModel.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/GetAsStringFMModel.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/GetAsStringFMModel.java Sat Nov 14 14:00:02 2009
@@ -73,9 +73,9 @@
TemplateDirectiveBody body) throws TemplateException, IOException {
Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
- Request request = FreeMarkerTilesRequestContext
- .createServletFreemarkerRequest(container
- .getApplicationContext(), env);
+ Request request = FreeMarkerTilesRequestContext
+ .createServletFreemarkerRequest(container
+ .getApplicationContext(), env);
model.start(
FreeMarkerUtil.getComposeStack(env),
container,
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/ImportAttributeFMModel.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/ImportAttributeFMModel.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/ImportAttributeFMModel.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/ImportAttributeFMModel.java Sat Nov 14 14:00:02 2009
@@ -47,40 +47,40 @@
*/
public class ImportAttributeFMModel implements TemplateDirectiveModel {
- /**
- * The template model.
- */
- private ImportAttributeModel model;
+ /**
+ * The template model.
+ */
+ private ImportAttributeModel model;
- /**
- * Constructor.
- *
- * @param model
- * The template model.
- * @since 2.2.0
- */
- public ImportAttributeFMModel(ImportAttributeModel model) {
- this.model = model;
- }
+ /**
+ * Constructor.
+ *
+ * @param model
+ * The template model.
+ * @since 2.2.0
+ */
+ public ImportAttributeFMModel(ImportAttributeModel model) {
+ this.model = model;
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- public void execute(Environment env, Map params, TemplateModel[] loopVars,
- TemplateDirectiveBody body) throws TemplateException, IOException {
- Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
- TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
- Request request = FreeMarkerTilesRequestContext
- .createServletFreemarkerRequest(container
- .getApplicationContext(), env);
- Map<String, Object> attributes = model.getImportedAttributes(container,
- FreeMarkerUtil.getAsString(parms.get("name")), FreeMarkerUtil
- .getAsString(parms.get("toName")), FreeMarkerUtil
- .getAsBoolean(parms.get("ignore"), false), request);
- String scope = FreeMarkerUtil.getAsString(parms.get("scope"));
- for (Map.Entry<String, Object> entry : attributes.entrySet()) {
- FreeMarkerUtil.setAttribute(env, entry.getKey(), entry.getValue(),
- scope);
- }
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ public void execute(Environment env, Map params, TemplateModel[] loopVars,
+ TemplateDirectiveBody body) throws TemplateException, IOException {
+ Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
+ TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
+ Request request = FreeMarkerTilesRequestContext
+ .createServletFreemarkerRequest(container
+ .getApplicationContext(), env);
+ Map<String, Object> attributes = model.getImportedAttributes(container,
+ FreeMarkerUtil.getAsString(parms.get("name")), FreeMarkerUtil
+ .getAsString(parms.get("toName")), FreeMarkerUtil
+ .getAsBoolean(parms.get("ignore"), false), request);
+ String scope = FreeMarkerUtil.getAsString(parms.get("scope"));
+ for (Map.Entry<String, Object> entry : attributes.entrySet()) {
+ FreeMarkerUtil.setAttribute(env, entry.getKey(), entry.getValue(),
+ scope);
+ }
+ }
}
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertAttributeFMModel.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertAttributeFMModel.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertAttributeFMModel.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertAttributeFMModel.java Sat Nov 14 14:00:02 2009
@@ -50,45 +50,45 @@
*/
public class InsertAttributeFMModel implements TemplateDirectiveModel {
- /**
- * The template model.
- */
- private InsertAttributeModel model;
+ /**
+ * The template model.
+ */
+ private InsertAttributeModel model;
- /**
- * Constructor.
- *
- * @param model
- * The template model.
- * @since 2.2.0
- */
- public InsertAttributeFMModel(InsertAttributeModel model) {
- this.model = model;
- }
+ /**
+ * Constructor.
+ *
+ * @param model
+ * The template model.
+ * @since 2.2.0
+ */
+ public InsertAttributeFMModel(InsertAttributeModel model) {
+ this.model = model;
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- public void execute(Environment env, Map params, TemplateModel[] loopVars,
- TemplateDirectiveBody body) throws TemplateException, IOException {
- Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
- TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
- Request request = FreeMarkerTilesRequestContext
- .createServletFreemarkerRequest(container
- .getApplicationContext(), env);
- model.start(FreeMarkerUtil.getComposeStack(env), container,
- FreeMarkerUtil.getAsBoolean(parms.get("ignore"), false),
- FreeMarkerUtil.getAsString(parms.get("preparer")),
- FreeMarkerUtil.getAsString(parms.get("role")), FreeMarkerUtil
- .getAsObject(parms.get("defaultValue")), FreeMarkerUtil
- .getAsString(parms.get("defaultValueRole")),
- FreeMarkerUtil.getAsString(parms.get("defaultValueType")),
- FreeMarkerUtil.getAsString(parms.get("name")),
- (Attribute) FreeMarkerUtil.getAsObject(parms.get("value")),
- request);
- FreeMarkerUtil.evaluateBody(body);
- model.end(FreeMarkerUtil.getComposeStack(env), container,
- FreeMarkerUtil.getAsBoolean(parms.get("ignore"), false),
- request);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ public void execute(Environment env, Map params, TemplateModel[] loopVars,
+ TemplateDirectiveBody body) throws TemplateException, IOException {
+ Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
+ TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
+ Request request = FreeMarkerTilesRequestContext
+ .createServletFreemarkerRequest(container
+ .getApplicationContext(), env);
+ model.start(FreeMarkerUtil.getComposeStack(env), container,
+ FreeMarkerUtil.getAsBoolean(parms.get("ignore"), false),
+ FreeMarkerUtil.getAsString(parms.get("preparer")),
+ FreeMarkerUtil.getAsString(parms.get("role")), FreeMarkerUtil
+ .getAsObject(parms.get("defaultValue")), FreeMarkerUtil
+ .getAsString(parms.get("defaultValueRole")),
+ FreeMarkerUtil.getAsString(parms.get("defaultValueType")),
+ FreeMarkerUtil.getAsString(parms.get("name")),
+ (Attribute) FreeMarkerUtil.getAsObject(parms.get("value")),
+ request);
+ FreeMarkerUtil.evaluateBody(body);
+ model.end(FreeMarkerUtil.getComposeStack(env), container,
+ FreeMarkerUtil.getAsBoolean(parms.get("ignore"), false),
+ request);
+ }
}
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModel.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModel.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModel.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModel.java Sat Nov 14 14:00:02 2009
@@ -49,39 +49,39 @@
*/
public class InsertDefinitionFMModel implements TemplateDirectiveModel {
- /**
- * The template model.
- */
- private InsertDefinitionModel model;
+ /**
+ * The template model.
+ */
+ private InsertDefinitionModel model;
- /**
- * Constructor.
- *
- * @param model
- * The template model.
- * @since 2.2.0
- */
- public InsertDefinitionFMModel(InsertDefinitionModel model) {
- this.model = model;
- }
+ /**
+ * Constructor.
+ *
+ * @param model
+ * The template model.
+ * @since 2.2.0
+ */
+ public InsertDefinitionFMModel(InsertDefinitionModel model) {
+ this.model = model;
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- public void execute(Environment env, Map params, TemplateModel[] loopVars,
- TemplateDirectiveBody body) throws TemplateException, IOException {
- Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
- TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
- Request request = FreeMarkerTilesRequestContext
- .createServletFreemarkerRequest(container
- .getApplicationContext(), env);
- model.start(container, request);
- FreeMarkerUtil.evaluateBody(body);
- model.end(container, FreeMarkerUtil.getAsString(parms.get("name")),
- FreeMarkerUtil.getAsString(parms.get("template")),
- FreeMarkerUtil.getAsString(parms.get("templateType")),
- FreeMarkerUtil.getAsString(parms.get("templateExpression")),
- FreeMarkerUtil.getAsString(parms.get("role")), FreeMarkerUtil
- .getAsString(parms.get("preparer")), request);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ public void execute(Environment env, Map params, TemplateModel[] loopVars,
+ TemplateDirectiveBody body) throws TemplateException, IOException {
+ Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
+ TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
+ Request request = FreeMarkerTilesRequestContext
+ .createServletFreemarkerRequest(container
+ .getApplicationContext(), env);
+ model.start(container, request);
+ FreeMarkerUtil.evaluateBody(body);
+ model.end(container, FreeMarkerUtil.getAsString(parms.get("name")),
+ FreeMarkerUtil.getAsString(parms.get("template")),
+ FreeMarkerUtil.getAsString(parms.get("templateType")),
+ FreeMarkerUtil.getAsString(parms.get("templateExpression")),
+ FreeMarkerUtil.getAsString(parms.get("role")), FreeMarkerUtil
+ .getAsString(parms.get("preparer")), request);
+ }
}
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertTemplateFMModel.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertTemplateFMModel.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertTemplateFMModel.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/InsertTemplateFMModel.java Sat Nov 14 14:00:02 2009
@@ -49,39 +49,39 @@
*/
public class InsertTemplateFMModel implements TemplateDirectiveModel {
- /**
- * The template model.
- */
- private InsertTemplateModel model;
+ /**
+ * The template model.
+ */
+ private InsertTemplateModel model;
- /**
- * Constructor.
- *
- * @param model
- * The template model.
- * @since 2.2.0
- */
- public InsertTemplateFMModel(InsertTemplateModel model) {
- this.model = model;
- }
+ /**
+ * Constructor.
+ *
+ * @param model
+ * The template model.
+ * @since 2.2.0
+ */
+ public InsertTemplateFMModel(InsertTemplateModel model) {
+ this.model = model;
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- public void execute(Environment env, Map params, TemplateModel[] loopVars,
- TemplateDirectiveBody body) throws TemplateException, IOException {
- Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
- TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
- Request request = FreeMarkerTilesRequestContext
- .createServletFreemarkerRequest(container
- .getApplicationContext(), env);
- model.start(container, request);
- FreeMarkerUtil.evaluateBody(body);
- FreeMarkerUtil.setForceInclude(env, true);
- model.end(container, FreeMarkerUtil.getAsString(parms.get("template")),
- FreeMarkerUtil.getAsString(parms.get("templateType")),
- FreeMarkerUtil.getAsString(parms.get("templateExpression")),
- FreeMarkerUtil.getAsString(parms.get("role")), FreeMarkerUtil
- .getAsString(parms.get("preparer")), request);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ public void execute(Environment env, Map params, TemplateModel[] loopVars,
+ TemplateDirectiveBody body) throws TemplateException, IOException {
+ Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
+ TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
+ Request request = FreeMarkerTilesRequestContext
+ .createServletFreemarkerRequest(container
+ .getApplicationContext(), env);
+ model.start(container, request);
+ FreeMarkerUtil.evaluateBody(body);
+ FreeMarkerUtil.setForceInclude(env, true);
+ model.end(container, FreeMarkerUtil.getAsString(parms.get("template")),
+ FreeMarkerUtil.getAsString(parms.get("templateType")),
+ FreeMarkerUtil.getAsString(parms.get("templateExpression")),
+ FreeMarkerUtil.getAsString(parms.get("role")), FreeMarkerUtil
+ .getAsString(parms.get("preparer")), request);
+ }
}
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/PutAttributeFMModel.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/PutAttributeFMModel.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/PutAttributeFMModel.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/PutAttributeFMModel.java Sat Nov 14 14:00:02 2009
@@ -48,40 +48,40 @@
*/
public class PutAttributeFMModel implements TemplateDirectiveModel {
- /**
- * The template model.
- */
- private PutAttributeModel model;
+ /**
+ * The template model.
+ */
+ private PutAttributeModel model;
- /**
- * Constructor.
- *
- * @param model
- * The template model.
- * @since 2.2.0
- */
- public PutAttributeFMModel(PutAttributeModel model) {
- this.model = model;
- }
+ /**
+ * Constructor.
+ *
+ * @param model
+ * The template model.
+ * @since 2.2.0
+ */
+ public PutAttributeFMModel(PutAttributeModel model) {
+ this.model = model;
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- public void execute(Environment env, Map params, TemplateModel[] loopVars,
- TemplateDirectiveBody body) throws TemplateException, IOException {
- ArrayStack<Object> composeStack = FreeMarkerUtil.getComposeStack(env);
- TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
- Request request = FreeMarkerTilesRequestContext
- .createServletFreemarkerRequest(container
- .getApplicationContext(), env);
- model.start(composeStack);
- String bodyString = FreeMarkerUtil.renderAsString(body);
- Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
- model.end(container, composeStack, FreeMarkerUtil.getAsString(parms
- .get("name")), FreeMarkerUtil.getAsObject(parms.get("value")),
- FreeMarkerUtil.getAsString(parms.get("expression")),
- bodyString, FreeMarkerUtil.getAsString(parms.get("role")),
- FreeMarkerUtil.getAsString(parms.get("type")), FreeMarkerUtil
- .getAsBoolean(parms.get("cascade"), false), request);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ public void execute(Environment env, Map params, TemplateModel[] loopVars,
+ TemplateDirectiveBody body) throws TemplateException, IOException {
+ ArrayStack<Object> composeStack = FreeMarkerUtil.getComposeStack(env);
+ TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
+ Request request = FreeMarkerTilesRequestContext
+ .createServletFreemarkerRequest(container
+ .getApplicationContext(), env);
+ model.start(composeStack);
+ String bodyString = FreeMarkerUtil.renderAsString(body);
+ Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
+ model.end(container, composeStack, FreeMarkerUtil.getAsString(parms
+ .get("name")), FreeMarkerUtil.getAsObject(parms.get("value")),
+ FreeMarkerUtil.getAsString(parms.get("expression")),
+ bodyString, FreeMarkerUtil.getAsString(parms.get("role")),
+ FreeMarkerUtil.getAsString(parms.get("type")), FreeMarkerUtil
+ .getAsBoolean(parms.get("cascade"), false), request);
+ }
}
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/PutListAttributeFMModel.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/PutListAttributeFMModel.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/PutListAttributeFMModel.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/main/java/org/apache/tiles/freemarker/template/PutListAttributeFMModel.java Sat Nov 14 14:00:02 2009
@@ -49,38 +49,38 @@
*/
public class PutListAttributeFMModel implements TemplateDirectiveModel {
- /**
- * The template model.
- */
- private PutListAttributeModel model;
+ /**
+ * The template model.
+ */
+ private PutListAttributeModel model;
- /**
- * Constructor.
- *
- * @param model
- * The template model.
- * @since 2.2.0
- */
- public PutListAttributeFMModel(PutListAttributeModel model) {
- this.model = model;
- }
+ /**
+ * Constructor.
+ *
+ * @param model
+ * The template model.
+ * @since 2.2.0
+ */
+ public PutListAttributeFMModel(PutListAttributeModel model) {
+ this.model = model;
+ }
- /** {@inheritDoc} */
- @SuppressWarnings("unchecked")
- public void execute(Environment env, Map params, TemplateModel[] loopVars,
- TemplateDirectiveBody body) throws TemplateException, IOException {
- Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
- ArrayStack<Object> composeStack = FreeMarkerUtil.getComposeStack(env);
- TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
- Request request = FreeMarkerTilesRequestContext
- .createServletFreemarkerRequest(container
- .getApplicationContext(), env);
- model.start(composeStack,
- FreeMarkerUtil.getAsString(parms.get("role")), FreeMarkerUtil
- .getAsBoolean(parms.get("inherit"), false));
- FreeMarkerUtil.evaluateBody(body);
- model.end(container, composeStack, FreeMarkerUtil.getAsString(parms
- .get("name")), FreeMarkerUtil.getAsBoolean(
- parms.get("cascade"), false), request);
- }
+ /** {@inheritDoc} */
+ @SuppressWarnings("unchecked")
+ public void execute(Environment env, Map params, TemplateModel[] loopVars,
+ TemplateDirectiveBody body) throws TemplateException, IOException {
+ Map<String, TemplateModel> parms = (Map<String, TemplateModel>) params;
+ ArrayStack<Object> composeStack = FreeMarkerUtil.getComposeStack(env);
+ TilesContainer container = FreeMarkerUtil.getCurrentContainer(env);
+ Request request = FreeMarkerTilesRequestContext
+ .createServletFreemarkerRequest(container
+ .getApplicationContext(), env);
+ model.start(composeStack,
+ FreeMarkerUtil.getAsString(parms.get("role")), FreeMarkerUtil
+ .getAsBoolean(parms.get("inherit"), false));
+ FreeMarkerUtil.evaluateBody(body);
+ model.end(container, composeStack, FreeMarkerUtil.getAsString(parms
+ .get("name")), FreeMarkerUtil.getAsBoolean(
+ parms.get("cascade"), false), request);
+ }
}
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/context/FreeMarkerUtilTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/context/FreeMarkerUtilTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/context/FreeMarkerUtilTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/context/FreeMarkerUtilTest.java Sat Nov 14 14:00:02 2009
@@ -115,10 +115,10 @@
HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper);
expect(model.get("Request")).andReturn(requestModel);
- expect(
- request
- .getAttribute(org.apache.tiles.request.servlet.ServletUtil.FORCE_INCLUDE_ATTRIBUTE_NAME))
- .andReturn(true);
+ expect(
+ request
+ .getAttribute(org.apache.tiles.request.servlet.ServletUtil.FORCE_INCLUDE_ATTRIBUTE_NAME))
+ .andReturn(true);
replay(template, model, request, objectWrapper);
env = new Environment(template, model, writer);
@@ -140,10 +140,10 @@
HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper);
expect(model.get("Request")).andReturn(requestModel);
- request
- .setAttribute(
- org.apache.tiles.request.servlet.ServletUtil.FORCE_INCLUDE_ATTRIBUTE_NAME,
- true);
+ request
+ .setAttribute(
+ org.apache.tiles.request.servlet.ServletUtil.FORCE_INCLUDE_ATTRIBUTE_NAME,
+ true);
replay(template, model, request, objectWrapper);
env = new Environment(template, model, writer);
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/GetAsStringFMModelTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/GetAsStringFMModelTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/GetAsStringFMModelTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/GetAsStringFMModelTest.java Sat Nov 14 14:00:02 2009
@@ -151,19 +151,19 @@
params.put("name", objectWrapper.wrap("myName"));
params.put("value", objectWrapper.wrap(attribute));
- tModel.start(eq(composeStack), eq(container), eq(false),
- eq("myPreparer"), eq("myRole"), eq("myDefaultValue"),
- eq("myDefaultValueRole"), eq("myDefaultValueType"),
- eq("myName"), eq(attribute),
- isA(FreeMarkerTilesRequestContext.class));
- tModel.end(eq(composeStack), eq(container), eq(writer), eq(false),
- isA(FreeMarkerTilesRequestContext.class));
+ tModel.start(eq(composeStack), eq(container), eq(false),
+ eq("myPreparer"), eq("myRole"), eq("myDefaultValue"),
+ eq("myDefaultValueRole"), eq("myDefaultValueType"),
+ eq("myName"), eq(attribute),
+ isA(FreeMarkerTilesRequestContext.class));
+ tModel.end(eq(composeStack), eq(container), eq(writer), eq(false),
+ isA(FreeMarkerTilesRequestContext.class));
body.render(isA(NullWriter.class));
replay(tModel, body, container, attribute, applicationContext);
fmModel.execute(env, params, null, body);
- verify(template, model, request, tModel, body, container, servlet,
- servletContext, attribute, applicationContext);
+ verify(template, model, request, tModel, body, container, servlet,
+ servletContext, attribute, applicationContext);
}
/**
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ImportAttributeFMModelTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ImportAttributeFMModelTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ImportAttributeFMModelTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/ImportAttributeFMModelTest.java Sat Nov 14 14:00:02 2009
@@ -156,8 +156,8 @@
fmModel.execute(env, params, null, body);
assertEquals("value1", DeepUnwrap.unwrap(env.getCurrentNamespace().get("one")));
assertEquals("value2", DeepUnwrap.unwrap(env.getCurrentNamespace().get("two")));
- verify(template, model, request, tModel, body, container, servlet,
- servletContext, attribute, applicationContext);
+ verify(template, model, request, tModel, body, container, servlet,
+ servletContext, attribute, applicationContext);
}
/**
@@ -209,8 +209,8 @@
replay(tModel, body, container, attribute, applicationContext);
fmModel.execute(env, params, null, body);
- verify(template, model, request, tModel, body, container, servlet,
- servletContext, attribute, applicationContext);
+ verify(template, model, request, tModel, body, container, servlet,
+ servletContext, attribute, applicationContext);
}
/**
@@ -264,8 +264,8 @@
replay(tModel, body, container, attribute, applicationContext);
fmModel.execute(env, params, null, body);
- verify(template, model, request, session, tModel, body, container,
- servlet, servletContext, attribute, applicationContext);
+ verify(template, model, request, session, tModel, body, container,
+ servlet, servletContext, attribute, applicationContext);
}
/**
@@ -317,8 +317,8 @@
replay(tModel, body, container, attribute, applicationContext);
fmModel.execute(env, params, null, body);
- verify(template, model, request, tModel, body, container, servlet,
- servletContext, attribute, applicationContext);
+ verify(template, model, request, tModel, body, container, servlet,
+ servletContext, attribute, applicationContext);
}
/**
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertAttributeFMModelTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertAttributeFMModelTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertAttributeFMModelTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertAttributeFMModelTest.java Sat Nov 14 14:00:02 2009
@@ -151,18 +151,18 @@
params.put("name", objectWrapper.wrap("myName"));
params.put("value", objectWrapper.wrap(attribute));
- tModel.start(eq(composeStack), eq(container), eq(false),
- eq("myPreparer"), eq("myRole"), eq("myDefaultValue"),
- eq("myDefaultValueRole"), eq("myDefaultValueType"),
- eq("myName"), eq(attribute),
- isA(FreeMarkerTilesRequestContext.class));
+ tModel.start(eq(composeStack), eq(container), eq(false),
+ eq("myPreparer"), eq("myRole"), eq("myDefaultValue"),
+ eq("myDefaultValueRole"), eq("myDefaultValueType"),
+ eq("myName"), eq(attribute),
+ isA(FreeMarkerTilesRequestContext.class));
tModel.end(eq(composeStack), eq(container), eq(false), isA(FreeMarkerTilesRequestContext.class));
body.render(isA(NullWriter.class));
replay(tModel, body, container, attribute, applicationContext);
fmModel.execute(env, params, null, body);
- verify(template, model, request, tModel, body, container, servlet,
- servletContext, attribute, applicationContext);
+ verify(template, model, request, tModel, body, container, servlet,
+ servletContext, attribute, applicationContext);
}
/**
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModelTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModelTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModelTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertDefinitionFMModelTest.java Sat Nov 14 14:00:02 2009
@@ -147,15 +147,15 @@
params.put("preparer", objectWrapper.wrap("myPreparer"));
tModel.start(eq(container), isA(FreeMarkerTilesRequestContext.class));
- tModel.end(eq(container), eq("myName"), eq("myTemplate"),
- eq("myTemplateType"), eq("myTemplateExpression"), eq("myRole"),
- eq("myPreparer"), isA(FreeMarkerTilesRequestContext.class));
+ tModel.end(eq(container), eq("myName"), eq("myTemplate"),
+ eq("myTemplateType"), eq("myTemplateExpression"), eq("myRole"),
+ eq("myPreparer"), isA(FreeMarkerTilesRequestContext.class));
body.render(isA(NullWriter.class));
replay(tModel, body, container, attribute, applicationContext);
fmModel.execute(env, params, null, body);
- verify(template, model, request, tModel, body, container, servlet,
- servletContext, attribute, applicationContext);
+ verify(template, model, request, tModel, body, container, servlet,
+ servletContext, attribute, applicationContext);
}
/**
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertTemplateFMModelTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertTemplateFMModelTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertTemplateFMModelTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/InsertTemplateFMModelTest.java Sat Nov 14 14:00:02 2009
@@ -128,10 +128,10 @@
HttpServletRequest request = createMock(HttpServletRequest.class);
expect(request.getAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME)).andReturn(null);
request.setAttribute(ServletUtil.CURRENT_CONTAINER_ATTRIBUTE_NAME, container);
- request
- .setAttribute(
- org.apache.tiles.request.servlet.ServletUtil.FORCE_INCLUDE_ATTRIBUTE_NAME,
- true);
+ request
+ .setAttribute(
+ org.apache.tiles.request.servlet.ServletUtil.FORCE_INCLUDE_ATTRIBUTE_NAME,
+ true);
replay(request);
HttpRequestHashModel requestModel = new HttpRequestHashModel(request, objectWrapper);
@@ -162,8 +162,8 @@
replay(tModel, body, container, attribute, applicationContext);
fmModel.execute(env, params, null, body);
- verify(template, model, request, tModel, body, container, servlet,
- servletContext, attribute, applicationContext);
+ verify(template, model, request, tModel, body, container, servlet,
+ servletContext, attribute, applicationContext);
}
/**
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutAttributeFMModelTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutAttributeFMModelTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutAttributeFMModelTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutAttributeFMModelTest.java Sat Nov 14 14:00:02 2009
@@ -149,15 +149,15 @@
params.put("cascade", objectWrapper.wrap(false));
tModel.start(composeStack);
- tModel.end(eq(container), eq(composeStack), eq("myName"), eq(value),
- eq("myExpression"), eq(""), eq("myRole"), eq("myType"),
- eq(false), isA(FreeMarkerTilesRequestContext.class));
+ tModel.end(eq(container), eq(composeStack), eq("myName"), eq(value),
+ eq("myExpression"), eq(""), eq("myRole"), eq("myType"),
+ eq(false), isA(FreeMarkerTilesRequestContext.class));
body.render(isA(StringWriter.class));
replay(tModel, body, container, applicationContext);
fmModel.execute(env, params, null, body);
- verify(template, model, request, tModel, body, container,
- applicationContext);
+ verify(template, model, request, tModel, body, container,
+ applicationContext);
}
/**
Modified: tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutListAttributeFMModelTest.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutListAttributeFMModelTest.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutListAttributeFMModelTest.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-freemarker/src/test/java/org/apache/tiles/freemarker/template/PutListAttributeFMModelTest.java Sat Nov 14 14:00:02 2009
@@ -147,14 +147,14 @@
params.put("cascade", objectWrapper.wrap(false));
tModel.start(composeStack, "myRole", false);
- tModel.end(eq(container), eq(composeStack), eq("myName"), eq(false),
- isA(FreeMarkerTilesRequestContext.class));
+ tModel.end(eq(container), eq(composeStack), eq("myName"), eq(false),
+ isA(FreeMarkerTilesRequestContext.class));
body.render(isA(NullWriter.class));
replay(tModel, body, container, applicationContext);
fmModel.execute(env, params, null, body);
- verify(template, model, request, tModel, body, container,
- applicationContext);
+ verify(template, model, request, tModel, body, container,
+ applicationContext);
}
/**
Modified: tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/GetAsStringTag.java Sat Nov 14 14:00:02 2009
@@ -307,12 +307,12 @@
@Override
public void doTag() throws JspException, IOException {
JspContext jspContext = getJspContext();
- TilesContainer currentContainer = JspUtil
- .getCurrentContainer(jspContext);
- Request request = JspTilesRequestContext.createServletJspRequest(
- currentContainer.getApplicationContext(),
- (PageContext) jspContext);
- model.start(JspUtil.getComposeStack(jspContext), currentContainer, ignore, preparer, role,
+ TilesContainer currentContainer = JspUtil
+ .getCurrentContainer(jspContext);
+ Request request = JspTilesRequestContext.createServletJspRequest(
+ currentContainer.getApplicationContext(),
+ (PageContext) jspContext);
+ model.start(JspUtil.getComposeStack(jspContext), currentContainer, ignore, preparer, role,
defaultValue, defaultValueRole, defaultValueType, name,
(Attribute) value, request);
JspWriter writer = jspContext.getOut();
Modified: tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/ImportAttributeTag.java Sat Nov 14 14:00:02 2009
@@ -43,133 +43,133 @@
*/
public class ImportAttributeTag extends SimpleTagSupport {
- /**
- * The template model.
- */
- private ImportAttributeModel model = new ImportAttributeModel();
-
- /**
- * The scope name.
- */
- private String scopeName = null;
-
- /**
- * The name of the attribute.
- */
- private String name = null;
-
- /**
- * Flag that, if <code>true</code>, ignores exceptions.
- */
- private boolean ignore = false;
-
- /**
- * The destination attribute name.
- */
- private String toName;
-
- /**
- * Set the scope.
- *
- * @param scope
- * Scope.
- */
- public void setScope(String scope) {
- this.scopeName = scope;
- }
-
- /**
- * Get scope.
- *
- * @return Scope.
- */
- public String getScope() {
- return scopeName;
- }
-
- /**
- * Get the name.
- *
- * @return Name.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Set the name.
- *
- * @param name
- * The new name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Set ignore flag.
- *
- * @param ignore
- * default: <code>false</code>: Exception is thrown when
- * attribute is not found, set to <code>
+ /**
+ * The template model.
+ */
+ private ImportAttributeModel model = new ImportAttributeModel();
+
+ /**
+ * The scope name.
+ */
+ private String scopeName = null;
+
+ /**
+ * The name of the attribute.
+ */
+ private String name = null;
+
+ /**
+ * Flag that, if <code>true</code>, ignores exceptions.
+ */
+ private boolean ignore = false;
+
+ /**
+ * The destination attribute name.
+ */
+ private String toName;
+
+ /**
+ * Set the scope.
+ *
+ * @param scope
+ * Scope.
+ */
+ public void setScope(String scope) {
+ this.scopeName = scope;
+ }
+
+ /**
+ * Get scope.
+ *
+ * @return Scope.
+ */
+ public String getScope() {
+ return scopeName;
+ }
+
+ /**
+ * Get the name.
+ *
+ * @return Name.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Set the name.
+ *
+ * @param name
+ * The new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Set ignore flag.
+ *
+ * @param ignore
+ * default: <code>false</code>: Exception is thrown when
+ * attribute is not found, set to <code>
* true</code> to
- * ignore missing attributes silently
- */
- public void setIgnore(boolean ignore) {
- this.ignore = ignore;
- }
-
- /**
- * Get ignore flag.
- *
- * @return default: <code>false</code>: Exception is thrown when attribute
- * is not found, set to <code>
+ * ignore missing attributes silently
+ */
+ public void setIgnore(boolean ignore) {
+ this.ignore = ignore;
+ }
+
+ /**
+ * Get ignore flag.
+ *
+ * @return default: <code>false</code>: Exception is thrown when attribute
+ * is not found, set to <code>
* true</code> to ignore missing
- * attributes silently
- */
- public boolean isIgnore() {
- return ignore;
- }
-
- /**
- * <p>
- * Returns the name of the destination attribute. If not specified, the name
- * will be the same as specified in <code>name</code> attribute
- * </p>
- *
- * @return The destination attribute name.
- */
- public String getToName() {
- return toName;
- }
-
- /**
- * <p>
- * Sets the name of the destination attribute. If not specified, the name
- * will be the same as specified in <code>name</code> attribute
- * </p>
- *
- * @param toName
- * The destination attribute name.
- */
- public void setToName(String toName) {
- this.toName = toName;
- }
-
- /** {@inheritDoc} */
- @Override
- public void doTag() throws JspException {
- JspContext jspContext = getJspContext();
- TilesContainer currentContainer = JspUtil
- .getCurrentContainer(jspContext);
- Request request = JspTilesRequestContext.createServletJspRequest(
- currentContainer.getApplicationContext(),
- (PageContext) jspContext);
- Map<String, Object> attributes = model.getImportedAttributes(
- currentContainer, name, toName, ignore, request);
- int scopeId = JspUtil.getScope(scopeName);
- for (Map.Entry<String, Object> entry : attributes.entrySet()) {
- jspContext.setAttribute(entry.getKey(), entry.getValue(), scopeId);
- }
- }
+ * attributes silently
+ */
+ public boolean isIgnore() {
+ return ignore;
+ }
+
+ /**
+ * <p>
+ * Returns the name of the destination attribute. If not specified, the name
+ * will be the same as specified in <code>name</code> attribute
+ * </p>
+ *
+ * @return The destination attribute name.
+ */
+ public String getToName() {
+ return toName;
+ }
+
+ /**
+ * <p>
+ * Sets the name of the destination attribute. If not specified, the name
+ * will be the same as specified in <code>name</code> attribute
+ * </p>
+ *
+ * @param toName
+ * The destination attribute name.
+ */
+ public void setToName(String toName) {
+ this.toName = toName;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void doTag() throws JspException {
+ JspContext jspContext = getJspContext();
+ TilesContainer currentContainer = JspUtil
+ .getCurrentContainer(jspContext);
+ Request request = JspTilesRequestContext.createServletJspRequest(
+ currentContainer.getApplicationContext(),
+ (PageContext) jspContext);
+ Map<String, Object> attributes = model.getImportedAttributes(
+ currentContainer, name, toName, ignore, request);
+ int scopeId = JspUtil.getScope(scopeName);
+ for (Map.Entry<String, Object> entry : attributes.entrySet()) {
+ jspContext.setAttribute(entry.getKey(), entry.getValue(), scopeId);
+ }
+ }
}
Modified: tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java
URL: http://svn.apache.org/viewvc/tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java?rev=836180&r1=836179&r2=836180&view=diff
==============================================================================
--- tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java (original)
+++ tiles/sandbox/trunk/tiles3/tiles-jsp/src/main/java/org/apache/tiles/jsp/taglib/InsertAttributeTag.java Sat Nov 14 14:00:02 2009
@@ -45,287 +45,287 @@
*/
public class InsertAttributeTag extends SimpleTagSupport {
- /**
- * The template model.
- */
- private InsertAttributeModel model = new InsertAttributeModel(
- new DefaultAttributeResolver());
-
- /**
- * Name to insert.
- */
- private String name;
-
- /**
- * The value of the attribute.
- */
- private Object value = null;
-
- /**
- * This value is evaluated only if <code>value</code> is null and the
- * attribute with the associated <code>name</code> is null.
- *
- * @since 2.1.2
- */
- private Object defaultValue;
-
- /**
- * The type of the {@link #defaultValue}, if it is a string.
- *
- * @since 2.1.2
- */
- private String defaultValueType;
-
- /**
- * The role to check for the default value. If the user is in the specified
- * role, the default value is taken into account; otherwise, it is ignored
- * (skipped).
- *
- * @since 2.1.2
- */
- private String defaultValueRole;
-
- /**
- * The role to check. If the user is in the specified role, the tag is taken
- * into account; otherwise, the tag is ignored (skipped).
- *
- * @since 2.1.1
- */
- private String role;
-
- /**
- * The view preparer to use before the rendering.
- *
- * @since 2.1.1
- */
- private String preparer;
-
- /**
- * This flag, if <code>true</code>, flushes the content before rendering.
- *
- * @since 2.1.1
- */
- private boolean flush;
-
- /**
- * This flag, if <code>true</code>, ignores exception thrown by preparers
- * and those caused by problems with definitions.
- *
- * @since 2.1.1
- */
- private boolean ignore;
-
- /**
- * Sets the name of the attribute.
- *
- * @param value
- * The name of the attribute.
- */
- public void setName(String value) {
- this.name = value;
- }
-
- /**
- * Returns the name of the attribute.
- *
- * @return The name of the attribute.
- */
- public String getName() {
- return name;
- }
-
- /**
- * Get the value.
- *
- * @return The value.
- */
- public Object getValue() {
- return value;
- }
-
- /**
- * Set the value.
- *
- * @param value
- * The new value
- */
- public void setValue(Object value) {
- this.value = value;
- }
-
- /**
- * Returns the default value, that is evaluated only if <code>value</code>
- * is null and the attribute with the associated <code>name</code> is null.
- *
- * @return The default value.
- */
- public Object getDefaultValue() {
- return defaultValue;
- }
-
- /**
- * Sets the default value, that is evaluated only if <code>value</code> is
- * null and the attribute with the associated <code>name</code> is null.
- *
- * @param defaultValue
- * The default value to set.
- */
- public void setDefaultValue(Object defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- /**
- * Returns the default value type. It will be used only if
- * {@link #getDefaultValue()} is a string.
- *
- * @return The default value type.
- */
- public String getDefaultValueType() {
- return defaultValueType;
- }
-
- /**
- * Sets the default value type. To be used in conjunction with
- * {@link #setDefaultValue(Object)} when passing a string.
- *
- * @param defaultValueType
- * The default value type.
- */
- public void setDefaultValueType(String defaultValueType) {
- this.defaultValueType = defaultValueType;
- }
-
- /**
- * Returns the role to check for the default value. If the user is in the
- * specified role, the default value is taken into account; otherwise, it is
- * ignored (skipped).
- *
- * @return The default value role.
- */
- public String getDefaultValueRole() {
- return defaultValueRole;
- }
-
- /**
- * Sets the role to check for the default value. If the user is in the
- * specified role, the default value is taken into account; otherwise, it is
- * ignored (skipped).
- *
- * @param defaultValueRole
- * The default value role.
- */
- public void setDefaultValueRole(String defaultValueRole) {
- this.defaultValueRole = defaultValueRole;
- }
-
- /**
- * Returns the role to check. If the user is in the specified role, the tag
- * is taken into account; otherwise, the tag is ignored (skipped).
- *
- * @return The role to check.
- * @since 2.1.1
- */
- public String getRole() {
- return role;
- }
-
- /**
- * Sets the role to check. If the user is in the specified role, the tag is
- * taken into account; otherwise, the tag is ignored (skipped).
- *
- * @param role
- * The role to check.
- * @since 2.1.1
- */
- public void setRole(String role) {
- this.role = role;
- }
-
- /**
- * Returns the preparer name.
- *
- * @return The preparer name.
- * @since 2.1.1
- */
- public String getPreparer() {
- return preparer;
- }
-
- /**
- * Sets the preparer name.
- *
- * @param preparer
- * The preparer name.
- * @since 2.1.1
- */
- public void setPreparer(String preparer) {
- this.preparer = preparer;
- }
-
- /**
- * Returns the flush flag. If <code>true</code>, current page out stream is
- * flushed before insertion.
- *
- * @return The flush flag.
- * @since 2.1.1
- */
- public boolean isFlush() {
- return flush;
- }
-
- /**
- * Sets the flush flag. If <code>true</code>, current page out stream is
- * flushed before insertion.
- *
- * @param flush
- * The flush flag.
- * @since 2.1.1
- */
- public void setFlush(boolean flush) {
- this.flush = flush;
- }
-
- /**
- * Returns the ignore flag. If it is set to true, and the attribute
- * specified by the name does not exist, simply return without writing
- * anything. The default value is false, which will cause a runtime
- * exception to be thrown.
- *
- * @return The ignore flag.
- * @since 2.1.1
- */
- public boolean isIgnore() {
- return ignore;
- }
-
- /**
- * Sets the ignore flag. If this attribute is set to true, and the attribute
- * specified by the name does not exist, simply return without writing
- * anything. The default value is false, which will cause a runtime
- * exception to be thrown.
- *
- * @param ignore
- * The ignore flag.
- * @since 2.1.1
- */
- public void setIgnore(boolean ignore) {
- this.ignore = ignore;
- }
-
- /** {@inheritDoc} */
- @Override
- public void doTag() throws JspException, IOException {
- JspContext jspContext = getJspContext();
- TilesContainer currentContainer = JspUtil
- .getCurrentContainer(jspContext);
- Request request = JspTilesRequestContext.createServletJspRequest(
- currentContainer.getApplicationContext(),
- (PageContext) jspContext);
- model.start(JspUtil.getComposeStack(jspContext), currentContainer,
- ignore, preparer, role, defaultValue, defaultValueRole,
- defaultValueType, name, (Attribute) value, request);
- JspUtil.evaluateFragment(getJspBody());
- model.end(JspUtil.getComposeStack(jspContext), currentContainer,
- ignore, request);
- }
+ /**
+ * The template model.
+ */
+ private InsertAttributeModel model = new InsertAttributeModel(
+ new DefaultAttributeResolver());
+
+ /**
+ * Name to insert.
+ */
+ private String name;
+
+ /**
+ * The value of the attribute.
+ */
+ private Object value = null;
+
+ /**
+ * This value is evaluated only if <code>value</code> is null and the
+ * attribute with the associated <code>name</code> is null.
+ *
+ * @since 2.1.2
+ */
+ private Object defaultValue;
+
+ /**
+ * The type of the {@link #defaultValue}, if it is a string.
+ *
+ * @since 2.1.2
+ */
+ private String defaultValueType;
+
+ /**
+ * The role to check for the default value. If the user is in the specified
+ * role, the default value is taken into account; otherwise, it is ignored
+ * (skipped).
+ *
+ * @since 2.1.2
+ */
+ private String defaultValueRole;
+
+ /**
+ * The role to check. If the user is in the specified role, the tag is taken
+ * into account; otherwise, the tag is ignored (skipped).
+ *
+ * @since 2.1.1
+ */
+ private String role;
+
+ /**
+ * The view preparer to use before the rendering.
+ *
+ * @since 2.1.1
+ */
+ private String preparer;
+
+ /**
+ * This flag, if <code>true</code>, flushes the content before rendering.
+ *
+ * @since 2.1.1
+ */
+ private boolean flush;
+
+ /**
+ * This flag, if <code>true</code>, ignores exception thrown by preparers
+ * and those caused by problems with definitions.
+ *
+ * @since 2.1.1
+ */
+ private boolean ignore;
+
+ /**
+ * Sets the name of the attribute.
+ *
+ * @param value
+ * The name of the attribute.
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Returns the name of the attribute.
+ *
+ * @return The name of the attribute.
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Get the value.
+ *
+ * @return The value.
+ */
+ public Object getValue() {
+ return value;
+ }
+
+ /**
+ * Set the value.
+ *
+ * @param value
+ * The new value
+ */
+ public void setValue(Object value) {
+ this.value = value;
+ }
+
+ /**
+ * Returns the default value, that is evaluated only if <code>value</code>
+ * is null and the attribute with the associated <code>name</code> is null.
+ *
+ * @return The default value.
+ */
+ public Object getDefaultValue() {
+ return defaultValue;
+ }
+
+ /**
+ * Sets the default value, that is evaluated only if <code>value</code> is
+ * null and the attribute with the associated <code>name</code> is null.
+ *
+ * @param defaultValue
+ * The default value to set.
+ */
+ public void setDefaultValue(Object defaultValue) {
+ this.defaultValue = defaultValue;
+ }
+
+ /**
+ * Returns the default value type. It will be used only if
+ * {@link #getDefaultValue()} is a string.
+ *
+ * @return The default value type.
+ */
+ public String getDefaultValueType() {
+ return defaultValueType;
+ }
+
+ /**
+ * Sets the default value type. To be used in conjunction with
+ * {@link #setDefaultValue(Object)} when passing a string.
+ *
+ * @param defaultValueType
+ * The default value type.
+ */
+ public void setDefaultValueType(String defaultValueType) {
+ this.defaultValueType = defaultValueType;
+ }
+
+ /**
+ * Returns the role to check for the default value. If the user is in the
+ * specified role, the default value is taken into account; otherwise, it is
+ * ignored (skipped).
+ *
+ * @return The default value role.
+ */
+ public String getDefaultValueRole() {
+ return defaultValueRole;
+ }
+
+ /**
+ * Sets the role to check for the default value. If the user is in the
+ * specified role, the default value is taken into account; otherwise, it is
+ * ignored (skipped).
+ *
+ * @param defaultValueRole
+ * The default value role.
+ */
+ public void setDefaultValueRole(String defaultValueRole) {
+ this.defaultValueRole = defaultValueRole;
+ }
+
+ /**
+ * Returns the role to check. If the user is in the specified role, the tag
+ * is taken into account; otherwise, the tag is ignored (skipped).
+ *
+ * @return The role to check.
+ * @since 2.1.1
+ */
+ public String getRole() {
+ return role;
+ }
+
+ /**
+ * Sets the role to check. If the user is in the specified role, the tag is
+ * taken into account; otherwise, the tag is ignored (skipped).
+ *
+ * @param role
+ * The role to check.
+ * @since 2.1.1
+ */
+ public void setRole(String role) {
+ this.role = role;
+ }
+
+ /**
+ * Returns the preparer name.
+ *
+ * @return The preparer name.
+ * @since 2.1.1
+ */
+ public String getPreparer() {
+ return preparer;
+ }
+
+ /**
+ * Sets the preparer name.
+ *
+ * @param preparer
+ * The preparer name.
+ * @since 2.1.1
+ */
+ public void setPreparer(String preparer) {
+ this.preparer = preparer;
+ }
+
+ /**
+ * Returns the flush flag. If <code>true</code>, current page out stream is
+ * flushed before insertion.
+ *
+ * @return The flush flag.
+ * @since 2.1.1
+ */
+ public boolean isFlush() {
+ return flush;
+ }
+
+ /**
+ * Sets the flush flag. If <code>true</code>, current page out stream is
+ * flushed before insertion.
+ *
+ * @param flush
+ * The flush flag.
+ * @since 2.1.1
+ */
+ public void setFlush(boolean flush) {
+ this.flush = flush;
+ }
+
+ /**
+ * Returns the ignore flag. If it is set to true, and the attribute
+ * specified by the name does not exist, simply return without writing
+ * anything. The default value is false, which will cause a runtime
+ * exception to be thrown.
+ *
+ * @return The ignore flag.
+ * @since 2.1.1
+ */
+ public boolean isIgnore() {
+ return ignore;
+ }
+
+ /**
+ * Sets the ignore flag. If this attribute is set to true, and the attribute
+ * specified by the name does not exist, simply return without writing
+ * anything. The default value is false, which will cause a runtime
+ * exception to be thrown.
+ *
+ * @param ignore
+ * The ignore flag.
+ * @since 2.1.1
+ */
+ public void setIgnore(boolean ignore) {
+ this.ignore = ignore;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public void doTag() throws JspException, IOException {
+ JspContext jspContext = getJspContext();
+ TilesContainer currentContainer = JspUtil
+ .getCurrentContainer(jspContext);
+ Request request = JspTilesRequestContext.createServletJspRequest(
+ currentContainer.getApplicationContext(),
+ (PageContext) jspContext);
+ model.start(JspUtil.getComposeStack(jspContext), currentContainer,
+ ignore, preparer, role, defaultValue, defaultValueRole,
+ defaultValueType, name, (Attribute) value, request);
+ JspUtil.evaluateFragment(getJspBody());
+ model.end(JspUtil.getComposeStack(jspContext), currentContainer,
+ ignore, request);
+ }
}