You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@struts.apache.org by lu...@apache.org on 2022/11/27 08:25:02 UTC
[struts] 19/23: Add generating of Autotags and tests.
This is an automated email from the ASF dual-hosted git repository.
lukaszlenart pushed a commit to branch WW-5233-tiles
in repository https://gitbox.apache.org/repos/asf/struts.git
commit 6715a5243e9f36ec96a5397c53802adb3e01e3ee
Author: Greg Huber <gh...@apache.org>
AuthorDate: Tue Oct 11 10:19:37 2022 +0100
Add generating of Autotags and tests.
---
plugins/tiles/pom.xml | 52 +-
.../org/apache/struts2/tiles/BuildJspAutotags.java | 114 ++
.../org/apache/tiles/api/AttributeContext.java | 1 -
.../autotag/core/AutotagRuntimeException.java | 60 +
.../generate/AbstractTemplateClassGenerator.java | 143 +++
.../generate/AbstractTemplateSuiteGenerator.java | 128 +++
.../autotag/generate/BasicTemplateGenerator.java | 187 +++
.../autotag/generate/TemplateClassGenerator.java | 45 +
.../tiles/autotag/generate/TemplateGenerator.java | 56 +
.../autotag/generate/TemplateGeneratorBuilder.java | 180 +++
.../autotag/generate/TemplateGeneratorFactory.java | 32 +
.../autotag/generate/TemplateSuiteGenerator.java | 40 +
.../tiles/autotag/generate/package-info.java | 22 +
.../autotag/jsp/JspTemplateGeneratorFactory.java | 79 ++
.../org/apache/tiles/autotag/jsp/TLDGenerator.java | 60 +
.../tiles/autotag/jsp/TagClassGenerator.java | 63 ++
.../org/apache/tiles/autotag/jsp/package-info.java | 22 +
.../org/apache/tiles/autotag/tool/StringTool.java | 138 +++
.../apache/tiles/autotag/tool/package-info.java | 22 +
.../tiles/core/definition/dao/DefinitionDAO.java | 1 -
.../pattern/PatternDefinitionResolver.java | 1 -
.../pattern/PrefixedPatternDefinitionResolver.java | 1 -
.../tiles/web/jsp/taglib/AddAttributeTag.java | 97 +-
.../tiles/web/jsp/taglib/AddListAttributeTag.java | 34 +-
.../apache/tiles/web/jsp/taglib/DefinitionTag.java | 107 +-
.../tiles/web/jsp/taglib/GetAsStringTag.java | 161 +--
.../tiles/web/jsp/taglib/ImportAttributeTag.java | 92 +-
.../tiles/web/jsp/taglib/InsertAttributeTag.java | 170 +--
.../tiles/web/jsp/taglib/InsertDefinitionTag.java | 149 +--
.../tiles/web/jsp/taglib/InsertTemplateTag.java | 132 ++-
.../tiles/web/jsp/taglib/PutAttributeTag.java | 118 +-
.../tiles/web/jsp/taglib/PutListAttributeTag.java | 76 +-
.../web/jsp/taglib/SetCurrentContainerTag.java | 36 +-
.../src/main/resources/META-INF/template-suite.xml | 1188 ++++++++++++++++++++
.../src/main/resources/META-INF/tld/tiles-jsp.tld | 228 ++--
.../org/apache/tiles/autotag/jsp/bodyTag.vm} | 72 +-
.../resources/org/apache/tiles/autotag/jsp/tld.vm | 66 ++
.../org/apache/tiles/autotag/velocity.properties | 114 ++
.../jsp/JspTemplateGeneratorFactoryTest.java | 61 +
.../apache/tiles/autotag/jsp/TLDGeneratorTest.java | 129 +++
.../tiles/autotag/jsp/TagClassGeneratorTest.java | 139 +++
.../tiles/web/jsp/taglib/UseAttributeTagTest.java | 220 ++++
.../tiles/autotag/jsp/test/DoStuffNoBodyTag.java | 134 +++
.../apache/tiles/autotag/jsp/test/DoStuffTag.java | 136 +++
plugins/tiles/src/test/resources/tldtest-jsp.tld | 121 ++
45 files changed, 4594 insertions(+), 633 deletions(-)
diff --git a/plugins/tiles/pom.xml b/plugins/tiles/pom.xml
index c92bd571c..236af9172 100644
--- a/plugins/tiles/pom.xml
+++ b/plugins/tiles/pom.xml
@@ -30,6 +30,48 @@
<artifactId>struts2-tiles-plugin</artifactId>
<packaging>jar</packaging>
<name>Struts 2 Tiles Plugin</name>
+
+ <!-- mvn -P build-jsp-autotags exec:java -->
+ <profiles>
+ <profile>
+ <id>build-jsp-autotags</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>3.1.0</version>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <mainClass>org.apache.struts2.tiles.BuildJspAutotags</mainClass>
+ <arguments>
+ <!-- taglibURI -->
+ <argument>http://tiles.apache.org/tags-tiles</argument>
+ <!-- packageName -->
+ <argument>org.apache.tiles.web.jsp.taglib</argument>
+ <!-- requestClass -->
+ <argument>org.apache.tiles.request.Request</argument>
+ <!-- jspRuntime -->
+ <argument>org.apache.tiles.request.jsp.autotag.JspAutotagRuntime</argument>
+ <!-- Output folder -->
+ <argument>${project.build.directory}</argument>
+ </arguments>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
<dependencies>
<dependency>
@@ -56,8 +98,16 @@
<artifactId>log4j-jcl</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity-engine-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.thoughtworks.xstream</groupId>
+ <artifactId>xstream</artifactId>
+ </dependency>
</dependencies>
<properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
diff --git a/plugins/tiles/src/main/java/org/apache/struts2/tiles/BuildJspAutotags.java b/plugins/tiles/src/main/java/org/apache/struts2/tiles/BuildJspAutotags.java
new file mode 100644
index 000000000..64aa03254
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/struts2/tiles/BuildJspAutotags.java
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.tiles;
+
+import java.io.File;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.tiles.autotag.generate.TemplateGenerator;
+import org.apache.tiles.autotag.generate.TemplateGeneratorBuilder;
+import org.apache.tiles.autotag.jsp.JspTemplateGeneratorFactory;
+import org.apache.tiles.autotag.model.TemplateSuite;
+import org.apache.velocity.app.VelocityEngine;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+/**
+ * Helper class for building the JSP tag classes and .tld file.
+ */
+public class BuildJspAutotags {
+
+ public BuildJspAutotags() {
+ }
+
+ /**
+ * The main method.
+ *
+ * @param args the arguments
+ */
+ public static void main(String[] args) {
+
+ BuildJspAutotags me = new BuildJspAutotags();
+
+ me.build(args[0], args[1], args[2], args[3], args[4]);
+
+ }
+
+ /**
+ * Build
+ *
+ * @param taglibURI the taglib URI
+ * @param packageName the package name
+ * @param requestClass the request class
+ * @param jspRuntime the jsp runtime
+ * @param outputDir the output dir
+ */
+ public void build(String taglibURI, String packageName, String requestClass, String jspRuntime, String outputDir) {
+
+ // Default values
+ // taglibURI = "org.apache.tiles.autotag.jsp.runtime.Runtime";
+ // packageName = "org.apache.tiles.web.jsp.taglib";
+ // requestClass = "org.apache.tiles.request.Request";
+ // jspRuntime = "org.apache.tiles.autotag.jsp.runtime.Runtime";
+ // outputDir = "/target"
+
+ Map<String, String> parameters = new HashMap<String, String>();
+ parameters.put("taglibURI", taglibURI);
+
+ try {
+
+ TemplateSuite suite;
+
+ InputStream stream = getClass().getResourceAsStream("/META-INF/template-suite.xml");
+
+ try {
+ XStream xstream = new XStream(new DomDriver());
+ xstream.allowTypes(new Class[] { org.apache.tiles.autotag.model.TemplateClass.class,
+ org.apache.tiles.autotag.model.TemplateSuite.class,
+ org.apache.tiles.autotag.model.TemplateParameter.class });
+ suite = (TemplateSuite) xstream.fromXML(stream);
+ } finally {
+ stream.close();
+ }
+
+ Properties props = new Properties();
+ InputStream propsStream = getClass().getResourceAsStream("/org/apache/tiles/autotag/velocity.properties");
+ props.load(propsStream);
+ propsStream.close();
+
+ File classesOutputDirectory = new File(outputDir + "/generated-sources/autotag/classes");
+ File resourcesOutputDirectory = new File(outputDir + "/generated-sources/autotag");
+
+ TemplateGenerator generator = new JspTemplateGeneratorFactory(classesOutputDirectory,
+ resourcesOutputDirectory, new VelocityEngine(props), TemplateGeneratorBuilder.createNewInstance())
+ .createTemplateGenerator();
+
+ generator.generate(packageName, suite, parameters, jspRuntime, requestClass);
+
+ } catch (Exception e) {
+ // ignored
+ }
+
+ }
+
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/api/AttributeContext.java b/plugins/tiles/src/main/java/org/apache/tiles/api/AttributeContext.java
index 24c4fa5fa..554bd9ec0 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/api/AttributeContext.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/api/AttributeContext.java
@@ -25,7 +25,6 @@ import java.util.Set;
* Encapsulation of the current state of execution.
*
* @since Tiles 2.0
- * @version $Rev$ $Date$
*/
public interface AttributeContext {
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/AutotagRuntimeException.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/AutotagRuntimeException.java
new file mode 100644
index 000000000..188dae269
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/core/AutotagRuntimeException.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.core;
+
+/**
+ * Generic exception for Autotag.
+ */
+public class AutotagRuntimeException extends RuntimeException {
+
+ /**
+ * Constructor.
+ */
+ public AutotagRuntimeException() {
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message The message of the exception.
+ */
+ public AutotagRuntimeException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param cause The cause.
+ */
+ public AutotagRuntimeException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructor.
+ *
+ * @param message The message of the exception.
+ * @param cause The cause.
+ */
+ public AutotagRuntimeException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/AbstractTemplateClassGenerator.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/AbstractTemplateClassGenerator.java
new file mode 100644
index 000000000..009d6d1a5
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/AbstractTemplateClassGenerator.java
@@ -0,0 +1,143 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.generate;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Map;
+
+import org.apache.tiles.autotag.core.AutotagRuntimeException;
+import org.apache.tiles.autotag.model.TemplateClass;
+import org.apache.tiles.autotag.model.TemplateSuite;
+import org.apache.tiles.autotag.tool.StringTool;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.exception.ParseErrorException;
+import org.apache.velocity.exception.ResourceNotFoundException;
+
+/**
+ * A base template class generator.
+ */
+public abstract class AbstractTemplateClassGenerator implements
+ TemplateClassGenerator {
+
+ /**
+ * The Velocity engine to use.
+ */
+ private VelocityEngine velocityEngine;
+
+ /**
+ * Constructor.
+ *
+ * @param velocityEngine The Velocity engine.
+ */
+ public AbstractTemplateClassGenerator(VelocityEngine velocityEngine) {
+ this.velocityEngine = velocityEngine;
+ }
+
+ @Override
+ public void generate(File directory, String packageName,
+ TemplateSuite suite, TemplateClass clazz, Map<String, String> parameters,
+ String runtimeClass, String requestClass) {
+ File dir = new File(directory, getDirectoryName(directory, packageName,
+ suite, clazz, parameters, runtimeClass, requestClass));
+ dir.mkdirs();
+ File file = new File(dir, getFilename(dir, packageName, suite, clazz, parameters, runtimeClass, requestClass));
+ VelocityContext context = new VelocityContext();
+ context.put("packageName", packageName);
+ context.put("suite", suite);
+ context.put("clazz", clazz);
+ context.put("stringTool", new StringTool());
+ context.put("parameters", parameters);
+ context.put("runtimeClass", runtimeClass);
+ context.put("requestClass", requestClass);
+ try {
+ file.createNewFile();
+ Template template = velocityEngine.getTemplate(getTemplatePath(dir,
+ packageName, suite, clazz, parameters, runtimeClass, requestClass));
+ Writer writer = new FileWriter(file);
+ try {
+ template.merge(context, writer);
+ } finally {
+ writer.close();
+ }
+ } catch (ResourceNotFoundException e) {
+ throw new AutotagRuntimeException("Cannot find template resource",
+ e);
+ } catch (ParseErrorException e) {
+ throw new AutotagRuntimeException(
+ "The template resource is not parseable", e);
+ } catch (IOException e) {
+ throw new AutotagRuntimeException(
+ "I/O Exception when generating file", e);
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new AutotagRuntimeException(
+ "Another generic exception while parsing the template resource",
+ e);
+ }
+ }
+
+ /**
+ * Calculates and returns the template path.
+ *
+ * @param directory The directory where the file will be written.
+ * @param packageName The name of the package.
+ * @param suite The template suite.
+ * @param clazz The template class.
+ * @param parameters The map of parameters.
+ * @return The template path.
+ */
+ protected abstract String getTemplatePath(File directory,
+ String packageName, TemplateSuite suite, TemplateClass clazz, Map<String, String> parameters,
+ String runtimeClass, String requestClass);
+
+ /**
+ * Calculates and returns the filename of the generated file.
+ *
+ * @param directory The directory where the file will be written.
+ * @param packageName The name of the package.
+ * @param suite The template suite.
+ * @param clazz The template class.
+ * @param parameters The map of parameters.
+ * @return The template path.
+ */
+ protected abstract String getFilename(File directory, String packageName,
+ TemplateSuite suite, TemplateClass clazz, Map<String, String> parameters, String runtimeClass,
+ String requestClass);
+
+ /**
+ * Calculates and returns the directory where the file will be written..
+ *
+ * @param directory The directory where the file will be written.
+ * @param packageName The name of the package.
+ * @param suite The template suite.
+ * @param clazz The template class.
+ * @param parameters The map of parameters.
+ * @return The template path.
+ */
+ protected abstract String getDirectoryName(File directory,
+ String packageName, TemplateSuite suite, TemplateClass clazz, Map<String, String> parameters,
+ String runtimeClass, String requestClass);
+
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/AbstractTemplateSuiteGenerator.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/AbstractTemplateSuiteGenerator.java
new file mode 100644
index 000000000..16e3234b6
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/AbstractTemplateSuiteGenerator.java
@@ -0,0 +1,128 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.generate;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.Map;
+
+import org.apache.tiles.autotag.core.AutotagRuntimeException;
+import org.apache.tiles.autotag.model.TemplateSuite;
+import org.apache.tiles.autotag.tool.StringTool;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.VelocityEngine;
+import org.apache.velocity.exception.ParseErrorException;
+import org.apache.velocity.exception.ResourceNotFoundException;
+
+/**
+ * A base template suite generator.
+ */
+public abstract class AbstractTemplateSuiteGenerator implements TemplateSuiteGenerator {
+
+ /**
+ * The velocity engine.
+ */
+ private VelocityEngine velocityEngine;
+
+ /**
+ * Constructor.
+ *
+ * @param velocityEngine The Velocity engine.
+ */
+ public AbstractTemplateSuiteGenerator(VelocityEngine velocityEngine) {
+ this.velocityEngine = velocityEngine;
+ }
+
+ @Override
+ public void generate(File directory, String packageName, TemplateSuite suite, Map<String, String> parameters) {
+ File dir = new File(directory, getDirectoryName(directory, packageName, suite, parameters));
+ dir.mkdirs();
+ File file = new File(dir, getFilename(dir, packageName, suite, parameters));
+ VelocityContext context = new VelocityContext();
+ context.put("packageName", packageName);
+ context.put("suite", suite);
+ context.put("stringTool", new StringTool());
+ context.put("parameters", parameters);
+ try {
+ file.createNewFile();
+ Template template = velocityEngine.getTemplate(getTemplatePath(dir,
+ packageName, suite, parameters));
+ Writer writer = new FileWriter(file);
+ try {
+ template.merge(context, writer);
+ } finally {
+ writer.close();
+ }
+ } catch (ResourceNotFoundException e) {
+ throw new AutotagRuntimeException("Cannot find template resource", e);
+ } catch (ParseErrorException e) {
+ throw new AutotagRuntimeException("The template resource is not parseable", e);
+ } catch (IOException e) {
+ throw new AutotagRuntimeException(
+ "I/O Exception when generating file", e);
+ } catch (RuntimeException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new AutotagRuntimeException(
+ "Another generic exception while parsing the template resource",
+ e);
+ }
+ }
+
+ /**
+ * Calculates and returns the template path.
+ *
+ * @param directory The directory where the file will be written.
+ * @param packageName The name of the package.
+ * @param suite The template suite.
+ * @param parameters The map of parameters.
+ * @return The template path.
+ */
+ protected abstract String getTemplatePath(File directory,
+ String packageName, TemplateSuite suite,
+ Map<String, String> parameters);
+
+ /**
+ * Calculates and returns the filename of the generated file.
+ *
+ * @param directory The directory where the file will be written.
+ * @param packageName The name of the package.
+ * @param suite The template suite.
+ * @param parameters The map of parameters.
+ * @return The template path.
+ */
+ protected abstract String getFilename(File directory, String packageName,
+ TemplateSuite suite, Map<String, String> parameters);
+
+ /**
+ * Calculates and returns the directory where the file will be written..
+ *
+ * @param directory The directory where the file will be written.
+ * @param packageName The name of the package.
+ * @param suite The template suite.
+ * @param parameters The map of parameters.
+ * @return The template path.
+ */
+ protected abstract String getDirectoryName(File directory,
+ String packageName, TemplateSuite suite,
+ Map<String, String> parameters);
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/BasicTemplateGenerator.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/BasicTemplateGenerator.java
new file mode 100644
index 000000000..e9b27b060
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/BasicTemplateGenerator.java
@@ -0,0 +1,187 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.generate;
+
+import java.io.File;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tiles.autotag.model.TemplateClass;
+import org.apache.tiles.autotag.model.TemplateSuite;
+
+/**
+ * The basic template generator. Use {@link TemplateGeneratorBuilder} to
+ * create instances of this class.
+ */
+class BasicTemplateGenerator implements TemplateGenerator {
+
+ /**
+ * The template suite generators.
+ */
+ private List<TSGeneratorDirectoryPair> templateSuiteGenerators;
+
+ /**
+ * The template class generators.
+ */
+ private List<TCGeneratorDirectoryPair> templateClassGenerators;
+
+ /**
+ * Indicates that this generator generates resources.
+ */
+ private boolean generatingResources = false;
+
+ /**
+ * Indicates that this generator generates classes.
+ */
+ private boolean generatingClasses = false;
+
+ /**
+ * Constructor.
+ *
+ * @param templateSuiteGenerators The template suite generators.
+ * @param templateClassGenerators The template class generators.
+ * @param generatingClasses Indicates that this generator generates classes.
+ * @param generatingResources Indicates that this generator generates resources.
+ */
+ BasicTemplateGenerator(
+ List<TSGeneratorDirectoryPair> templateSuiteGenerators,
+ List<TCGeneratorDirectoryPair> templateClassGenerators,
+ boolean generatingClasses, boolean generatingResources) {
+ this.templateSuiteGenerators = templateSuiteGenerators;
+ this.templateClassGenerators = templateClassGenerators;
+ this.generatingClasses = generatingClasses;
+ this.generatingResources = generatingResources;
+ }
+
+
+
+ @Override
+ public void generate(String packageName, TemplateSuite suite, Map<String, String> parameters,
+ String runtimeClass, String requestClass) {
+ for (TSGeneratorDirectoryPair pair : templateSuiteGenerators) {
+ pair.getGenerator().generate(pair.getDirectory(), packageName, suite, parameters);
+ }
+ for (TemplateClass templateClass : suite.getTemplateClasses()) {
+ for (TCGeneratorDirectoryPair pair : templateClassGenerators) {
+ pair.getGenerator().generate(pair.getDirectory(), packageName,
+ suite, templateClass, parameters, runtimeClass, requestClass);
+ }
+ }
+ }
+
+ /**
+ * A pair of a template suite generator and a directory.
+ */
+ static class TSGeneratorDirectoryPair {
+ /**
+ * The directory where files are generated.
+ */
+ private File directory;
+
+ /**
+ * The generator.
+ */
+ private TemplateSuiteGenerator generator;
+
+ /**
+ * Constructor.
+ *
+ * @param directory The directory where files are generated.
+ * @param generator The generator.
+ */
+ public TSGeneratorDirectoryPair(File directory,
+ TemplateSuiteGenerator generator) {
+ this.directory = directory;
+ this.generator = generator;
+ }
+
+ /**
+ * Returns the directory where files are generated.
+ *
+ * @return The directory where files are generated.
+ */
+ public File getDirectory() {
+ return directory;
+ }
+
+ /**
+ * Returns the generator.
+ *
+ * @return The generator.
+ */
+ public TemplateSuiteGenerator getGenerator() {
+ return generator;
+ }
+ }
+
+ /**
+ * A pair of a template class generator and a directory.
+ */
+ static class TCGeneratorDirectoryPair {
+ /**
+ * The directory where files are generated.
+ */
+ private File directory;
+
+ /**
+ * The generator.
+ */
+ private TemplateClassGenerator generator;
+
+ /**
+ * Constructor.
+ *
+ * @param directory The directory where files are generated.
+ * @param generator The generator.
+ */
+ public TCGeneratorDirectoryPair(File directory,
+ TemplateClassGenerator generator) {
+ this.directory = directory;
+ this.generator = generator;
+ }
+
+ /**
+ * Returns the directory where files are generated.
+ *
+ * @return The directory where files are generated.
+ */
+ public File getDirectory() {
+ return directory;
+ }
+
+ /**
+ * Returns the generator.
+ *
+ * @return The generator.
+ */
+ public TemplateClassGenerator getGenerator() {
+ return generator;
+ }
+ }
+
+ @Override
+ public boolean isGeneratingResources() {
+ return generatingResources;
+ }
+
+ @Override
+ public boolean isGeneratingClasses() {
+ return generatingClasses;
+ }
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateClassGenerator.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateClassGenerator.java
new file mode 100644
index 000000000..3d958beef
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateClassGenerator.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.generate;
+
+import java.io.File;
+import java.util.Map;
+
+import org.apache.tiles.autotag.model.TemplateClass;
+import org.apache.tiles.autotag.model.TemplateSuite;
+
+/**
+ * Generates code from a parsed class.
+ */
+public interface TemplateClassGenerator {
+
+ /**
+ * Generates the code.
+ *
+ * @param directory The base directory where the code will be put.
+ * @param packageName The package name.
+ * @param suite The template suite.
+ * @param clazz The template class.
+ * @param parameters Configuration parameters.
+ * @param runtimeClass The RequestBuilder implementation.
+ */
+ void generate(File directory, String packageName, TemplateSuite suite,
+ TemplateClass clazz, Map<String, String> parameters,
+ String runtimeClass, String requestClass);
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateGenerator.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateGenerator.java
new file mode 100644
index 000000000..9e462ff2d
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateGenerator.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.generate;
+
+
+import java.util.Map;
+
+import org.apache.tiles.autotag.model.TemplateSuite;
+
+/**
+ * Generates all the code for a template suite.
+ */
+public interface TemplateGenerator {
+
+ /**
+ * Generates the code.
+ *
+ * @param packageName The package name.
+ * @param suite The template suite.
+ * @param parameters Configuration parameters.
+ * @param runtimeClass The RequestBuilder implementation.
+ * @param requestClass The request class to use.
+ */
+ void generate(String packageName, TemplateSuite suite, Map<String, String> parameters,
+ String runtimeClass, String requestClass);
+
+ /**
+ * Indicates that this generator generates resources.
+ *
+ * @return <code>true</code> if the generator generates resources.
+ */
+ boolean isGeneratingResources();
+
+ /**
+ * Indicates that this generator generates classes.
+ *
+ * @return <code>true</code> if the generator generates classes.
+ */
+ boolean isGeneratingClasses();
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateGeneratorBuilder.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateGeneratorBuilder.java
new file mode 100644
index 000000000..943175da6
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateGeneratorBuilder.java
@@ -0,0 +1,180 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.generate;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tiles.autotag.generate.BasicTemplateGenerator.TCGeneratorDirectoryPair;
+import org.apache.tiles.autotag.generate.BasicTemplateGenerator.TSGeneratorDirectoryPair;
+
+/**
+ * Builds a TemplateGenerator.
+ */
+public class TemplateGeneratorBuilder {
+
+ /**
+ * The template suite generators.
+ */
+ private List<TSGeneratorDirectoryPair> templateSuiteGenerators;
+
+ /**
+ * The template class generators.
+ */
+ private List<TCGeneratorDirectoryPair> templateClassGenerators;
+
+ /**
+ * Indicates that this generator generates resources.
+ */
+ private boolean generatingResources = false;
+
+ /**
+ * Indicates that this generator generates classes.
+ */
+ private boolean generatingClasses = false;
+
+ /**
+ * The classes output directory.
+ */
+ private File classesOutputDirectory;
+
+ /**
+ * The resources output directory.
+ */
+ private File resourcesOutputDirectory;
+
+ /**
+ * Constructor.
+ */
+ private TemplateGeneratorBuilder() {
+ templateSuiteGenerators = new ArrayList<BasicTemplateGenerator.TSGeneratorDirectoryPair>();
+ templateClassGenerators = new ArrayList<BasicTemplateGenerator.TCGeneratorDirectoryPair>();
+ }
+
+ /**
+ * Creates a new instance of the builder.
+ *
+ * @return A new instance of the builder.
+ */
+ public static TemplateGeneratorBuilder createNewInstance() {
+ return new TemplateGeneratorBuilder();
+ }
+
+ /**
+ * Sets the classes output directory.
+ *
+ * @param classesOutputDirectory The classes output directory.
+ * @return This instance.
+ */
+ public TemplateGeneratorBuilder setClassesOutputDirectory(File classesOutputDirectory) {
+ this.classesOutputDirectory = classesOutputDirectory;
+ return this;
+ }
+
+ /**
+ * Sets the resources output directory.
+ *
+ * @param resourcesOutputDirectory The resources output directory.
+ * @return This instance.
+ */
+ public TemplateGeneratorBuilder setResourcesOutputDirectory(File resourcesOutputDirectory) {
+ this.resourcesOutputDirectory = resourcesOutputDirectory;
+ return this;
+ }
+
+ /**
+ * Adds a new template suite generator to generate classes.
+ *
+ * @param generator The generator to add.
+ * @return This instance.
+ */
+ public TemplateGeneratorBuilder addClassesTemplateSuiteGenerator(TemplateSuiteGenerator generator) {
+ if (classesOutputDirectory == null) {
+ throw new NullPointerException(
+ "Classes output directory not specified, call 'setClassesOutputDirectory' first");
+ }
+ templateSuiteGenerators.add(new TSGeneratorDirectoryPair(
+ classesOutputDirectory, generator));
+ generatingClasses = true;
+ return this;
+ }
+
+ /**
+ * Adds a new template class generator to generate classes.
+ *
+ * @param generator The generator to add.
+ * @return This instance.
+ */
+ public TemplateGeneratorBuilder addClassesTemplateClassGenerator(TemplateClassGenerator generator) {
+ if (classesOutputDirectory == null) {
+ throw new NullPointerException(
+ "Classes output directory not specified, call 'setClassesOutputDirectory' first");
+ }
+ templateClassGenerators.add(new TCGeneratorDirectoryPair(
+ classesOutputDirectory, generator));
+ generatingClasses = true;
+ return this;
+ }
+
+ /**
+ * Adds a new template suite generator to generate resources.
+ *
+ * @param generator The generator to add.
+ * @return This instance.
+ */
+ public TemplateGeneratorBuilder addResourcesTemplateSuiteGenerator(TemplateSuiteGenerator generator) {
+ if (resourcesOutputDirectory == null) {
+ throw new NullPointerException(
+ "Resources output directory not specified, call 'setClassesOutputDirectory' first");
+ }
+ templateSuiteGenerators.add(new TSGeneratorDirectoryPair(
+ resourcesOutputDirectory, generator));
+ generatingResources = true;
+ return this;
+ }
+
+ /**
+ * Adds a new template class generator to generate resources.
+ *
+ * @param generator The generator to add.
+ * @return This instance.
+ */
+ public TemplateGeneratorBuilder addResourcesTemplateClassGenerator(TemplateClassGenerator generator) {
+ if (resourcesOutputDirectory == null) {
+ throw new NullPointerException(
+ "Resources output directory not specified, call 'setClassesOutputDirectory' first");
+ }
+ templateClassGenerators.add(new TCGeneratorDirectoryPair(
+ resourcesOutputDirectory, generator));
+ generatingResources = true;
+ return this;
+ }
+
+ /**
+ * Builds and returns a new template generator.
+ *
+ * @return The new template generator.
+ */
+ public TemplateGenerator build() {
+ return new BasicTemplateGenerator(templateSuiteGenerators,
+ templateClassGenerators, generatingClasses, generatingResources);
+ }
+
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateGeneratorFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateGeneratorFactory.java
new file mode 100644
index 000000000..11fbf693f
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateGeneratorFactory.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.generate;
+
+/**
+ * Creates a new template generator.
+ */
+public interface TemplateGeneratorFactory {
+
+ /**
+ * Creates a template generator.
+ *
+ * @return The newly created template generator.
+ */
+ TemplateGenerator createTemplateGenerator();
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateSuiteGenerator.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateSuiteGenerator.java
new file mode 100644
index 000000000..f8986779d
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/TemplateSuiteGenerator.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.generate;
+
+import java.io.File;
+import java.util.Map;
+
+import org.apache.tiles.autotag.model.TemplateSuite;
+
+/**
+ * Generates code from a template suite.
+ */
+public interface TemplateSuiteGenerator {
+
+ /**
+ * Generates the code.
+ *
+ * @param directory The base directory where the code will be put.
+ * @param packageName The package name.
+ * @param suite The template suite.
+ * @param parameters Configuration parameters.
+ */
+ void generate(File directory, String packageName, TemplateSuite suite, Map<String, String> parameters);
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/package-info.java
new file mode 100644
index 000000000..2fbdf2ae0
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/generate/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/**
+ * The Autotag generation classes.
+ */
+package org.apache.tiles.autotag.generate;
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/JspTemplateGeneratorFactory.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/JspTemplateGeneratorFactory.java
new file mode 100644
index 000000000..90c7ce32e
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/JspTemplateGeneratorFactory.java
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.jsp;
+
+import java.io.File;
+
+import org.apache.tiles.autotag.generate.TemplateGenerator;
+import org.apache.tiles.autotag.generate.TemplateGeneratorBuilder;
+import org.apache.tiles.autotag.generate.TemplateGeneratorFactory;
+import org.apache.velocity.app.VelocityEngine;
+
+/**
+ * Creates a template generator to build JSP code around template models.
+ */
+public class JspTemplateGeneratorFactory implements TemplateGeneratorFactory {
+
+ /**
+ * Location of the file.
+ */
+ private File classesOutputDirectory;
+
+ /**
+ * Location of the file.
+ */
+ private File resourcesOutputDirectory;
+
+ /**
+ * The Velocity engine.
+ */
+ private VelocityEngine velocityEngine;
+
+ /**
+ * The template generator builder.
+ */
+ private TemplateGeneratorBuilder templateGeneratorBuilder;
+
+ /**
+ * Constructor.
+ *
+ * @param classesOutputDirectory The directory where classes will be
+ * generated.
+ * @param resourcesOutputDirectory The directory where the TLD file will be
+ * generated.
+ * @param velocityEngine The Velocity engine.
+ * @param templateGeneratorBuilder The template generator builder.
+ */
+ public JspTemplateGeneratorFactory(File classesOutputDirectory, File resourcesOutputDirectory,
+ VelocityEngine velocityEngine, TemplateGeneratorBuilder templateGeneratorBuilder) {
+ this.classesOutputDirectory = classesOutputDirectory;
+ this.resourcesOutputDirectory = resourcesOutputDirectory;
+ this.velocityEngine = velocityEngine;
+ this.templateGeneratorBuilder = templateGeneratorBuilder;
+ }
+
+ @Override
+ public TemplateGenerator createTemplateGenerator() {
+ return templateGeneratorBuilder.setClassesOutputDirectory(classesOutputDirectory)
+ .setResourcesOutputDirectory(resourcesOutputDirectory)
+ .addResourcesTemplateSuiteGenerator(new TLDGenerator(velocityEngine))
+ .addClassesTemplateClassGenerator(new TagClassGenerator(velocityEngine)).build();
+ }
+
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/TLDGenerator.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/TLDGenerator.java
new file mode 100644
index 000000000..28d947d6e
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/TLDGenerator.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.jsp;
+
+import java.io.File;
+import java.util.Map;
+
+import org.apache.tiles.autotag.generate.AbstractTemplateSuiteGenerator;
+import org.apache.tiles.autotag.model.TemplateSuite;
+import org.apache.velocity.app.VelocityEngine;
+
+/**
+ * Generates the TLD file, using a template suite.
+ */
+public class TLDGenerator extends AbstractTemplateSuiteGenerator {
+
+ /**
+ * Constructor.
+ *
+ * @param velocityEngine The Velocity engine.
+ */
+ public TLDGenerator(VelocityEngine velocityEngine) {
+ super(velocityEngine);
+ }
+
+ @Override
+ protected String getTemplatePath(File directory, String packageName,
+ TemplateSuite suite, Map<String, String> parameters) {
+ return "/org/apache/tiles/autotag/jsp/tld.vm";
+ }
+
+ @Override
+ protected String getFilename(File directory, String packageName,
+ TemplateSuite suite, Map<String, String> parameters) {
+ return suite.getName() + "-jsp.tld";
+ }
+
+ @Override
+ protected String getDirectoryName(File directory, String packageName,
+ TemplateSuite suite, Map<String, String> parameters) {
+ return "META-INF/tld/";
+ }
+
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/TagClassGenerator.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/TagClassGenerator.java
new file mode 100644
index 000000000..c0ee919de
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/TagClassGenerator.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.jsp;
+
+import java.io.File;
+import java.util.Map;
+
+import org.apache.tiles.autotag.generate.AbstractTemplateClassGenerator;
+import org.apache.tiles.autotag.model.TemplateClass;
+import org.apache.tiles.autotag.model.TemplateSuite;
+import org.apache.velocity.app.VelocityEngine;
+
+/**
+ * Generates a tag class using a template class.
+ */
+public class TagClassGenerator extends AbstractTemplateClassGenerator {
+
+ /**
+ * Constructor.
+ *
+ * @param velocityEngine The Velocity engine.
+ */
+ public TagClassGenerator(VelocityEngine velocityEngine) {
+ super(velocityEngine);
+ }
+
+ @Override
+ protected String getDirectoryName(File directory, String packageName,
+ TemplateSuite suite, TemplateClass clazz, Map<String, String> parameters,
+ String runtimeClass, String requestClass) {
+ return packageName.replaceAll("\\.", "/");
+ }
+
+ @Override
+ protected String getFilename(File directory, String packageName,
+ TemplateSuite suite, TemplateClass clazz, Map<String, String> parameters,
+ String runtimeClass, String requestClass) {
+ return clazz.getTagClassPrefix() + "Tag.java";
+ }
+
+ @Override
+ protected String getTemplatePath(File directory, String packageName,
+ TemplateSuite suite, TemplateClass clazz, Map<String, String> parameters,
+ String runtimeClass, String requestClass) {
+ return "/org/apache/tiles/autotag/jsp/bodyTag.vm";
+ }
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/package-info.java
new file mode 100644
index 000000000..f142dabfa
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/jsp/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/**
+ * Autotag support for JavaServer Pages.
+ */
+package org.apache.tiles.autotag.jsp;
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/tool/StringTool.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/tool/StringTool.java
new file mode 100644
index 000000000..247529835
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/tool/StringTool.java
@@ -0,0 +1,138 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.tool;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.tiles.autotag.core.AutotagRuntimeException;
+
+/**
+ * A Velocity tools to manipulate strings.
+ */
+public class StringTool {
+
+ /**
+ * Maps a primitive type to its default value as a string.
+ */
+ private Map<String, String> type2default;
+
+ /**
+ * Maps a primitive type to its boxed version.
+ */
+ private Map<String, String> primitive2wrapped;
+
+ /**
+ * Constructor.
+ */
+ public StringTool() {
+ type2default = new HashMap<String, String>();
+ type2default.put("byte", "0");
+ type2default.put("short", "0");
+ type2default.put("int", "0");
+ type2default.put("long", "0L");
+ type2default.put("float", "0.0f");
+ type2default.put("double", "0.0d");
+ type2default.put("char", "'\\u0000'");
+ type2default.put("boolean", "false");
+
+ primitive2wrapped = new HashMap<String, String>();
+ primitive2wrapped.put("byte", Byte.class.getName());
+ primitive2wrapped.put("short", Short.class.getName());
+ primitive2wrapped.put("int", Integer.class.getName());
+ primitive2wrapped.put("long", Long.class.getName());
+ primitive2wrapped.put("float", Float.class.getName());
+ primitive2wrapped.put("double", Double.class.getName());
+ primitive2wrapped.put("char", Character.class.getName());
+ primitive2wrapped.put("boolean", Boolean.class.getName());
+ }
+
+ /**
+ * Creates a list of strings, separating a string when a newline is encountered.
+ *
+ * @param toSplit The string to split.
+ * @return The list of splitted strings.
+ */
+ public List<String> splitOnNewlines(String toSplit) {
+ List<String> retValue = new ArrayList<String>();
+ if (toSplit == null) {
+ return retValue;
+ }
+ Reader reader = new StringReader(toSplit);
+ BufferedReader bufReader = new BufferedReader(reader);
+ try {
+ String line;
+ while ((line = bufReader.readLine()) != null) {
+ retValue.add(line);
+ }
+ } catch (IOException e) {
+ throw new AutotagRuntimeException("Cannot read the string completely", e);
+ }
+ return retValue;
+ }
+
+ /**
+ * Creates a string in which the first character is capitalized.
+ *
+ * @param string The string to use.
+ * @return The same string with the first character capitalized.
+ */
+ public String capitalizeFirstLetter(String string) {
+ return string.substring(0, 1).toUpperCase() + string.substring(1);
+ }
+
+ /**
+ * Returns the default value for a type.
+ *
+ * @param type The type.
+ * @param overriddenDefaultValue The default value, as specified by developers.
+ * @return The default value to use.
+ */
+ public String getDefaultValue(String type, String overriddenDefaultValue) {
+ if (overriddenDefaultValue != null) {
+ return overriddenDefaultValue;
+ }
+
+ String retValue = type2default.get(type);
+ if (retValue == null) {
+ retValue = "null";
+ }
+ return retValue;
+ }
+
+ /**
+ * Returns the class to be used to cast an Object.
+ *
+ * @param type The type to use, even a primitive type.
+ * @return The class to be used in casts.
+ */
+ public String getClassToCast(String type) {
+ String retValue = primitive2wrapped.get(type);
+ if (retValue == null) {
+ retValue = type;
+ }
+ return retValue;
+ }
+}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/autotag/tool/package-info.java b/plugins/tiles/src/main/java/org/apache/tiles/autotag/tool/package-info.java
new file mode 100644
index 000000000..b58748ab0
--- /dev/null
+++ b/plugins/tiles/src/main/java/org/apache/tiles/autotag/tool/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+/**
+ * Velocity tools to be used in Velocity templates.
+ */
+package org.apache.tiles.autotag.tool;
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/DefinitionDAO.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/DefinitionDAO.java
index 45358a25a..ce0b1ef4a 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/DefinitionDAO.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/dao/DefinitionDAO.java
@@ -27,7 +27,6 @@ import java.util.Map;
* customization key.
*
* @param <K> The customization key class.
- * @version $Rev$ $Date$
* @since 2.1.0
*/
public interface DefinitionDAO<K> {
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolver.java
index 0e3d397a3..959f082b9 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PatternDefinitionResolver.java
@@ -26,7 +26,6 @@ import java.util.Map;
* Resolves a definition starting from patterns stored in definition maps.
*
* @param <T> The type of the customization key.
- * @version $Rev$ $Date$
* @since 2.2.0
*/
public interface PatternDefinitionResolver<T> {
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PrefixedPatternDefinitionResolver.java b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PrefixedPatternDefinitionResolver.java
index 42095e43f..a2148f1d8 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PrefixedPatternDefinitionResolver.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/core/definition/pattern/PrefixedPatternDefinitionResolver.java
@@ -37,7 +37,6 @@ import java.util.Set;
* method before using this resolver.
*
* @param <T> The type of the customization key.
- * @version $Rev$ $Date$
* @since 2.2.0
*/
public class PrefixedPatternDefinitionResolver<T> extends AbstractPatternDefinitionResolver<T> {
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/AddAttributeTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/AddAttributeTag.java
index a5bd36b04..affe32dcc 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/AddAttributeTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/AddAttributeTag.java
@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+ /*
+ * This file was automatically generated by Apache Tiles Autotag.
+ */
package org.apache.tiles.web.jsp.taglib;
import java.io.IOException;
@@ -24,15 +27,12 @@ import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import org.apache.tiles.autotag.core.runtime.ModelBody;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
-import org.apache.tiles.template.AddAttributeModel;
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
/**
* <p>
- * Add an element to the surrounding list. Equivalent to 'putAttribute', but for
- * list element.
+ * Add an element to the surrounding list. Equivalent to 'putAttribute',
+ * but for list element.
* </p>
*
* <p>
@@ -46,112 +46,120 @@ public class AddAttributeTag extends SimpleTagSupport {
/**
* The template model.
*/
- private AddAttributeModel model = new AddAttributeModel();
+ private org.apache.tiles.template.AddAttributeModel model = new org.apache.tiles.template.AddAttributeModel();
/**
- * The value of the attribute. Use this parameter, or expression, or body.
+ * The value of the attribute. Use this parameter, or
+ * expression, or body.
*/
- private Object value;
+ private java.lang.Object value;
/**
- * The expression to calculate the value from. Use this parameter, or value, or
- * body.
+ * The expression to calculate the value from. Use this
+ * parameter, or value, or body.
*/
- private String expression;
+ private java.lang.String expression;
/**
- * A comma-separated list of roles. If present, the attribute will be rendered
- * only if the current user belongs to one of the roles.
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- private String role;
+ private java.lang.String role;
/**
* The type (renderer) of the attribute.
*/
- private String type;
+ private java.lang.String type;
/**
* Getter for value property.
*
- * @return The value of the attribute. Use this parameter, or expression, or
- * body.
+ * @return
+ * The value of the attribute. Use this parameter, or
+ * expression, or body.
*/
- public Object getValue() {
+ public java.lang.Object getValue() {
return value;
}
/**
* Setter for value property.
*
- * @param value The value of the attribute. Use this parameter, or expression,
- * or body.
+ * @param value
+ * The value of the attribute. Use this parameter, or
+ * expression, or body.
*/
- public void setValue(Object value) {
+ public void setValue(java.lang.Object value) {
this.value = value;
}
/**
* Getter for expression property.
*
- * @return The expression to calculate the value from. Use this parameter, or
- * value, or body.
+ * @return
+ * The expression to calculate the value from. Use this
+ * parameter, or value, or body.
*/
- public String getExpression() {
+ public java.lang.String getExpression() {
return expression;
}
/**
* Setter for expression property.
*
- * @param expression The expression to calculate the value from. Use this
- * parameter, or value, or body.
+ * @param expression
+ * The expression to calculate the value from. Use this
+ * parameter, or value, or body.
*/
- public void setExpression(String expression) {
+ public void setExpression(java.lang.String expression) {
this.expression = expression;
}
/**
* Getter for role property.
*
- * @return A comma-separated list of roles. If present, the attribute will be
- * rendered only if the current user belongs to one of the roles.
+ * @return
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public String getRole() {
+ public java.lang.String getRole() {
return role;
}
/**
* Setter for role property.
*
- * @param role A comma-separated list of roles. If present, the attribute will
- * be rendered only if the current user belongs to one of the roles.
+ * @param role
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public void setRole(String role) {
+ public void setRole(java.lang.String role) {
this.role = role;
}
/**
* Getter for type property.
*
- * @return The type (renderer) of the attribute.
+ * @return
+ * The type (renderer) of the attribute.
*/
- public String getType() {
+ public java.lang.String getType() {
return type;
}
/**
* Setter for type property.
*
- * @param type The type (renderer) of the attribute.
+ * @param type
+ * The type (renderer) of the attribute.
*/
- public void setType(String type) {
+ public void setType(java.lang.String type) {
this.type = type;
}
- /** {@inheritDoc} */
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -159,8 +167,15 @@ public class AddAttributeTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
+ org.apache.tiles.request.Request request = runtime.createRequest();
ModelBody modelBody = runtime.createModelBody();
- model.execute(value, expression, role, type, request, modelBody);
+ model.execute(
+ value,
+ expression,
+ role,
+ type,
+ request, modelBody
+
+ );
}
}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/AddListAttributeTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/AddListAttributeTag.java
index 5f17d8145..fd39f386f 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/AddListAttributeTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/AddListAttributeTag.java
@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+ /*
+ * This file was automatically generated by Apache Tiles Autotag.
+ */
package org.apache.tiles.web.jsp.taglib;
import java.io.IOException;
@@ -24,14 +27,11 @@ import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import org.apache.tiles.autotag.core.runtime.ModelBody;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
-import org.apache.tiles.template.AddListAttributeModel;
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
/**
* <p>
- * Declare a list that will be pass as an attribute.
+ * Declare a list that will be pass as an attribute.
* </p>
* <p>
* Declare a list that will be pass as an attribute . List elements are added
@@ -44,36 +44,36 @@ public class AddListAttributeTag extends SimpleTagSupport {
/**
* The template model.
*/
- private AddListAttributeModel model = new AddListAttributeModel();
+ private org.apache.tiles.template.AddListAttributeModel model = new org.apache.tiles.template.AddListAttributeModel();
/**
* The comma-separated list of roles that can use the list attribute.
*/
- private String role;
+ private java.lang.String role;
/**
* Getter for role property.
*
- * @return The comma-separated list of roles that can use the list attribute.
+ * @return
+ * The comma-separated list of roles that can use the list attribute.
*/
- public String getRole() {
+ public java.lang.String getRole() {
return role;
}
/**
* Setter for role property.
*
- * @param role The comma-separated list of roles that can use the list
- * attribute.
+ * @param role
+ * The comma-separated list of roles that can use the list attribute.
*/
- public void setRole(String role) {
+ public void setRole(java.lang.String role) {
this.role = role;
}
- /** {@inheritDoc} */
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -81,8 +81,12 @@ public class AddListAttributeTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
+ org.apache.tiles.request.Request request = runtime.createRequest();
ModelBody modelBody = runtime.createModelBody();
- model.execute(role, request, modelBody);
+ model.execute(
+ role,
+ request, modelBody
+
+ );
}
}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/DefinitionTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/DefinitionTag.java
index 340917369..e755d18dc 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/DefinitionTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/DefinitionTag.java
@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+ /*
+ * This file was automatically generated by Apache Tiles Autotag.
+ */
package org.apache.tiles.web.jsp.taglib;
import java.io.IOException;
@@ -24,14 +27,11 @@ import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import org.apache.tiles.autotag.core.runtime.ModelBody;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
-import org.apache.tiles.template.DefinitionModel;
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
/**
* <p>
- * Create a definition at runtime.
+ * Create a definition at runtime.
* </p>
* <p>
* Create a new definition at runtime. Newly created definition will be
@@ -43,134 +43,145 @@ public class DefinitionTag extends SimpleTagSupport {
/**
* The template model.
*/
- private DefinitionModel model = new DefinitionModel();
+ private org.apache.tiles.template.DefinitionModel model = new org.apache.tiles.template.DefinitionModel();
/**
- * The name of the definition to create. If not specified, an anonymous
- * definition will be created.
+ * The name of the definition to create. If not specified, an
+ * anonymous definition will be created.
*/
- private String name;
+ private java.lang.String name;
/**
* The template of this definition.
*/
- private String template;
+ private java.lang.String template;
/**
- * A comma-separated list of roles. If present, the definition will be rendered
- * only if the current user belongs to one of the roles.
+ * A comma-separated list of roles. If present, the definition
+ * will be rendered only if the current user belongs to one of the roles.
*/
- private String role;
+ private java.lang.String role;
/**
* The definition name that this definition extends.
*/
- private String extendsParam;
+ private java.lang.String extendsParam;
/**
- * The preparer to use to invoke before the definition is rendered.
+ * The preparer to use to invoke before the definition is
+ * rendered.
*/
- private String preparer;
+ private java.lang.String preparer;
/**
* Getter for name property.
*
- * @return The name of the definition to create. If not specified, an anonymous
- * definition will be created.
+ * @return
+ * The name of the definition to create. If not specified, an
+ * anonymous definition will be created.
*/
- public String getName() {
+ public java.lang.String getName() {
return name;
}
/**
* Setter for name property.
*
- * @param name The name of the definition to create. If not specified, an
- * anonymous definition will be created.
+ * @param name
+ * The name of the definition to create. If not specified, an
+ * anonymous definition will be created.
*/
- public void setName(String name) {
+ public void setName(java.lang.String name) {
this.name = name;
}
/**
* Getter for template property.
*
- * @return The template of this definition.
+ * @return
+ * The template of this definition.
*/
- public String getTemplate() {
+ public java.lang.String getTemplate() {
return template;
}
/**
* Setter for template property.
*
- * @param template The template of this definition.
+ * @param template
+ * The template of this definition.
*/
- public void setTemplate(String template) {
+ public void setTemplate(java.lang.String template) {
this.template = template;
}
/**
* Getter for role property.
*
- * @return A comma-separated list of roles. If present, the definition will be
- * rendered only if the current user belongs to one of the roles.
+ * @return
+ * A comma-separated list of roles. If present, the definition
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public String getRole() {
+ public java.lang.String getRole() {
return role;
}
/**
* Setter for role property.
*
- * @param role A comma-separated list of roles. If present, the definition will
- * be rendered only if the current user belongs to one of the roles.
+ * @param role
+ * A comma-separated list of roles. If present, the definition
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public void setRole(String role) {
+ public void setRole(java.lang.String role) {
this.role = role;
}
/**
* Getter for extends property.
*
- * @return The definition name that this definition extends.
+ * @return
+ * The definition name that this definition extends.
*/
- public String getExtends() {
+ public java.lang.String getExtends() {
return extendsParam;
}
/**
* Setter for extends property.
*
- * @param extendsParam The definition name that this definition extends.
+ * @param extendsParam
+ * The definition name that this definition extends.
*/
- public void setExtends(String extendsParam) {
+ public void setExtends(java.lang.String extendsParam) {
this.extendsParam = extendsParam;
}
/**
* Getter for preparer property.
*
- * @return The preparer to use to invoke before the definition is rendered.
+ * @return
+ * The preparer to use to invoke before the definition is
+ * rendered.
*/
- public String getPreparer() {
+ public java.lang.String getPreparer() {
return preparer;
}
/**
* Setter for preparer property.
*
- * @param preparer The preparer to use to invoke before the definition is
- * rendered.
+ * @param preparer
+ * The preparer to use to invoke before the definition is
+ * rendered.
*/
- public void setPreparer(String preparer) {
+ public void setPreparer(java.lang.String preparer) {
this.preparer = preparer;
}
- /** {@inheritDoc} */
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -178,8 +189,16 @@ public class DefinitionTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
+ org.apache.tiles.request.Request request = runtime.createRequest();
ModelBody modelBody = runtime.createModelBody();
- model.execute(name, template, role, extendsParam, preparer, request, modelBody);
+ model.execute(
+ name,
+ template,
+ role,
+ extendsParam,
+ preparer,
+ request, modelBody
+
+ );
}
}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/GetAsStringTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/GetAsStringTag.java
index 5cd777819..1eb28583d 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/GetAsStringTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/GetAsStringTag.java
@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+ /*
+ * This file was automatically generated by Apache Tiles Autotag.
+ */
package org.apache.tiles.web.jsp.taglib;
import java.io.IOException;
@@ -24,15 +27,12 @@ import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import org.apache.tiles.autotag.core.runtime.ModelBody;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
-import org.apache.tiles.template.GetAsStringModel;
-import org.apache.tiles.api.Attribute;
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
/**
* <p>
- * Render the value of the specified template attribute to the current Writer
+ * Render the value of the specified template attribute to the current
+ * Writer
* </p>
*
* <p>
@@ -46,58 +46,59 @@ public class GetAsStringTag extends SimpleTagSupport {
/**
* The template model.
*/
- private GetAsStringModel model = new GetAsStringModel();
+ private org.apache.tiles.template.GetAsStringModel model = new org.apache.tiles.template.GetAsStringModel();
/**
- * If true, if an exception happens during rendering, of if the attribute is
- * null, the problem will be ignored.
+ * If true, if an exception happens during
+ * rendering, of if the attribute is null, the problem will be ignored.
*/
private boolean ignore;
/**
* The preparer to invoke before rendering the attribute.
*/
- private String preparer;
+ private java.lang.String preparer;
/**
- * A comma-separated list of roles. If present, the attribute will be rendered
- * only if the current user belongs to one of the roles.
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- private String role;
+ private java.lang.String role;
/**
- * The default value of the attribute. To use only if the attribute was not
- * computed.
+ * The default value of the attribute. To use only if
+ * the attribute was not computed.
*/
- private Object defaultValue;
+ private java.lang.Object defaultValue;
/**
- * The default comma-separated list of roles. To use only if the attribute was
- * not computed.
+ * The default comma-separated list of roles. To use
+ * only if the attribute was not computed.
*/
- private String defaultValueRole;
+ private java.lang.String defaultValueRole;
/**
- * The default type of the attribute. To use only if the attribute was not
- * computed.
+ * The default type of the attribute. To use only if
+ * the attribute was not computed.
*/
- private String defaultValueType;
+ private java.lang.String defaultValueType;
/**
* The name of the attribute.
*/
- private String name;
+ private java.lang.String name;
/**
* The attribute to use immediately, if not null.
*/
- private Attribute value;
+ private org.apache.tiles.api.Attribute value;
/**
* Getter for ignore property.
*
- * @return If true, if an exception happens during rendering, of if the
- * attribute is null, the problem will be ignored.
+ * @return
+ * If true, if an exception happens during
+ * rendering, of if the attribute is null, the problem will be ignored.
*/
public boolean isIgnore() {
return ignore;
@@ -106,8 +107,9 @@ public class GetAsStringTag extends SimpleTagSupport {
/**
* Setter for ignore property.
*
- * @param ignore If true, if an exception happens during rendering, of if the
- * attribute is null, the problem will be ignored.
+ * @param ignore
+ * If true, if an exception happens during
+ * rendering, of if the attribute is null, the problem will be ignored.
*/
public void setIgnore(boolean ignore) {
this.ignore = ignore;
@@ -116,141 +118,154 @@ public class GetAsStringTag extends SimpleTagSupport {
/**
* Getter for preparer property.
*
- * @return The preparer to invoke before rendering the attribute.
+ * @return
+ * The preparer to invoke before rendering the attribute.
*/
- public String getPreparer() {
+ public java.lang.String getPreparer() {
return preparer;
}
/**
* Setter for preparer property.
*
- * @param preparer The preparer to invoke before rendering the attribute.
+ * @param preparer
+ * The preparer to invoke before rendering the attribute.
*/
- public void setPreparer(String preparer) {
+ public void setPreparer(java.lang.String preparer) {
this.preparer = preparer;
}
/**
* Getter for role property.
*
- * @return A comma-separated list of roles. If present, the attribute will be
- * rendered only if the current user belongs to one of the roles.
+ * @return
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public String getRole() {
+ public java.lang.String getRole() {
return role;
}
/**
* Setter for role property.
*
- * @param role A comma-separated list of roles. If present, the attribute will
- * be rendered only if the current user belongs to one of the roles.
+ * @param role
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public void setRole(String role) {
+ public void setRole(java.lang.String role) {
this.role = role;
}
/**
* Getter for defaultValue property.
*
- * @return The default value of the attribute. To use only if the attribute was
- * not computed.
+ * @return
+ * The default value of the attribute. To use only if
+ * the attribute was not computed.
*/
- public Object getDefaultValue() {
+ public java.lang.Object getDefaultValue() {
return defaultValue;
}
/**
* Setter for defaultValue property.
*
- * @param defaultValue The default value of the attribute. To use only if the
- * attribute was not computed.
+ * @param defaultValue
+ * The default value of the attribute. To use only if
+ * the attribute was not computed.
*/
- public void setDefaultValue(Object defaultValue) {
+ public void setDefaultValue(java.lang.Object defaultValue) {
this.defaultValue = defaultValue;
}
/**
* Getter for defaultValueRole property.
*
- * @return The default comma-separated list of roles. To use only if the
- * attribute was not computed.
+ * @return
+ * The default comma-separated list of roles. To use
+ * only if the attribute was not computed.
*/
- public String getDefaultValueRole() {
+ public java.lang.String getDefaultValueRole() {
return defaultValueRole;
}
/**
* Setter for defaultValueRole property.
*
- * @param defaultValueRole The default comma-separated list of roles. To use
- * only if the attribute was not computed.
+ * @param defaultValueRole
+ * The default comma-separated list of roles. To use
+ * only if the attribute was not computed.
*/
- public void setDefaultValueRole(String defaultValueRole) {
+ public void setDefaultValueRole(java.lang.String defaultValueRole) {
this.defaultValueRole = defaultValueRole;
}
/**
* Getter for defaultValueType property.
*
- * @return The default type of the attribute. To use only if the attribute was
- * not computed.
+ * @return
+ * The default type of the attribute. To use only if
+ * the attribute was not computed.
*/
- public String getDefaultValueType() {
+ public java.lang.String getDefaultValueType() {
return defaultValueType;
}
/**
* Setter for defaultValueType property.
*
- * @param defaultValueType The default type of the attribute. To use only if the
- * attribute was not computed.
+ * @param defaultValueType
+ * The default type of the attribute. To use only if
+ * the attribute was not computed.
*/
- public void setDefaultValueType(String defaultValueType) {
+ public void setDefaultValueType(java.lang.String defaultValueType) {
this.defaultValueType = defaultValueType;
}
/**
* Getter for name property.
*
- * @return The name of the attribute.
+ * @return
+ * The name of the attribute.
*/
- public String getName() {
+ public java.lang.String getName() {
return name;
}
/**
* Setter for name property.
*
- * @param name The name of the attribute.
+ * @param name
+ * The name of the attribute.
*/
- public void setName(String name) {
+ public void setName(java.lang.String name) {
this.name = name;
}
/**
* Getter for value property.
*
- * @return The attribute to use immediately, if not null.
+ * @return
+ * The attribute to use immediately, if not null.
*/
- public Attribute getValue() {
+ public org.apache.tiles.api.Attribute getValue() {
return value;
}
/**
* Setter for value property.
*
- * @param value The attribute to use immediately, if not null.
+ * @param value
+ * The attribute to use immediately, if not null.
*/
- public void setValue(Attribute value) {
+ public void setValue(org.apache.tiles.api.Attribute value) {
this.value = value;
}
- /** {@inheritDoc} */
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -258,9 +273,19 @@ public class GetAsStringTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
+ org.apache.tiles.request.Request request = runtime.createRequest();
ModelBody modelBody = runtime.createModelBody();
- model.execute(ignore, preparer, role, defaultValue, defaultValueRole, defaultValueType, name, value, request,
- modelBody);
+ model.execute(
+ ignore,
+ preparer,
+ role,
+ defaultValue,
+ defaultValueRole,
+ defaultValueType,
+ name,
+ value,
+ request, modelBody
+
+ );
}
}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/ImportAttributeTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/ImportAttributeTag.java
index 3468f3865..13d8630cc 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/ImportAttributeTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/ImportAttributeTag.java
@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+ /*
+ * This file was automatically generated by Apache Tiles Autotag.
+ */
package org.apache.tiles.web.jsp.taglib;
import java.io.IOException;
@@ -24,9 +27,6 @@ import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
-import org.apache.tiles.template.ImportAttributeModel;
/**
* <p>
@@ -43,25 +43,25 @@ public class ImportAttributeTag extends SimpleTagSupport {
/**
* The template model.
*/
- private ImportAttributeModel model = new ImportAttributeModel();
+ private org.apache.tiles.template.ImportAttributeModel model = new org.apache.tiles.template.ImportAttributeModel();
/**
- * The name of the attribute to import. If it is null, all the attributes will
- * be imported.
+ * The name of the attribute to import. If it is null, all the attributes will be imported.
*/
- private String name;
+ private java.lang.String name;
/**
- * The scope into which the attribute(s) will be imported. If null, the import
- * will go in page scope.
+ * The scope into which the attribute(s) will be imported. If
+ * null, the import will go in page scope.
*/
- private String scope;
+ private java.lang.String scope;
/**
- * The name of the attribute into which the attribute will be imported. To be
- * used in conjunction to name. If null, the value of name will be used.
+ * The name of the attribute into which the attribute will be
+ * imported. To be used in conjunction to name. If
+ * null, the value of name will be used.
*/
- private String toName;
+ private java.lang.String toName;
/**
* If true, if the attribute is not present, the problem will be ignored.
@@ -71,70 +71,74 @@ public class ImportAttributeTag extends SimpleTagSupport {
/**
* Getter for name property.
*
- * @return The name of the attribute to import. If it is null, all the
- * attributes will be imported.
+ * @return
+ * The name of the attribute to import. If it is null, all the attributes will be imported.
*/
- public String getName() {
+ public java.lang.String getName() {
return name;
}
/**
* Setter for name property.
*
- * @param name The name of the attribute to import. If it is null, all the
- * attributes will be imported.
+ * @param name
+ * The name of the attribute to import. If it is null, all the attributes will be imported.
*/
- public void setName(String name) {
+ public void setName(java.lang.String name) {
this.name = name;
}
/**
* Getter for scope property.
*
- * @return The scope into which the attribute(s) will be imported. If null, the
- * import will go in page scope.
+ * @return
+ * The scope into which the attribute(s) will be imported. If
+ * null, the import will go in page scope.
*/
- public String getScope() {
+ public java.lang.String getScope() {
return scope;
}
/**
* Setter for scope property.
*
- * @param scope The scope into which the attribute(s) will be imported. If null,
- * the import will go in page scope.
+ * @param scope
+ * The scope into which the attribute(s) will be imported. If
+ * null, the import will go in page scope.
*/
- public void setScope(String scope) {
+ public void setScope(java.lang.String scope) {
this.scope = scope;
}
/**
* Getter for toName property.
*
- * @return The name of the attribute into which the attribute will be imported.
- * To be used in conjunction to name. If null, the value of name will be
- * used.
+ * @return
+ * The name of the attribute into which the attribute will be
+ * imported. To be used in conjunction to name. If
+ * null, the value of name will be used.
*/
- public String getToName() {
+ public java.lang.String getToName() {
return toName;
}
/**
* Setter for toName property.
*
- * @param toName The name of the attribute into which the attribute will be
- * imported. To be used in conjunction to name. If null, the value
- * of name will be used.
+ * @param toName
+ * The name of the attribute into which the attribute will be
+ * imported. To be used in conjunction to name. If
+ * null, the value of name will be used.
*/
- public void setToName(String toName) {
+ public void setToName(java.lang.String toName) {
this.toName = toName;
}
/**
* Getter for ignore property.
*
- * @return If true, if the attribute is not present, the problem will be
- * ignored.
+ * @return
+ * If true, if the attribute is not present, the problem will be ignored.
*/
public boolean isIgnore() {
return ignore;
@@ -143,17 +147,16 @@ public class ImportAttributeTag extends SimpleTagSupport {
/**
* Setter for ignore property.
*
- * @param ignore If true, if the attribute is not present, the problem will be
- * ignored.
+ * @param ignore
+ * If true, if the attribute is not present, the problem will be ignored.
*/
public void setIgnore(boolean ignore) {
this.ignore = ignore;
}
- /** {@inheritDoc} */
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -161,7 +164,14 @@ public class ImportAttributeTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
- model.execute(name, scope, toName, ignore, request);
+ org.apache.tiles.request.Request request = runtime.createRequest();
+ model.execute(
+ name,
+ scope,
+ toName,
+ ignore,
+ request
+
+ );
}
}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertAttributeTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertAttributeTag.java
index 58909fc6c..f20d83ba0 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertAttributeTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertAttributeTag.java
@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+ /*
+ * This file was automatically generated by Apache Tiles Autotag.
+ */
package org.apache.tiles.web.jsp.taglib;
import java.io.IOException;
@@ -24,10 +27,6 @@ import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import org.apache.tiles.autotag.core.runtime.ModelBody;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
-import org.apache.tiles.template.InsertAttributeModel;
-import org.apache.tiles.api.Attribute;
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
/**
@@ -46,66 +45,65 @@ import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
* </p>
*
* <p>
- * Example :
+ * Example :
* </p>
*
* <pre>
- * <code>
* <tiles:insertAttribute name="body" />
- * </code>
* </pre>
+ *
*/
public class InsertAttributeTag extends SimpleTagSupport {
/**
* The template model.
*/
- private InsertAttributeModel model = new InsertAttributeModel();
+ private org.apache.tiles.template.InsertAttributeModel model = new org.apache.tiles.template.InsertAttributeModel();
/**
- * If true, if an exception happens during rendering, of if the attribute is
- * null, the problem will be ignored.
+ * If true, if an exception happens during
+ * rendering, of if the attribute is null, the problem will be ignored.
*/
private boolean ignore;
/**
* The preparer to invoke before rendering the attribute.
*/
- private String preparer;
+ private java.lang.String preparer;
/**
- * A comma-separated list of roles. If present, the attribute will be rendered
- * only if the current user belongs to one of the roles.
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- private String role;
+ private java.lang.String role;
/**
- * The default value of the attribute. To use only if the attribute was not
- * computed.
+ * The default value of the attribute. To use only if
+ * the attribute was not computed.
*/
- private Object defaultValue;
+ private java.lang.Object defaultValue;
/**
- * The default comma-separated list of roles. To use only if the attribute was
- * not computed.
+ * The default comma-separated list of roles. To use
+ * only if the attribute was not computed.
*/
- private String defaultValueRole;
+ private java.lang.String defaultValueRole;
/**
- * The default type of the attribute. To use only if the attribute was not
- * computed.
+ * The default type of the attribute. To use only if
+ * the attribute was not computed.
*/
- private String defaultValueType;
+ private java.lang.String defaultValueType;
/**
* The name of the attribute.
*/
- private String name;
+ private java.lang.String name;
/**
* The attribute to use immediately, if not null.
*/
- private Attribute value;
+ private org.apache.tiles.api.Attribute value;
/**
* If true, the response will be flushed after the insert.
@@ -115,8 +113,9 @@ public class InsertAttributeTag extends SimpleTagSupport {
/**
* Getter for ignore property.
*
- * @return If true, if an exception happens during rendering, of if the
- * attribute is null, the problem will be ignored.
+ * @return
+ * If true, if an exception happens during
+ * rendering, of if the attribute is null, the problem will be ignored.
*/
public boolean isIgnore() {
return ignore;
@@ -125,8 +124,9 @@ public class InsertAttributeTag extends SimpleTagSupport {
/**
* Setter for ignore property.
*
- * @param ignore If true, if an exception happens during rendering, of if the
- * attribute is null, the problem will be ignored.
+ * @param ignore
+ * If true, if an exception happens during
+ * rendering, of if the attribute is null, the problem will be ignored.
*/
public void setIgnore(boolean ignore) {
this.ignore = ignore;
@@ -135,141 +135,156 @@ public class InsertAttributeTag extends SimpleTagSupport {
/**
* Getter for preparer property.
*
- * @return The preparer to invoke before rendering the attribute.
+ * @return
+ * The preparer to invoke before rendering the attribute.
*/
- public String getPreparer() {
+ public java.lang.String getPreparer() {
return preparer;
}
/**
* Setter for preparer property.
*
- * @param preparer The preparer to invoke before rendering the attribute.
+ * @param preparer
+ * The preparer to invoke before rendering the attribute.
*/
- public void setPreparer(String preparer) {
+ public void setPreparer(java.lang.String preparer) {
this.preparer = preparer;
}
/**
* Getter for role property.
*
- * @return A comma-separated list of roles. If present, the attribute will be
- * rendered only if the current user belongs to one of the roles.
+ * @return
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public String getRole() {
+ public java.lang.String getRole() {
return role;
}
/**
* Setter for role property.
*
- * @param role A comma-separated list of roles. If present, the attribute will
- * be rendered only if the current user belongs to one of the roles.
+ * @param role
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public void setRole(String role) {
+ public void setRole(java.lang.String role) {
this.role = role;
}
/**
* Getter for defaultValue property.
*
- * @return The default value of the attribute. To use only if the attribute was
- * not computed.
+ * @return
+ * The default value of the attribute. To use only if
+ * the attribute was not computed.
*/
- public Object getDefaultValue() {
+ public java.lang.Object getDefaultValue() {
return defaultValue;
}
/**
* Setter for defaultValue property.
*
- * @param defaultValue The default value of the attribute. To use only if the
- * attribute was not computed.
+ * @param defaultValue
+ * The default value of the attribute. To use only if
+ * the attribute was not computed.
*/
- public void setDefaultValue(Object defaultValue) {
+ public void setDefaultValue(java.lang.Object defaultValue) {
this.defaultValue = defaultValue;
}
/**
* Getter for defaultValueRole property.
*
- * @return The default comma-separated list of roles. To use only if the
- * attribute was not computed.
+ * @return
+ * The default comma-separated list of roles. To use
+ * only if the attribute was not computed.
*/
- public String getDefaultValueRole() {
+ public java.lang.String getDefaultValueRole() {
return defaultValueRole;
}
/**
* Setter for defaultValueRole property.
*
- * @param defaultValueRole The default comma-separated list of roles. To use
- * only if the attribute was not computed.
+ * @param defaultValueRole
+ * The default comma-separated list of roles. To use
+ * only if the attribute was not computed.
*/
- public void setDefaultValueRole(String defaultValueRole) {
+ public void setDefaultValueRole(java.lang.String defaultValueRole) {
this.defaultValueRole = defaultValueRole;
}
/**
* Getter for defaultValueType property.
*
- * @return The default type of the attribute. To use only if the attribute was
- * not computed.
+ * @return
+ * The default type of the attribute. To use only if
+ * the attribute was not computed.
*/
- public String getDefaultValueType() {
+ public java.lang.String getDefaultValueType() {
return defaultValueType;
}
/**
* Setter for defaultValueType property.
*
- * @param defaultValueType The default type of the attribute. To use only if the
- * attribute was not computed.
+ * @param defaultValueType
+ * The default type of the attribute. To use only if
+ * the attribute was not computed.
*/
- public void setDefaultValueType(String defaultValueType) {
+ public void setDefaultValueType(java.lang.String defaultValueType) {
this.defaultValueType = defaultValueType;
}
/**
* Getter for name property.
*
- * @return The name of the attribute.
+ * @return
+ * The name of the attribute.
*/
- public String getName() {
+ public java.lang.String getName() {
return name;
}
/**
* Setter for name property.
*
- * @param name The name of the attribute.
+ * @param name
+ * The name of the attribute.
*/
- public void setName(String name) {
+ public void setName(java.lang.String name) {
this.name = name;
}
/**
* Getter for value property.
*
- * @return The attribute to use immediately, if not null.
+ * @return
+ * The attribute to use immediately, if not null.
*/
- public Attribute getValue() {
+ public org.apache.tiles.api.Attribute getValue() {
return value;
}
/**
* Setter for value property.
*
- * @param value The attribute to use immediately, if not null.
+ * @param value
+ * The attribute to use immediately, if not null.
*/
- public void setValue(Attribute value) {
+ public void setValue(org.apache.tiles.api.Attribute value) {
this.value = value;
}
/**
* Getter for flush property.
*
- * @return If true, the response will be flushed after the insert.
+ * @return
+ * If true, the response will be flushed after the insert.
*/
public boolean isFlush() {
return flush;
@@ -278,16 +293,16 @@ public class InsertAttributeTag extends SimpleTagSupport {
/**
* Setter for flush property.
*
- * @param flush If true, the response will be flushed after the insert.
+ * @param flush
+ * If true, the response will be flushed after the insert.
*/
public void setFlush(boolean flush) {
this.flush = flush;
}
- /** {@inheritDoc} */
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -295,9 +310,20 @@ public class InsertAttributeTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
+ org.apache.tiles.request.Request request = runtime.createRequest();
ModelBody modelBody = runtime.createModelBody();
- model.execute(ignore, preparer, role, defaultValue, defaultValueRole, defaultValueType, name, value, flush,
- request, modelBody);
+ model.execute(
+ ignore,
+ preparer,
+ role,
+ defaultValue,
+ defaultValueRole,
+ defaultValueType,
+ name,
+ value,
+ flush,
+ request, modelBody
+
+ );
}
}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertDefinitionTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertDefinitionTag.java
index bd42a4b78..d513601b9 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertDefinitionTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertDefinitionTag.java
@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+ /*
+ * This file was automatically generated by Apache Tiles Autotag.
+ */
package org.apache.tiles.web.jsp.taglib;
import java.io.IOException;
@@ -24,9 +27,6 @@ import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import org.apache.tiles.autotag.core.runtime.ModelBody;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
-import org.apache.tiles.template.InsertDefinitionModel;
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
/**
@@ -37,20 +37,19 @@ import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
* Insert a definition with the possibility to override and specify parameters
* (called attributes). A definition can be seen as a (partially or totally)
* filled template that can override or complete attribute values.
- * <tiles:insertDefinition> allows to define these attributes and pass
- * them to the inserted jsp page, called template. Attributes are defined using
- * nested tag <tiles:putAttribute> or <tiles:putListAttribute>.
+ * <tiles:insertDefinition> allows to define these attributes
+ * and pass them to the inserted jsp page, called template. Attributes are
+ * defined using nested tag <tiles:putAttribute> or
+ * <tiles:putListAttribute>.
* </p>
* <p>
- * You must specify name tag attribute, for inserting a definition from
- * definitions factory.
+ * You must specify name tag attribute, for inserting a definition from definitions factory.
* </p>
* <p>
- * Example :
+ * Example :
* </p>
*
* <pre>
- * <code>
* <tiles:insertDefinition name=".my.tiles.defininition flush="true">
* <tiles:putAttribute name="title" value="My first page" />
* <tiles:putAttribute name="header" value="/common/header.jsp" />
@@ -58,48 +57,49 @@ import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
* <tiles:putAttribute name="menu" value="/basic/menu.jsp" />
* <tiles:putAttribute name="body" value="/basic/helloBody.jsp" />
* </tiles:insertDefinition>
- * </code>
* </pre>
+ *
*/
public class InsertDefinitionTag extends SimpleTagSupport {
/**
* The template model.
*/
- private InsertDefinitionModel model = new InsertDefinitionModel();
+ private org.apache.tiles.template.InsertDefinitionModel model = new org.apache.tiles.template.InsertDefinitionModel();
/**
* The name of the definition to render.
*/
- private String definitionName;
+ private java.lang.String definitionName;
/**
- * If specified, this template will be used instead of the one used by the
- * definition.
+ * If specified, this template will be used instead of the
+ * one used by the definition.
*/
- private String template;
+ private java.lang.String template;
/**
* The type of the template attribute.
*/
- private String templateType;
+ private java.lang.String templateType;
/**
* The expression to evaluate to get the value of the template.
*/
- private String templateExpression;
+ private java.lang.String templateExpression;
/**
- * A comma-separated list of roles. If present, the definition will be rendered
- * only if the current user belongs to one of the roles.
+ * A comma-separated list of roles. If present, the definition
+ * will be rendered only if the current user belongs to one of the roles.
*/
- private String role;
+ private java.lang.String role;
/**
- * The preparer to use to invoke before the definition is rendered. If
- * specified, it overrides the preparer specified in the definition itself.
+ * The preparer to use to invoke before the definition is
+ * rendered. If specified, it overrides the preparer specified in the
+ * definition itself.
*/
- private String preparer;
+ private java.lang.String preparer;
/**
* If true, the response will be flushed after the insert.
@@ -109,124 +109,136 @@ public class InsertDefinitionTag extends SimpleTagSupport {
/**
* Getter for name property.
*
- * @return The name of the definition to render.
+ * @return
+ * The name of the definition to render.
*/
- public String getName() {
+ public java.lang.String getName() {
return definitionName;
}
/**
* Setter for name property.
*
- * @param definitionName The name of the definition to render.
+ * @param definitionName
+ * The name of the definition to render.
*/
- public void setName(String definitionName) {
+ public void setName(java.lang.String definitionName) {
this.definitionName = definitionName;
}
/**
* Getter for template property.
*
- * @return If specified, this template will be used instead of the one used by
- * the definition.
+ * @return
+ * If specified, this template will be used instead of the
+ * one used by the definition.
*/
- public String getTemplate() {
+ public java.lang.String getTemplate() {
return template;
}
/**
* Setter for template property.
*
- * @param template If specified, this template will be used instead of the one
- * used by the definition.
+ * @param template
+ * If specified, this template will be used instead of the
+ * one used by the definition.
*/
- public void setTemplate(String template) {
+ public void setTemplate(java.lang.String template) {
this.template = template;
}
/**
* Getter for templateType property.
*
- * @return The type of the template attribute.
+ * @return
+ * The type of the template attribute.
*/
- public String getTemplateType() {
+ public java.lang.String getTemplateType() {
return templateType;
}
/**
* Setter for templateType property.
*
- * @param templateType The type of the template attribute.
+ * @param templateType
+ * The type of the template attribute.
*/
- public void setTemplateType(String templateType) {
+ public void setTemplateType(java.lang.String templateType) {
this.templateType = templateType;
}
/**
* Getter for templateExpression property.
*
- * @return The expression to evaluate to get the value of the template.
+ * @return
+ * The expression to evaluate to get the value of the template.
*/
- public String getTemplateExpression() {
+ public java.lang.String getTemplateExpression() {
return templateExpression;
}
/**
* Setter for templateExpression property.
*
- * @param templateExpression The expression to evaluate to get the value of the
- * template.
+ * @param templateExpression
+ * The expression to evaluate to get the value of the template.
*/
- public void setTemplateExpression(String templateExpression) {
+ public void setTemplateExpression(java.lang.String templateExpression) {
this.templateExpression = templateExpression;
}
/**
* Getter for role property.
*
- * @return A comma-separated list of roles. If present, the definition will be
- * rendered only if the current user belongs to one of the roles.
+ * @return
+ * A comma-separated list of roles. If present, the definition
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public String getRole() {
+ public java.lang.String getRole() {
return role;
}
/**
* Setter for role property.
*
- * @param role A comma-separated list of roles. If present, the definition will
- * be rendered only if the current user belongs to one of the roles.
+ * @param role
+ * A comma-separated list of roles. If present, the definition
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public void setRole(String role) {
+ public void setRole(java.lang.String role) {
this.role = role;
}
/**
* Getter for preparer property.
*
- * @return The preparer to use to invoke before the definition is rendered. If
- * specified, it overrides the preparer specified in the definition
- * itself.
+ * @return
+ * The preparer to use to invoke before the definition is
+ * rendered. If specified, it overrides the preparer specified in the
+ * definition itself.
*/
- public String getPreparer() {
+ public java.lang.String getPreparer() {
return preparer;
}
/**
* Setter for preparer property.
*
- * @param preparer The preparer to use to invoke before the definition is
- * rendered. If specified, it overrides the preparer specified
- * in the definition itself.
+ * @param preparer
+ * The preparer to use to invoke before the definition is
+ * rendered. If specified, it overrides the preparer specified in the
+ * definition itself.
*/
- public void setPreparer(String preparer) {
+ public void setPreparer(java.lang.String preparer) {
this.preparer = preparer;
}
/**
* Getter for flush property.
*
- * @return If true, the response will be flushed after the insert.
+ * @return
+ * If true, the response will be flushed after the insert.
*/
public boolean isFlush() {
return flush;
@@ -235,16 +247,16 @@ public class InsertDefinitionTag extends SimpleTagSupport {
/**
* Setter for flush property.
*
- * @param flush If true, the response will be flushed after the insert.
+ * @param flush
+ * If true, the response will be flushed after the insert.
*/
public void setFlush(boolean flush) {
this.flush = flush;
}
- /** {@inheritDoc} */
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -252,9 +264,18 @@ public class InsertDefinitionTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
+ org.apache.tiles.request.Request request = runtime.createRequest();
ModelBody modelBody = runtime.createModelBody();
- model.execute(definitionName, template, templateType, templateExpression, role, preparer, flush, request,
- modelBody);
+ model.execute(
+ definitionName,
+ template,
+ templateType,
+ templateExpression,
+ role,
+ preparer,
+ flush,
+ request, modelBody
+
+ );
}
}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertTemplateTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertTemplateTag.java
index aaa187068..90cd2d8cf 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertTemplateTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/InsertTemplateTag.java
@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+ /*
+ * This file was automatically generated by Apache Tiles Autotag.
+ */
package org.apache.tiles.web.jsp.taglib;
import java.io.IOException;
@@ -24,9 +27,6 @@ import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import org.apache.tiles.autotag.core.runtime.ModelBody;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
-import org.apache.tiles.template.InsertTemplateModel;
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
/**
@@ -36,9 +36,10 @@ import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
* <p>
* Insert a template with the possibility to pass parameters (called
* attributes). A template can be seen as a procedure that can take parameters
- * or attributes. <tiles:insertTemplate> allows to define these attributes
- * and pass them to the inserted jsp page, called template. Attributes are
- * defined using nested tag <tiles:putAttribute> or
+ * or attributes. <tiles:insertTemplate> allows to define
+ * these attributes and pass them to the inserted jsp page, called template.
+ * Attributes are defined using nested tag
+ * <tiles:putAttribute> or
* <tiles:putListAttribute>.
* </p>
* <p>
@@ -50,50 +51,50 @@ import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
* </p>
*
* <pre>
- * <code>
* <tiles:insertTemplate template="/basic/myLayout.jsp" flush="true">
- * <tiles:putAttribute name="title" value="My first page" />
- * <tiles:putAttribute name="header" value="/common/header.jsp" />
- * <tiles:putAttribute name="footer" value="/common/footer.jsp" />
- * <tiles:putAttribute name="menu" value="/basic/menu.jsp" />
- * <tiles:putAttribute name="body" value="/basic/helloBody.jsp" />
+ * <tiles:putAttribute name="title" value="My first page" />
+ * <tiles:putAttribute name="header" value="/common/header.jsp" />
+ * <tiles:putAttribute name="footer" value="/common/footer.jsp" />
+ * <tiles:putAttribute name="menu" value="/basic/menu.jsp" />
+ * <tiles:putAttribute name="body" value="/basic/helloBody.jsp" />
* </tiles:insertTemplate>
- * </code>
* </pre>
+ *
*/
public class InsertTemplateTag extends SimpleTagSupport {
/**
* The template model.
*/
- private InsertTemplateModel model = new InsertTemplateModel();
+ private org.apache.tiles.template.InsertTemplateModel model = new org.apache.tiles.template.InsertTemplateModel();
/**
* The template to render.
*/
- private String template;
+ private java.lang.String template;
/**
* The type of the template attribute.
*/
- private String templateType;
+ private java.lang.String templateType;
/**
* The expression to evaluate to get the value of the template.
*/
- private String templateExpression;
+ private java.lang.String templateExpression;
/**
- * A comma-separated list of roles. If present, the template will be rendered
- * only if the current user belongs to one of the roles.
+ * A comma-separated list of roles. If present, the template
+ * will be rendered only if the current user belongs to one of the roles.
*/
- private String role;
+ private java.lang.String role;
/**
- * The preparer to use to invoke before the definition is rendered. If
- * specified, it overrides the preparer specified in the definition itself.
+ * The preparer to use to invoke before the definition is
+ * rendered. If specified, it overrides the preparer specified in the
+ * definition itself.
*/
- private String preparer;
+ private java.lang.String preparer;
/**
* If true, the response will be flushed after the insert.
@@ -103,104 +104,114 @@ public class InsertTemplateTag extends SimpleTagSupport {
/**
* Getter for template property.
*
- * @return The template to render.
+ * @return
+ * The template to render.
*/
- public String getTemplate() {
+ public java.lang.String getTemplate() {
return template;
}
/**
* Setter for template property.
*
- * @param template The template to render.
+ * @param template
+ * The template to render.
*/
- public void setTemplate(String template) {
+ public void setTemplate(java.lang.String template) {
this.template = template;
}
/**
* Getter for templateType property.
*
- * @return The type of the template attribute.
+ * @return
+ * The type of the template attribute.
*/
- public String getTemplateType() {
+ public java.lang.String getTemplateType() {
return templateType;
}
/**
* Setter for templateType property.
*
- * @param templateType The type of the template attribute.
+ * @param templateType
+ * The type of the template attribute.
*/
- public void setTemplateType(String templateType) {
+ public void setTemplateType(java.lang.String templateType) {
this.templateType = templateType;
}
/**
* Getter for templateExpression property.
*
- * @return The expression to evaluate to get the value of the template.
+ * @return
+ * The expression to evaluate to get the value of the template.
*/
- public String getTemplateExpression() {
+ public java.lang.String getTemplateExpression() {
return templateExpression;
}
/**
* Setter for templateExpression property.
*
- * @param templateExpression The expression to evaluate to get the value of the
- * template.
+ * @param templateExpression
+ * The expression to evaluate to get the value of the template.
*/
- public void setTemplateExpression(String templateExpression) {
+ public void setTemplateExpression(java.lang.String templateExpression) {
this.templateExpression = templateExpression;
}
/**
* Getter for role property.
*
- * @return A comma-separated list of roles. If present, the template will be
- * rendered only if the current user belongs to one of the roles.
+ * @return
+ * A comma-separated list of roles. If present, the template
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public String getRole() {
+ public java.lang.String getRole() {
return role;
}
/**
* Setter for role property.
*
- * @param role A comma-separated list of roles. If present, the template will be
- * rendered only if the current user belongs to one of the roles.
+ * @param role
+ * A comma-separated list of roles. If present, the template
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public void setRole(String role) {
+ public void setRole(java.lang.String role) {
this.role = role;
}
/**
* Getter for preparer property.
*
- * @return The preparer to use to invoke before the definition is rendered. If
- * specified, it overrides the preparer specified in the definition
- * itself.
+ * @return
+ * The preparer to use to invoke before the definition is
+ * rendered. If specified, it overrides the preparer specified in the
+ * definition itself.
*/
- public String getPreparer() {
+ public java.lang.String getPreparer() {
return preparer;
}
/**
* Setter for preparer property.
*
- * @param preparer The preparer to use to invoke before the definition is
- * rendered. If specified, it overrides the preparer specified
- * in the definition itself.
+ * @param preparer
+ * The preparer to use to invoke before the definition is
+ * rendered. If specified, it overrides the preparer specified in the
+ * definition itself.
*/
- public void setPreparer(String preparer) {
+ public void setPreparer(java.lang.String preparer) {
this.preparer = preparer;
}
/**
* Getter for flush property.
*
- * @return If true, the response will be flushed after the insert.
+ * @return
+ * If true, the response will be flushed after the insert.
*/
public boolean isFlush() {
return flush;
@@ -209,16 +220,16 @@ public class InsertTemplateTag extends SimpleTagSupport {
/**
* Setter for flush property.
*
- * @param flush If true, the response will be flushed after the insert.
+ * @param flush
+ * If true, the response will be flushed after the insert.
*/
public void setFlush(boolean flush) {
this.flush = flush;
}
- /** {@inheritDoc} */
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -226,8 +237,17 @@ public class InsertTemplateTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
+ org.apache.tiles.request.Request request = runtime.createRequest();
ModelBody modelBody = runtime.createModelBody();
- model.execute(template, templateType, templateExpression, role, preparer, flush, request, modelBody);
+ model.execute(
+ template,
+ templateType,
+ templateExpression,
+ role,
+ preparer,
+ flush,
+ request, modelBody
+
+ );
}
}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/PutAttributeTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/PutAttributeTag.java
index f687d7e49..2d04fff3e 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/PutAttributeTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/PutAttributeTag.java
@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+ /*
+ * This file was automatically generated by Apache Tiles Autotag.
+ */
package org.apache.tiles.web.jsp.taglib;
import java.io.IOException;
@@ -24,9 +27,6 @@ import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import org.apache.tiles.autotag.core.runtime.ModelBody;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
-import org.apache.tiles.template.PutAttributeModel;
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
/**
@@ -42,8 +42,8 @@ import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
* <li><insertDefinition></li>
* <li><putListAttribute></li>
* </ul>
- * (or any other tag which implements the PutAttributeTagParent interface.
- * Exception is thrown if no appropriate tag can be found.
+ * (or any other tag which implements the PutAttributeTagParent
+ * interface. Exception is thrown if no appropriate tag can be found.
* </p>
* <p>
* Put tag can have following atributes :
@@ -67,34 +67,35 @@ public class PutAttributeTag extends SimpleTagSupport {
/**
* The template model.
*/
- private PutAttributeModel model = new org.apache.tiles.template.PutAttributeModel();
+ private org.apache.tiles.template.PutAttributeModel model = new org.apache.tiles.template.PutAttributeModel();
/**
* The name of the attribute to put.
*/
- private String name;
+ private java.lang.String name;
/**
- * The value of the attribute. Use this parameter, or expression, or body.
+ * The value of the attribute. Use this parameter, or
+ * expression, or body.
*/
- private Object value;
+ private java.lang.Object value;
/**
- * The expression to calculate the value from. Use this parameter, or value, or
- * body.
+ * The expression to calculate the value from. Use this
+ * parameter, or value, or body.
*/
- private String expression;
+ private java.lang.String expression;
/**
- * A comma-separated list of roles. If present, the attribute will be rendered
- * only if the current user belongs to one of the roles.
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- private String role;
+ private java.lang.String role;
/**
* The type (renderer) of the attribute.
*/
- private String type;
+ private java.lang.String type;
/**
* If true the attribute will be cascaded to all nested attributes.
@@ -104,103 +105,114 @@ public class PutAttributeTag extends SimpleTagSupport {
/**
* Getter for name property.
*
- * @return The name of the attribute to put.
+ * @return
+ * The name of the attribute to put.
*/
- public String getName() {
+ public java.lang.String getName() {
return name;
}
/**
* Setter for name property.
*
- * @param name The name of the attribute to put.
+ * @param name
+ * The name of the attribute to put.
*/
- public void setName(String name) {
+ public void setName(java.lang.String name) {
this.name = name;
}
/**
* Getter for value property.
*
- * @return The value of the attribute. Use this parameter, or expression, or
- * body.
+ * @return
+ * The value of the attribute. Use this parameter, or
+ * expression, or body.
*/
- public Object getValue() {
+ public java.lang.Object getValue() {
return value;
}
/**
* Setter for value property.
*
- * @param value The value of the attribute. Use this parameter, or expression,
- * or body.
+ * @param value
+ * The value of the attribute. Use this parameter, or
+ * expression, or body.
*/
- public void setValue(Object value) {
+ public void setValue(java.lang.Object value) {
this.value = value;
}
/**
* Getter for expression property.
*
- * @return The expression to calculate the value from. Use this parameter, or
- * value, or body.
+ * @return
+ * The expression to calculate the value from. Use this
+ * parameter, or value, or body.
*/
- public String getExpression() {
+ public java.lang.String getExpression() {
return expression;
}
/**
* Setter for expression property.
*
- * @param expression The expression to calculate the value from. Use this
- * parameter, or value, or body.
+ * @param expression
+ * The expression to calculate the value from. Use this
+ * parameter, or value, or body.
*/
- public void setExpression(String expression) {
+ public void setExpression(java.lang.String expression) {
this.expression = expression;
}
/**
* Getter for role property.
*
- * @return A comma-separated list of roles. If present, the attribute will be
- * rendered only if the current user belongs to one of the roles.
+ * @return
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public String getRole() {
+ public java.lang.String getRole() {
return role;
}
/**
* Setter for role property.
*
- * @param role A comma-separated list of roles. If present, the attribute will
- * be rendered only if the current user belongs to one of the roles.
+ * @param role
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public void setRole(String role) {
+ public void setRole(java.lang.String role) {
this.role = role;
}
/**
* Getter for type property.
*
- * @return The type (renderer) of the attribute.
+ * @return
+ * The type (renderer) of the attribute.
*/
- public String getType() {
+ public java.lang.String getType() {
return type;
}
/**
* Setter for type property.
*
- * @param type The type (renderer) of the attribute.
+ * @param type
+ * The type (renderer) of the attribute.
*/
- public void setType(String type) {
+ public void setType(java.lang.String type) {
this.type = type;
}
/**
* Getter for cascade property.
*
- * @return If true the attribute will be cascaded to all nested attributes.
+ * @return
+ * If true the attribute will be cascaded to all nested attributes.
*/
public boolean isCascade() {
return cascade;
@@ -209,17 +221,16 @@ public class PutAttributeTag extends SimpleTagSupport {
/**
* Setter for cascade property.
*
- * @param cascade If true the attribute will be cascaded to all nested
- * attributes.
+ * @param cascade
+ * If true the attribute will be cascaded to all nested attributes.
*/
public void setCascade(boolean cascade) {
this.cascade = cascade;
}
- /** {@inheritDoc} */
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -227,8 +238,17 @@ public class PutAttributeTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
+ org.apache.tiles.request.Request request = runtime.createRequest();
ModelBody modelBody = runtime.createModelBody();
- model.execute(name, value, expression, role, type, cascade, request, modelBody);
+ model.execute(
+ name,
+ value,
+ expression,
+ role,
+ type,
+ cascade,
+ request, modelBody
+
+ );
}
}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/PutListAttributeTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/PutListAttributeTag.java
index b60628f25..7befc81d1 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/PutListAttributeTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/PutListAttributeTag.java
@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+ /*
+ * This file was automatically generated by Apache Tiles Autotag.
+ */
package org.apache.tiles.web.jsp.taglib;
import java.io.IOException;
@@ -24,13 +27,11 @@ import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import org.apache.tiles.autotag.core.runtime.ModelBody;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
/**
* <p>
- * Declare a list that will be pass as attribute to tile.
+ * Declare a list that will be pass as attribute to tile.
* </p>
* <p>
* Declare a list that will be pass as attribute to tile. List elements are
@@ -48,17 +49,17 @@ public class PutListAttributeTag extends SimpleTagSupport {
/**
* The name of the attribute to put.
*/
- private String name;
+ private java.lang.String name;
/**
- * A comma-separated list of roles. If present, the attribute will be rendered
- * only if the current user belongs to one of the roles.
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- private String role;
+ private java.lang.String role;
/**
- * If true, the list attribute will use, as first elements, the list contained
- * in the list attribute, put with the same name, of the containing definition.
+ * If true, the list attribute will use, as first elements, the
+ * list contained in the list attribute, put with the same name, of the containing definition.
*/
private boolean inherit;
@@ -70,47 +71,51 @@ public class PutListAttributeTag extends SimpleTagSupport {
/**
* Getter for name property.
*
- * @return The name of the attribute to put.
+ * @return
+ * The name of the attribute to put.
*/
- public String getName() {
+ public java.lang.String getName() {
return name;
}
/**
* Setter for name property.
*
- * @param name The name of the attribute to put.
+ * @param name
+ * The name of the attribute to put.
*/
- public void setName(String name) {
+ public void setName(java.lang.String name) {
this.name = name;
}
/**
* Getter for role property.
*
- * @return A comma-separated list of roles. If present, the attribute will be
- * rendered only if the current user belongs to one of the roles.
+ * @return
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public String getRole() {
+ public java.lang.String getRole() {
return role;
}
/**
* Setter for role property.
*
- * @param role A comma-separated list of roles. If present, the attribute will
- * be rendered only if the current user belongs to one of the roles.
+ * @param role
+ * A comma-separated list of roles. If present, the attribute
+ * will be rendered only if the current user belongs to one of the roles.
*/
- public void setRole(String role) {
+ public void setRole(java.lang.String role) {
this.role = role;
}
/**
* Getter for inherit property.
*
- * @return If true, the list attribute will use, as first elements, the list
- * contained in the list attribute, put with the same name, of the
- * containing definition.
+ * @return
+ * If true, the list attribute will use, as first elements, the
+ * list contained in the list attribute, put with the same name, of the containing definition.
*/
public boolean isInherit() {
return inherit;
@@ -119,9 +124,9 @@ public class PutListAttributeTag extends SimpleTagSupport {
/**
* Setter for inherit property.
*
- * @param inherit If true, the list attribute will use, as first elements, the
- * list contained in the list attribute, put with the same name,
- * of the containing definition.
+ * @param inherit
+ * If true, the list attribute will use, as first elements, the
+ * list contained in the list attribute, put with the same name, of the containing definition.
*/
public void setInherit(boolean inherit) {
this.inherit = inherit;
@@ -130,7 +135,8 @@ public class PutListAttributeTag extends SimpleTagSupport {
/**
* Getter for cascade property.
*
- * @return If true the attribute will be cascaded to all nested attributes.
+ * @return
+ * If true the attribute will be cascaded to all nested attributes.
*/
public boolean isCascade() {
return cascade;
@@ -139,17 +145,16 @@ public class PutListAttributeTag extends SimpleTagSupport {
/**
* Setter for cascade property.
*
- * @param cascade If true the attribute will be cascaded to all nested
- * attributes.
+ * @param cascade
+ * If true the attribute will be cascaded to all nested attributes.
*/
public void setCascade(boolean cascade) {
this.cascade = cascade;
}
- /** {@inheritDoc} */
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -157,8 +162,15 @@ public class PutListAttributeTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
+ org.apache.tiles.request.Request request = runtime.createRequest();
ModelBody modelBody = runtime.createModelBody();
- model.execute(name, role, inherit, cascade, request, modelBody);
+ model.execute(
+ name,
+ role,
+ inherit,
+ cascade,
+ request, modelBody
+
+ );
}
}
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/SetCurrentContainerTag.java b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/SetCurrentContainerTag.java
index ee4877c38..802dfb411 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/SetCurrentContainerTag.java
+++ b/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/SetCurrentContainerTag.java
@@ -16,6 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
+ /*
+ * This file was automatically generated by Apache Tiles Autotag.
+ */
package org.apache.tiles.web.jsp.taglib;
import java.io.IOException;
@@ -24,9 +27,6 @@ import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
-import org.apache.tiles.template.SetCurrentContainerModel;
/**
* Selects a container to be used as the "current" container.
@@ -36,38 +36,36 @@ public class SetCurrentContainerTag extends SimpleTagSupport {
/**
* The template model.
*/
- private SetCurrentContainerModel model = new SetCurrentContainerModel();
+ private org.apache.tiles.template.SetCurrentContainerModel model = new org.apache.tiles.template.SetCurrentContainerModel();
/**
- * The key of the container to be used as "current". If null, the default one
- * will be used.
+ * The key of the container to be used as "current". If null, the default one will be used.
*/
- private String containerKey;
+ private java.lang.String containerKey;
/**
* Getter for containerKey property.
*
- * @return The key of the container to be used as "current". If null, the
- * default one will be used.
+ * @return
+ * The key of the container to be used as "current". If null, the default one will be used.
*/
- public String getContainerKey() {
+ public java.lang.String getContainerKey() {
return containerKey;
}
/**
* Setter for containerKey property.
*
- * @param containerKey The key of the container to be used as "current". If
- * null, the default one will be used.
+ * @param containerKey
+ * The key of the container to be used as "current". If null, the default one will be used.
*/
- public void setContainerKey(String containerKey) {
+ public void setContainerKey(java.lang.String containerKey) {
this.containerKey = containerKey;
}
- /** {@inheritDoc} */
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<org.apache.tiles.request.Request> runtime = new org.apache.tiles.request.jsp.autotag.JspAutotagRuntime();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -75,7 +73,11 @@ public class SetCurrentContainerTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
- model.execute(containerKey, request);
+ org.apache.tiles.request.Request request = runtime.createRequest();
+ model.execute(
+ containerKey,
+ request
+
+ );
}
}
diff --git a/plugins/tiles/src/main/resources/META-INF/template-suite.xml b/plugins/tiles/src/main/resources/META-INF/template-suite.xml
new file mode 100644
index 000000000..3d0a48ec5
--- /dev/null
+++ b/plugins/tiles/src/main/resources/META-INF/template-suite.xml
@@ -0,0 +1,1188 @@
+<!--
+/*
+ * 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.
+ */
+-->
+<org.apache.tiles.autotag.model.TemplateSuite>
+ <name>tiles</name>
+ <documentation>This tag library provides Tiles tags.</documentation>
+ <templateClasses class="linked-hash-map">
+ <entry>
+ <string>org.apache.tiles.template.InsertDefinitionModel</string>
+ <org.apache.tiles.autotag.model.TemplateClass>
+ <name>org.apache.tiles.template.InsertDefinitionModel</name>
+ <tagName>insertDefinition</tagName>
+ <tagClassPrefix>InsertDefinition</tagClassPrefix>
+ <documentation><p>
+Insert a definition.
+</p>
+<p>
+Insert a definition with the possibility to override and specify parameters
+(called attributes). A definition can be seen as a (partially or totally)
+filled template that can override or complete attribute values.
+&lt;tiles:insertDefinition&gt; allows to define these attributes
+and pass them to the inserted jsp page, called template. Attributes are
+defined using nested tag &lt;tiles:putAttribute&gt; or
+&lt;tiles:putListAttribute&gt;.
+</p>
+<p>
+You must specify name tag attribute, for inserting a definition from definitions factory.
+</p>
+<p>
+Example :
+</p>
+
+<pre>
+ &lt;tiles:insertDefinition name=&quot;.my.tiles.defininition flush=&quot;true&quot;&gt;
+ &lt;tiles:putAttribute name=&quot;title&quot; value=&quot;My first page&quot; /&gt;
+ &lt;tiles:putAttribute name=&quot;header&quot; value=&quot;/common/header.jsp&quot; /&gt;
+ &lt;tiles:putAttribute name=&quot;footer&quot; value=&quot;/common/footer.jsp&quot; /&gt;
+ &lt;tiles:putAttribute name=&quot;menu&quot; value=&quot;/basic/menu.jsp&quot; /&gt;
+ &lt;tiles:putAttribute name=&quot;body&quot; value=&quot;/basic/helloBody.jsp&quot; /&gt;
+ &lt;/tiles:insertDefinition&gt;
+</pre></documentation>
+ <executeMethod>
+ <name>execute</name>
+ <documentation>Executes the operation.</documentation>
+ <parameters class="linked-hash-map">
+ <entry>
+ <string>definitionName</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>definitionName</name>
+ <exportedName>name</exportedName>
+ <documentation>The name of the definition to render.</documentation>
+ <type>java.lang.String</type>
+ <required>true</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>template</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>template</name>
+ <exportedName>template</exportedName>
+ <documentation>If specified, this template will be used instead of the one used by the definition.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>templateType</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>templateType</name>
+ <exportedName>templateType</exportedName>
+ <documentation>The type of the template attribute.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>templateExpression</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>templateExpression</name>
+ <exportedName>templateExpression</exportedName>
+ <documentation>The expression to evaluate to get the value of the template.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>role</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>role</name>
+ <exportedName>role</exportedName>
+ <documentation>A comma-separated list of roles. If present, the definition
+will be rendered only if the current user belongs to one of the roles.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>preparer</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>preparer</name>
+ <exportedName>preparer</exportedName>
+ <documentation>The preparer to use to invoke before the definition is
+rendered. If specified, it overrides the preparer specified in the definition itself.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>flush</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>flush</name>
+ <exportedName>flush</exportedName>
+ <documentation>If true, the response will be flushed after the insert.</documentation>
+ <type>boolean</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>request</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>request</name>
+ <exportedName>request</exportedName>
+ <documentation>The request.</documentation>
+ <type>org.apache.tiles.request.Request</type>
+ <required>false</required>
+ <request>true</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>modelBody</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>modelBody</name>
+ <exportedName>modelBody</exportedName>
+ <documentation>The body.</documentation>
+ <type>org.apache.tiles.autotag.core.runtime.ModelBody</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ </parameters>
+ </executeMethod>
+ </org.apache.tiles.autotag.model.TemplateClass>
+ </entry>
+ <entry>
+ <string>org.apache.tiles.template.ImportAttributeModel</string>
+ <org.apache.tiles.autotag.model.TemplateClass>
+ <name>org.apache.tiles.template.ImportAttributeModel</name>
+ <tagName>importAttribute</tagName>
+ <tagClassPrefix>ImportAttribute</tagClassPrefix>
+ <documentation><p>
+Import attribute(s) in specified context.
+</p>
+<p>
+Import attribute(s) to requested scope. Attribute name and scope are
+optional. If not specified, all attributes are imported in page scope. Once
+imported, an attribute can be used as any other beans from jsp contexts.
+</p></documentation>
+ <executeMethod>
+ <name>execute</name>
+ <documentation>Executes the model.</documentation>
+ <parameters class="linked-hash-map">
+ <entry>
+ <string>name</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>name</name>
+ <exportedName>name</exportedName>
+ <documentation>The name of the attribute to import. If it is null, all the attributes will be imported.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>scope</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>scope</name>
+ <exportedName>scope</exportedName>
+ <documentation>The scope into which the attribute(s) will be imported. If
+null, the import will go in page scope.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>toName</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>toName</name>
+ <exportedName>toName</exportedName>
+ <documentation>The name of the attribute into which the attribute will be
+imported. To be used in conjunction to name. If null, the value of name will be used.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>ignore</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>ignore</name>
+ <exportedName>ignore</exportedName>
+ <documentation>If true, if the attribute is not present, the problem will be ignored.</documentation>
+ <type>boolean</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>request</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>request</name>
+ <exportedName>request</exportedName>
+ <documentation>The request.</documentation>
+ <type>org.apache.tiles.request.Request</type>
+ <required>false</required>
+ <request>true</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ </parameters>
+ </executeMethod>
+ </org.apache.tiles.autotag.model.TemplateClass>
+ </entry>
+ <entry>
+ <string>org.apache.tiles.template.SetCurrentContainerModel</string>
+ <org.apache.tiles.autotag.model.TemplateClass>
+ <name>org.apache.tiles.template.SetCurrentContainerModel</name>
+ <tagName>setCurrentContainer</tagName>
+ <tagClassPrefix>SetCurrentContainer</tagClassPrefix>
+ <documentation>Selects a container to be used as the "current" container.</documentation>
+ <executeMethod>
+ <name>execute</name>
+ <documentation>Executes the model.</documentation>
+ <parameters class="linked-hash-map">
+ <entry>
+ <string>containerKey</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>containerKey</name>
+ <exportedName>containerKey</exportedName>
+ <documentation>The key of the container to be used as "current". If null, the default one will be used.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>request</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>request</name>
+ <exportedName>request</exportedName>
+ <documentation>The request.</documentation>
+ <type>org.apache.tiles.request.Request</type>
+ <required>false</required>
+ <request>true</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ </parameters>
+ </executeMethod>
+ </org.apache.tiles.autotag.model.TemplateClass>
+ </entry>
+ <entry>
+ <string>org.apache.tiles.template.AddListAttributeModel</string>
+ <org.apache.tiles.autotag.model.TemplateClass>
+ <name>org.apache.tiles.template.AddListAttributeModel</name>
+ <tagName>addListAttribute</tagName>
+ <tagClassPrefix>AddListAttribute</tagClassPrefix>
+ <documentation><p>
+Declare a list that will be pass as an attribute.
+</p>
+<p>
+Declare a list that will be pass as an attribute . List elements are added
+using the tag 'addAttribute' or 'addListAttribute'. This tag can only be used
+inside 'insertTemplate', 'insertDefinition' or 'definition' tag.
+</p></documentation>
+ <executeMethod>
+ <name>execute</name>
+ <documentation>Executes the model.</documentation>
+ <parameters class="linked-hash-map">
+ <entry>
+ <string>role</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>role</name>
+ <exportedName>role</exportedName>
+ <documentation>The comma-separated list of roles that can use the list attribute.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>request</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>request</name>
+ <exportedName>request</exportedName>
+ <documentation>The request.</documentation>
+ <type>org.apache.tiles.request.Request</type>
+ <required>false</required>
+ <request>true</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>modelBody</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>modelBody</name>
+ <exportedName>modelBody</exportedName>
+ <documentation>The body.</documentation>
+ <type>org.apache.tiles.autotag.core.runtime.ModelBody</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ </parameters>
+ </executeMethod>
+ </org.apache.tiles.autotag.model.TemplateClass>
+ </entry>
+ <entry>
+ <string>org.apache.tiles.template.GetAsStringModel</string>
+ <org.apache.tiles.autotag.model.TemplateClass>
+ <name>org.apache.tiles.template.GetAsStringModel</name>
+ <tagName>getAsString</tagName>
+ <tagClassPrefix>GetAsString</tagClassPrefix>
+ <documentation><p>
+ Render the value of the specified template attribute to the current Writer
+</p>
+
+<p>
+Retrieve the value of the specified template attribute property, and render
+it to the current Writer as a String. The usual toString() conversions is applied on found value.
+</p></documentation>
+ <executeMethod>
+ <name>execute</name>
+ <documentation>Executes the operation.</documentation>
+ <parameters class="linked-hash-map">
+ <entry>
+ <string>ignore</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>ignore</name>
+ <exportedName>ignore</exportedName>
+ <documentation>If true, if an exception happens during
+rendering, of if the attribute is null, the problem will be ignored.</documentation>
+ <type>boolean</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>preparer</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>preparer</name>
+ <exportedName>preparer</exportedName>
+ <documentation>The preparer to invoke before rendering the attribute.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>role</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>role</name>
+ <exportedName>role</exportedName>
+ <documentation>A comma-separated list of roles. If present, the attribute
+will be rendered only if the current user belongs to one of the roles.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>defaultValue</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>defaultValue</name>
+ <exportedName>defaultValue</exportedName>
+ <documentation>The default value of the attribute. To use only if
+the attribute was not computed.</documentation>
+ <type>java.lang.Object</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>defaultValueRole</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>defaultValueRole</name>
+ <exportedName>defaultValueRole</exportedName>
+ <documentation>The default comma-separated list of roles. To use
+only if the attribute was not computed.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>defaultValueType</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>defaultValueType</name>
+ <exportedName>defaultValueType</exportedName>
+ <documentation>The default type of the attribute. To use only if
+the attribute was not computed.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>name</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>name</name>
+ <exportedName>name</exportedName>
+ <documentation>The name of the attribute.</documentation>
+ <type>java.lang.String</type>
+ <required>true</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>value</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>value</name>
+ <exportedName>value</exportedName>
+ <documentation>The attribute to use immediately, if not null.</documentation>
+ <type>org.apache.tiles.api.Attribute</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>request</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>request</name>
+ <exportedName>request</exportedName>
+ <documentation>The request.</documentation>
+ <type>org.apache.tiles.request.Request</type>
+ <required>false</required>
+ <request>true</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>modelBody</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>modelBody</name>
+ <exportedName>modelBody</exportedName>
+ <documentation>The body.</documentation>
+ <type>org.apache.tiles.autotag.core.runtime.ModelBody</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ </parameters>
+ </executeMethod>
+ </org.apache.tiles.autotag.model.TemplateClass>
+ </entry>
+ <entry>
+ <string>org.apache.tiles.template.InsertAttributeModel</string>
+ <org.apache.tiles.autotag.model.TemplateClass>
+ <name>org.apache.tiles.template.InsertAttributeModel</name>
+ <tagName>insertAttribute</tagName>
+ <tagClassPrefix>InsertAttribute</tagClassPrefix>
+ <documentation><p>
+Inserts the value of an attribute into the page.
+</p>
+<p>
+This tag can be flexibly used to insert the value of an attribute into a
+page. As in other usages in Tiles, every attribute can be determined to have
+a "type", either set explicitly when it was defined, or "computed". If the
+type is not explicit, then if the attribute value is a valid definition, it
+will be inserted as such. Otherwise, if it begins with a "/" character, it
+will be treated as a "template". Finally, if it has not otherwise been
+assigned a type, it will be treated as a String and included without any special handling.
+</p>
+
+<p>
+Example :
+</p>
+
+<pre>
+ &lt;tiles:insertAttribute name=&quot;body&quot; /&gt;
+</pre></documentation>
+ <executeMethod>
+ <name>execute</name>
+ <documentation>Executes the operation.</documentation>
+ <parameters class="linked-hash-map">
+ <entry>
+ <string>ignore</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>ignore</name>
+ <exportedName>ignore</exportedName>
+ <documentation>If true, if an exception happens during
+rendering, of if the attribute is null, the problem will be ignored.</documentation>
+ <type>boolean</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>preparer</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>preparer</name>
+ <exportedName>preparer</exportedName>
+ <documentation>The preparer to invoke before rendering the attribute.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>role</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>role</name>
+ <exportedName>role</exportedName>
+ <documentation>A comma-separated list of roles. If present, the attribute
+will be rendered only if the current user belongs to one of the roles.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>defaultValue</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>defaultValue</name>
+ <exportedName>defaultValue</exportedName>
+ <documentation>The default value of the attribute. To use only if
+the attribute was not computed.</documentation>
+ <type>java.lang.Object</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>defaultValueRole</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>defaultValueRole</name>
+ <exportedName>defaultValueRole</exportedName>
+ <documentation>The default comma-separated list of roles. To use
+only if the attribute was not computed.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>defaultValueType</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>defaultValueType</name>
+ <exportedName>defaultValueType</exportedName>
+ <documentation>The default type of the attribute. To use only if
+the attribute was not computed.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>name</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>name</name>
+ <exportedName>name</exportedName>
+ <documentation>The name of the attribute.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>value</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>value</name>
+ <exportedName>value</exportedName>
+ <documentation>The attribute to use immediately, if not null.</documentation>
+ <type>org.apache.tiles.api.Attribute</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>flush</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>flush</name>
+ <exportedName>flush</exportedName>
+ <documentation>If true, the response will be flushed after the insert.</documentation>
+ <type>boolean</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>request</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>request</name>
+ <exportedName>request</exportedName>
+ <documentation>The request.</documentation>
+ <type>org.apache.tiles.request.Request</type>
+ <required>false</required>
+ <request>true</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>modelBody</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>modelBody</name>
+ <exportedName>modelBody</exportedName>
+ <documentation>The body.</documentation>
+ <type>org.apache.tiles.autotag.core.runtime.ModelBody</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ </parameters>
+ </executeMethod>
+ </org.apache.tiles.autotag.model.TemplateClass>
+ </entry>
+ <entry>
+ <string>org.apache.tiles.template.PutAttributeModel</string>
+ <org.apache.tiles.autotag.model.TemplateClass>
+ <name>org.apache.tiles.template.PutAttributeModel</name>
+ <tagName>putAttribute</tagName>
+ <tagClassPrefix>PutAttribute</tagClassPrefix>
+ <documentation><p>
+Put an attribute in enclosing attribute container tag.
+</p>
+<p>
+Enclosing attribute container tag can be :
+<ul>
+<li>&lt;initContainer&gt;</li>
+<li>&lt;definition&gt;</li>
+<li>&lt;insertAttribute&gt;</li>
+<li>&lt;insertDefinition&gt;</li>
+<li>&lt;putListAttribute&gt;</li>
+</ul>
+(or any other tag which implements the PutAttributeTagParent
+interface. Exception is thrown if no appropriate tag can be found.
+</p>
+<p>
+Put tag can have following atributes :
+<ul>
+<li>name : Name of the attribute</li>
+<li>value : value to put as attribute</li>
+<li>type : value type. Possible type are : string (value is used as direct
+string), template (value is used as a page url to insert), definition (value
+is used as a definition name to insert), object (value is used as it is)</li>
+<li>role : Role to check when 'insertAttribute' will be called.</li>
+</ul>
+</p>
+<p>
+Value can also come from tag body. Tag body is taken into account only if
+value is not set by one of the tag attributes. In this case Attribute type is
+"string", unless tag body define another type.
+</p></documentation>
+ <executeMethod>
+ <name>execute</name>
+ <documentation>Executes the operation.</documentation>
+ <parameters class="linked-hash-map">
+ <entry>
+ <string>name</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>name</name>
+ <exportedName>name</exportedName>
+ <documentation>The name of the attribute to put.</documentation>
+ <type>java.lang.String</type>
+ <required>true</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>value</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>value</name>
+ <exportedName>value</exportedName>
+ <documentation>The value of the attribute. Use this parameter, or expression, or body.</documentation>
+ <type>java.lang.Object</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>expression</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>expression</name>
+ <exportedName>expression</exportedName>
+ <documentation>The expression to calculate the value from. Use this
+parameter, or value, or body.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>role</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>role</name>
+ <exportedName>role</exportedName>
+ <documentation>A comma-separated list of roles. If present, the attribute
+will be rendered only if the current user belongs to one of the roles.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>type</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>type</name>
+ <exportedName>type</exportedName>
+ <documentation>The type (renderer) of the attribute.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>cascade</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>cascade</name>
+ <exportedName>cascade</exportedName>
+ <documentation>If true the attribute will be cascaded to all nested attributes.</documentation>
+ <type>boolean</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>request</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>request</name>
+ <exportedName>request</exportedName>
+ <documentation>The request.</documentation>
+ <type>org.apache.tiles.request.Request</type>
+ <required>false</required>
+ <request>true</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>modelBody</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>modelBody</name>
+ <exportedName>modelBody</exportedName>
+ <documentation>The body.</documentation>
+ <type>org.apache.tiles.autotag.core.runtime.ModelBody</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ </parameters>
+ </executeMethod>
+ </org.apache.tiles.autotag.model.TemplateClass>
+ </entry>
+ <entry>
+ <string>org.apache.tiles.template.DefinitionModel</string>
+ <org.apache.tiles.autotag.model.TemplateClass>
+ <name>org.apache.tiles.template.DefinitionModel</name>
+ <tagName>definition</tagName>
+ <tagClassPrefix>Definition</tagClassPrefix>
+ <documentation><p>
+Create a definition at runtime.
+</p>
+<p>
+Create a new definition at runtime. Newly created definition will be
+available across the entire request.
+</p></documentation>
+ <executeMethod>
+ <name>execute</name>
+ <documentation>Executes the operation.</documentation>
+ <parameters class="linked-hash-map">
+ <entry>
+ <string>name</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>name</name>
+ <exportedName>name</exportedName>
+ <documentation>The name of the definition to create. If not specified, an
+anonymous definition will be created.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>template</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>template</name>
+ <exportedName>template</exportedName>
+ <documentation>The template of this definition.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>role</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>role</name>
+ <exportedName>role</exportedName>
+ <documentation>A comma-separated list of roles. If present, the definition
+will be rendered only if the current user belongs to one of the roles.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>extendsParam</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>extendsParam</name>
+ <exportedName>extends</exportedName>
+ <documentation>The definition name that this definition extends.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>preparer</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>preparer</name>
+ <exportedName>preparer</exportedName>
+ <documentation>The preparer to use to invoke before the definition is rendered.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>request</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>request</name>
+ <exportedName>request</exportedName>
+ <documentation>The request.</documentation>
+ <type>org.apache.tiles.request.Request</type>
+ <required>false</required>
+ <request>true</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>modelBody</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>modelBody</name>
+ <exportedName>modelBody</exportedName>
+ <documentation>The body.</documentation>
+ <type>org.apache.tiles.autotag.core.runtime.ModelBody</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ </parameters>
+ </executeMethod>
+ </org.apache.tiles.autotag.model.TemplateClass>
+ </entry>
+ <entry>
+ <string>org.apache.tiles.template.AddAttributeModel</string>
+ <org.apache.tiles.autotag.model.TemplateClass>
+ <name>org.apache.tiles.template.AddAttributeModel</name>
+ <tagName>addAttribute</tagName>
+ <tagClassPrefix>AddAttribute</tagClassPrefix>
+ <documentation><p>
+Add an element to the surrounding list. Equivalent to 'putAttribute',
+but for list element.
+</p>
+
+<p>
+Add an element to the surrounding list. This tag can only be used inside
+'putListAttribute' or 'addListAttribute' tags. Value can come from a direct
+assignment (value="aValue")
+</p></documentation>
+ <executeMethod>
+ <name>execute</name>
+ <documentation>Executes the operation.</documentation>
+ <parameters class="linked-hash-map">
+ <entry>
+ <string>value</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>value</name>
+ <exportedName>value</exportedName>
+ <documentation>The value of the attribute. Use this parameter, or expression, or body.</documentation>
+ <type>java.lang.Object</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>expression</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>expression</name>
+ <exportedName>expression</exportedName>
+ <documentation>The expression to calculate the value from. Use this
+parameter, or value, or body.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>role</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>role</name>
+ <exportedName>role</exportedName>
+ <documentation>A comma-separated list of roles. If present, the attribute
+will be rendered only if the current user belongs to one of the roles.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>type</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>type</name>
+ <exportedName>type</exportedName>
+ <documentation>The type (renderer) of the attribute.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>request</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>request</name>
+ <exportedName>request</exportedName>
+ <documentation>The request.</documentation>
+ <type>org.apache.tiles.request.Request</type>
+ <required>false</required>
+ <request>true</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>modelBody</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>modelBody</name>
+ <exportedName>modelBody</exportedName>
+ <documentation>The body.</documentation>
+ <type>org.apache.tiles.autotag.core.runtime.ModelBody</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ </parameters>
+ </executeMethod>
+ </org.apache.tiles.autotag.model.TemplateClass>
+ </entry>
+ <entry>
+ <string>org.apache.tiles.template.PutListAttributeModel</string>
+ <org.apache.tiles.autotag.model.TemplateClass>
+ <name>org.apache.tiles.template.PutListAttributeModel</name>
+ <tagName>putListAttribute</tagName>
+ <tagClassPrefix>PutListAttribute</tagClassPrefix>
+ <documentation><p>
+Declare a list that will be pass as attribute to tile.
+</p>
+<p>
+Declare a list that will be pass as attribute to tile. List elements are
+added using the tags 'addAttribute' or 'addListAttribute'. This tag can only
+be used inside 'insertTemplate', 'insertDefinition', 'definition' tags.
+</p></documentation>
+ <executeMethod>
+ <name>execute</name>
+ <documentation>Executes the model.</documentation>
+ <parameters class="linked-hash-map">
+ <entry>
+ <string>name</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>name</name>
+ <exportedName>name</exportedName>
+ <documentation>The name of the attribute to put.</documentation>
+ <type>java.lang.String</type>
+ <required>true</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>role</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>role</name>
+ <exportedName>role</exportedName>
+ <documentation>A comma-separated list of roles. If present, the attribute
+will be rendered only if the current user belongs to one of the roles.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>inherit</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>inherit</name>
+ <exportedName>inherit</exportedName>
+ <documentation>If true, the list attribute will use, as first elements, the
+list contained in the list attribute, put with the same name, of the containing definition.</documentation>
+ <type>boolean</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>cascade</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>cascade</name>
+ <exportedName>cascade</exportedName>
+ <documentation>If true the attribute will be cascaded to all nested attributes.</documentation>
+ <type>boolean</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>request</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>request</name>
+ <exportedName>request</exportedName>
+ <documentation>The request.</documentation>
+ <type>org.apache.tiles.request.Request</type>
+ <required>false</required>
+ <request>true</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>modelBody</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>modelBody</name>
+ <exportedName>modelBody</exportedName>
+ <documentation>The body.</documentation>
+ <type>org.apache.tiles.autotag.core.runtime.ModelBody</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ </parameters>
+ </executeMethod>
+ </org.apache.tiles.autotag.model.TemplateClass>
+ </entry>
+ <entry>
+ <string>org.apache.tiles.template.InsertTemplateModel</string>
+ <org.apache.tiles.autotag.model.TemplateClass>
+ <name>org.apache.tiles.template.InsertTemplateModel</name>
+ <tagName>insertTemplate</tagName>
+ <tagClassPrefix>InsertTemplate</tagClassPrefix>
+ <documentation><p>
+Insert a template.
+</p>
+<p>
+Insert a template with the possibility to pass parameters (called
+attributes). A template can be seen as a procedure that can take parameters
+or attributes. &lt;tiles:insertTemplate&gt; allows to define
+these attributes and pass them to the inserted jsp page, called template.
+Attributes are defined using nested tag
+&lt;tiles:putAttribute&gt; or
+&lt;tiles:putListAttribute&gt;.
+</p>
+<p>
+You must specify template attribute, for inserting a template
+</p>
+
+<p>
+Example :
+</p>
+
+<pre>
+ &lt;tiles:insertTemplate template=&quot;/basic/myLayout.jsp&quot; flush=&quot;true&quot;&gt;
+ &lt;tiles:putAttribute name=&quot;title&quot; value=&quot;My first page&quot; /&gt;
+ &lt;tiles:putAttribute name=&quot;header&quot; value=&quot;/common/header.jsp&quot; /&gt;
+ &lt;tiles:putAttribute name=&quot;footer&quot; value=&quot;/common/footer.jsp&quot; /&gt;
+ &lt;tiles:putAttribute name=&quot;menu&quot; value=&quot;/basic/menu.jsp&quot; /&gt;
+ &lt;tiles:putAttribute name=&quot;body&quot; value=&quot;/basic/helloBody.jsp&quot; /&gt;
+ &lt;/tiles:insertTemplate&gt;
+</pre></documentation>
+ <executeMethod>
+ <name>execute</name>
+ <documentation>Executes the operation.</documentation>
+ <parameters class="linked-hash-map">
+ <entry>
+ <string>template</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>template</name>
+ <exportedName>template</exportedName>
+ <documentation>The template to render.</documentation>
+ <type>java.lang.String</type>
+ <required>true</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>templateType</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>templateType</name>
+ <exportedName>templateType</exportedName>
+ <documentation>The type of the template attribute.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>templateExpression</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>templateExpression</name>
+ <exportedName>templateExpression</exportedName>
+ <documentation>The expression to evaluate to get the value of the template.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>role</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>role</name>
+ <exportedName>role</exportedName>
+ <documentation>A comma-separated list of roles. If present, the template
+will be rendered only if the current user belongs to one of the roles.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>preparer</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>preparer</name>
+ <exportedName>preparer</exportedName>
+ <documentation>The preparer to use to invoke before the definition is
+rendered. If specified, it overrides the preparer specified in the
+definition itself.</documentation>
+ <type>java.lang.String</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>flush</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>flush</name>
+ <exportedName>flush</exportedName>
+ <documentation>If true, the response will be flushed after the insert.</documentation>
+ <type>boolean</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>request</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>request</name>
+ <exportedName>request</exportedName>
+ <documentation>The request.</documentation>
+ <type>org.apache.tiles.request.Request</type>
+ <required>false</required>
+ <request>true</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ <entry>
+ <string>modelBody</string>
+ <org.apache.tiles.autotag.model.TemplateParameter>
+ <name>modelBody</name>
+ <exportedName>modelBody</exportedName>
+ <documentation>The body.</documentation>
+ <type>org.apache.tiles.autotag.core.runtime.ModelBody</type>
+ <required>false</required>
+ <request>false</request>
+ </org.apache.tiles.autotag.model.TemplateParameter>
+ </entry>
+ </parameters>
+ </executeMethod>
+ </org.apache.tiles.autotag.model.TemplateClass>
+ </entry>
+ </templateClasses>
+</org.apache.tiles.autotag.model.TemplateSuite>
\ No newline at end of file
diff --git a/plugins/tiles/src/main/resources/META-INF/tld/tiles-jsp.tld b/plugins/tiles/src/main/resources/META-INF/tld/tiles-jsp.tld
index 6a85017ac..10d63e325 100644
--- a/plugins/tiles/src/main/resources/META-INF/tld/tiles-jsp.tld
+++ b/plugins/tiles/src/main/resources/META-INF/tld/tiles-jsp.tld
@@ -19,13 +19,14 @@
* under the License.
*/
-->
+<!-- This file was automatically generated. Please do not edit it manually -->
<taglib
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.1">
<description>
<![CDATA[
- <p>This tag library provides Tiles tags.</p>
+ This tag library provides Tiles tags.
]]>
</description>
<tlib-version>1.2</tlib-version>
@@ -34,13 +35,17 @@
<tag>
<description>
<![CDATA[
- <p>Insert a definition.</p>
<p>
- Insert a definition with the possibility to override and specify parameters (called attributes).
- A definition can be seen as a (partially or totally) filled template that can override or
- complete attribute values. <tiles:insertDefinition> allows to define these attributes
- and pass them to the inserted jsp page, called template. Attributes are defined using nested
- tag <tiles:putAttribute> or <tiles:putListAttribute>.
+ Insert a definition.
+ </p>
+ <p>
+ Insert a definition with the possibility to override and specify parameters
+ (called attributes). A definition can be seen as a (partially or totally)
+ filled template that can override or complete attribute values.
+ <tiles:insertDefinition> allows to define these attributes
+ and pass them to the inserted jsp page, called template. Attributes are
+ defined using nested tag <tiles:putAttribute> or
+ <tiles:putListAttribute>.
</p>
<p>
You must specify name tag attribute, for inserting a definition from definitions factory.
@@ -48,14 +53,15 @@
<p>
Example :
</p>
+
<pre>
- <tiles:insertDefinition name=".my.tiles.defininition flush="true">
- <tiles:putAttribute name="title" value="My first page" />
- <tiles:putAttribute name="header" value="/common/header.jsp" />
- <tiles:putAttribute name="footer" value="/common/footer.jsp" />
- <tiles:putAttribute name="menu" value="/basic/menu.jsp" />
- <tiles:putAttribute name="body" value="/basic/helloBody.jsp" />
- </tiles:insertDefinition>
+ <tiles:insertDefinition name=".my.tiles.defininition flush="true">
+ <tiles:putAttribute name="title" value="My first page" />
+ <tiles:putAttribute name="header" value="/common/header.jsp" />
+ <tiles:putAttribute name="footer" value="/common/footer.jsp" />
+ <tiles:putAttribute name="menu" value="/basic/menu.jsp" />
+ <tiles:putAttribute name="body" value="/basic/helloBody.jsp" />
+ </tiles:insertDefinition>
</pre>
]]>
</description>
@@ -109,8 +115,8 @@
<attribute>
<description>
<![CDATA[
- A comma-separated list of roles. If present, the definition will be rendered only if
- the current user belongs to one of the roles.
+ A comma-separated list of roles. If present, the definition
+ will be rendered only if the current user belongs to one of the roles.
]]>
</description>
<name>role</name>
@@ -121,8 +127,8 @@
<attribute>
<description>
<![CDATA[
- The preparer to use to invoke before the definition is rendered. If specified, it
- overrides the preparer specified in the definition itself.
+ The preparer to use to invoke before the definition is
+ rendered. If specified, it overrides the preparer specified in the definition itself.
]]>
</description>
<name>preparer</name>
@@ -149,9 +155,9 @@
Import attribute(s) in specified context.
</p>
<p>
- Import attribute(s) to requested scope. Attribute name and scope are optional. If not
- specified, all attributes are imported in page scope. Once imported, an attribute can be
- used as any other beans from jsp contexts.
+ Import attribute(s) to requested scope. Attribute name and scope are
+ optional. If not specified, all attributes are imported in page scope. Once
+ imported, an attribute can be used as any other beans from jsp contexts.
</p>
]]>
</description>
@@ -172,8 +178,8 @@
<attribute>
<description>
<![CDATA[
- The scope into which the attribute(s) will be imported. If null, the import will go in page
- scope.
+ The scope into which the attribute(s) will be imported. If
+ null, the import will go in page scope.
]]>
</description>
<name>scope</name>
@@ -184,8 +190,8 @@
<attribute>
<description>
<![CDATA[
- The name of the attribute into which the attribute will be imported. To be used in conjunction
- to name. If null, the value of name will be used.
+ The name of the attribute into which the attribute will be
+ imported. To be used in conjunction to name. If null, the value of name will be used.
]]>
</description>
<name>toName</name>
@@ -217,7 +223,7 @@
<attribute>
<description>
<![CDATA[
- The key of the container to be used as 'current'. If null, the default one will be used.
+ The key of the container to be used as "current". If null, the default one will be used.
]]>
</description>
<name>containerKey</name>
@@ -233,9 +239,9 @@
Declare a list that will be pass as an attribute.
</p>
<p>
- Declare a list that will be pass as an attribute . List elements are added using the tag
- 'addAttribute' or 'addListAttribute'. This tag can only be used inside 'insertTemplate',
- 'insertDefinition' or 'definition' tag.
+ Declare a list that will be pass as an attribute . List elements are added
+ using the tag 'addAttribute' or 'addListAttribute'. This tag can only be used
+ inside 'insertTemplate', 'insertDefinition' or 'definition' tag.
</p>
]]>
</description>
@@ -258,11 +264,12 @@
<description>
<![CDATA[
<p>
- Render the value of the specified template attribute to the current Writer
+ Render the value of the specified template attribute to the current Writer
</p>
+
<p>
- Retrieve the value of the specified template attribute property, and render it to the current
- Writer as a String. The usual toString() conversions is applied on found value.
+ Retrieve the value of the specified template attribute property, and render
+ it to the current Writer as a String. The usual toString() conversions is applied on found value.
</p>
]]>
</description>
@@ -272,8 +279,8 @@
<attribute>
<description>
<![CDATA[
- If true, if an exception happens during rendering, of if the attribute is null, the problem
- will be ignored.
+ If true, if an exception happens during
+ rendering, of if the attribute is null, the problem will be ignored.
]]>
</description>
<name>ignore</name>
@@ -295,8 +302,8 @@
<attribute>
<description>
<![CDATA[
- A comma-separated list of roles. If present, the attribute will be rendered only if
- the current user belongs to one of the roles.
+ A comma-separated list of roles. If present, the attribute
+ will be rendered only if the current user belongs to one of the roles.
]]>
</description>
<name>role</name>
@@ -307,7 +314,8 @@
<attribute>
<description>
<![CDATA[
- The default value of the attribute. To use only if the attribute was not computed.
+ The default value of the attribute. To use only if
+ the attribute was not computed.
]]>
</description>
<name>defaultValue</name>
@@ -318,7 +326,8 @@
<attribute>
<description>
<![CDATA[
- The default comma-separated list of roles. To use only if the attribute was not computed.
+ The default comma-separated list of roles. To use
+ only if the attribute was not computed.
]]>
</description>
<name>defaultValueRole</name>
@@ -329,7 +338,8 @@
<attribute>
<description>
<![CDATA[
- The default type of the attribute. To use only if the attribute was not computed.
+ The default type of the attribute. To use only if
+ the attribute was not computed.
]]>
</description>
<name>defaultValueType</name>
@@ -357,7 +367,7 @@
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
- <type>org.apache.tiles.Attribute</type>
+ <type>org.apache.tiles.api.Attribute</type>
</attribute>
</tag>
<tag>
@@ -367,18 +377,21 @@
Inserts the value of an attribute into the page.
</p>
<p>
- This tag can be flexibly used to insert the value of an attribute into a page. As in other
- usages in Tiles, every attribute can be determined to have a 'type', either set explicitly
- when it was defined, or 'computed'. If the type is not explicit, then if the attribute value
- is a valid definition, it will be inserted as such. Otherwise, if it begins with a '/' character,
- it will be treated as a 'template'. Finally, if it has not otherwise been assigned a type,
- it will be treated as a String and included without any special handling.
+ This tag can be flexibly used to insert the value of an attribute into a
+ page. As in other usages in Tiles, every attribute can be determined to have
+ a "type", either set explicitly when it was defined, or "computed". If the
+ type is not explicit, then if the attribute value is a valid definition, it
+ will be inserted as such. Otherwise, if it begins with a "/" character, it
+ will be treated as a "template". Finally, if it has not otherwise been
+ assigned a type, it will be treated as a String and included without any special handling.
</p>
+
<p>
Example :
</p>
+
<pre>
- <tiles:insertAttribute name="body" />
+ <tiles:insertAttribute name="body" />
</pre>
]]>
</description>
@@ -388,8 +401,8 @@
<attribute>
<description>
<![CDATA[
- If true, if an exception happens during rendering, of if the attribute is null,
- the problem will be ignored.
+ If true, if an exception happens during
+ rendering, of if the attribute is null, the problem will be ignored.
]]>
</description>
<name>ignore</name>
@@ -411,8 +424,8 @@
<attribute>
<description>
<![CDATA[
- A comma-separated list of roles. If present, the attribute will be rendered only if
- the current user belongs to one of the roles.
+ A comma-separated list of roles. If present, the attribute
+ will be rendered only if the current user belongs to one of the roles.
]]>
</description>
<name>role</name>
@@ -423,7 +436,8 @@
<attribute>
<description>
<![CDATA[
- The default value of the attribute. To use only if the attribute was not computed.
+ The default value of the attribute. To use only if
+ the attribute was not computed.
]]>
</description>
<name>defaultValue</name>
@@ -434,7 +448,8 @@
<attribute>
<description>
<![CDATA[
- The default comma-separated list of roles. To use only if the attribute was not computed.
+ The default comma-separated list of roles. To use
+ only if the attribute was not computed.
]]>
</description>
<name>defaultValueRole</name>
@@ -445,7 +460,8 @@
<attribute>
<description>
<![CDATA[
- The default type of the attribute. To use only if the attribute was not computed.
+ The default type of the attribute. To use only if
+ the attribute was not computed.
]]>
</description>
<name>defaultValueType</name>
@@ -473,7 +489,7 @@
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
- <type>org.apache.tiles.Attribute</type>
+ <type>org.apache.tiles.api.Attribute</type>
</attribute>
<attribute>
<description>
@@ -502,24 +518,24 @@
<li><insertDefinition></li>
<li><putListAttribute></li>
</ul>
- or any other tag which implements the PutAttributeTagParent interface. Exception is thrown
- if no appropriate tag can be found.
+ (or any other tag which implements the PutAttributeTagParent
+ interface. Exception is thrown if no appropriate tag can be found.
</p>
<p>
Put tag can have following atributes :
<ul>
<li>name : Name of the attribute</li>
<li>value : value to put as attribute</li>
- <li>type : value type. Possible type are : string (value is used as direct string),
- template (value is used as a page url to insert), definition (value is used as a definition
- name to insert), object (value is used as it is)</li>
+ <li>type : value type. Possible type are : string (value is used as direct
+ string), template (value is used as a page url to insert), definition (value
+ is used as a definition name to insert), object (value is used as it is)</li>
<li>role : Role to check when 'insertAttribute' will be called.</li>
</ul>
</p>
<p>
- Value can also come from tag body. Tag body is taken into account only if value is not set
- by one of the tag attributes. In this case Attribute type is 'string', unless tag body define
- another type.
+ Value can also come from tag body. Tag body is taken into account only if
+ value is not set by one of the tag attributes. In this case Attribute type is
+ "string", unless tag body define another type.
</p>
]]>
</description>
@@ -551,7 +567,8 @@
<attribute>
<description>
<![CDATA[
- The expression to calculate the value from. Use this parameter, or value, or body.
+ The expression to calculate the value from. Use this
+ parameter, or value, or body.
]]>
</description>
<name>expression</name>
@@ -562,8 +579,8 @@
<attribute>
<description>
<![CDATA[
- A comma-separated list of roles. If present, the attribute will be rendered only if
- the current user belongs to one of the roles.
+ A comma-separated list of roles. If present, the attribute
+ will be rendered only if the current user belongs to one of the roles.
]]>
</description>
<name>role</name>
@@ -601,8 +618,8 @@
Create a definition at runtime.
</p>
<p>
- Create a new definition at runtime. Newly created definition will be available across the
- entire request.
+ Create a new definition at runtime. Newly created definition will be
+ available across the entire request.
</p>
]]>
</description>
@@ -612,7 +629,8 @@
<attribute>
<description>
<![CDATA[
- The name of the definition to create. If not specified, an anonymous definition will be created.
+ The name of the definition to create. If not specified, an
+ anonymous definition will be created.
]]>
</description>
<name>name</name>
@@ -634,8 +652,8 @@
<attribute>
<description>
<![CDATA[
- A comma-separated list of roles. If present, the definition will be rendered only if the
- current user belongs to one of the roles.
+ A comma-separated list of roles. If present, the definition
+ will be rendered only if the current user belongs to one of the roles.
]]>
</description>
<name>role</name>
@@ -670,11 +688,14 @@
<description>
<![CDATA[
<p>
- Add an element to the surrounding list. Equivalent to 'putAttribute', but for list element.
+ Add an element to the surrounding list. Equivalent to 'putAttribute',
+ but for list element.
</p>
+
<p>
- Add an element to the surrounding list. This tag can only be used inside 'putListAttribute'
- or 'addListAttribute' tags. Value can come from a direct assignment (value="aValue")
+ Add an element to the surrounding list. This tag can only be used inside
+ 'putListAttribute' or 'addListAttribute' tags. Value can come from a direct
+ assignment (value="aValue")
</p>
]]>
</description>
@@ -695,7 +716,8 @@
<attribute>
<description>
<![CDATA[
- The expression to calculate the value from. Use this parameter, or value, or body.
+ The expression to calculate the value from. Use this
+ parameter, or value, or body.
]]>
</description>
<name>expression</name>
@@ -706,8 +728,8 @@
<attribute>
<description>
<![CDATA[
- A comma-separated list of roles. If present, the attribute will be rendered only if the
- current user belongs to one of the roles.
+ A comma-separated list of roles. If present, the attribute
+ will be rendered only if the current user belongs to one of the roles.
]]>
</description>
<name>role</name>
@@ -734,9 +756,9 @@
Declare a list that will be pass as attribute to tile.
</p>
<p>
- Declare a list that will be pass as attribute to tile. List elements are added using the tags
- 'addAttribute' or 'addListAttribute'. This tag can only be used inside 'insertTemplate',
- 'insertDefinition', 'definition' tags.
+ Declare a list that will be pass as attribute to tile. List elements are
+ added using the tags 'addAttribute' or 'addListAttribute'. This tag can only
+ be used inside 'insertTemplate', 'insertDefinition', 'definition' tags.
</p>
]]>
</description>
@@ -757,8 +779,8 @@
<attribute>
<description>
<![CDATA[
- A comma-separated list of roles. If present, the attribute will be rendered only if the
- current user belongs to one of the roles.
+ A comma-separated list of roles. If present, the attribute
+ will be rendered only if the current user belongs to one of the roles.
]]>
</description>
<name>role</name>
@@ -769,8 +791,8 @@
<attribute>
<description>
<![CDATA[
- If true, the list attribute will use, as first elements, the list contained in the list
- attribute, put with the same name, of the containing definition.
+ If true, the list attribute will use, as first elements, the
+ list contained in the list attribute, put with the same name, of the containing definition.
]]>
</description>
<name>inherit</name>
@@ -797,25 +819,30 @@
Insert a template.
</p>
<p>
- Insert a template with the possibility to pass parameters (called attributes). A template can
- be seen as a procedure that can take parameters or attributes. <tiles:insertTemplate>
- allows to define these attributes and pass them to the inserted jsp page, called template.
- Attributes are defined using nested tag <tiles:putAttribute> or <tiles:putListAttribute>.
+ Insert a template with the possibility to pass parameters (called
+ attributes). A template can be seen as a procedure that can take parameters
+ or attributes. <tiles:insertTemplate> allows to define
+ these attributes and pass them to the inserted jsp page, called template.
+ Attributes are defined using nested tag
+ <tiles:putAttribute> or
+ <tiles:putListAttribute>.
</p>
<p>
You must specify template attribute, for inserting a template
</p>
+
<p>
- Example :
+ Example :
</p>
+
<pre>
- <tiles:insertTemplate template="/basic/myLayout.jsp" flush="true">
- <tiles:putAttribute name="title" value="My first page" />
- <tiles:putAttribute name="header" value="/common/header.jsp" />
- <tiles:putAttribute name="footer" value="/common/footer.jsp" />
- <tiles:putAttribute name="menu" value="/basic/menu.jsp" />
- <tiles:putAttribute name="body" value="/basic/helloBody.jsp" />
- </tiles:insertTemplate>
+ <tiles:insertTemplate template="/basic/myLayout.jsp" flush="true">
+ <tiles:putAttribute name="title" value="My first page" />
+ <tiles:putAttribute name="header" value="/common/header.jsp" />
+ <tiles:putAttribute name="footer" value="/common/footer.jsp" />
+ <tiles:putAttribute name="menu" value="/basic/menu.jsp" />
+ <tiles:putAttribute name="body" value="/basic/helloBody.jsp" />
+ </tiles:insertTemplate>
</pre>
]]>
</description>
@@ -858,8 +885,8 @@
<attribute>
<description>
<![CDATA[
- A comma-separated list of roles. If present, the template will be rendered only if the
- current user belongs to one of the roles.
+ A comma-separated list of roles. If present, the template
+ will be rendered only if the current user belongs to one of the roles.
]]>
</description>
<name>role</name>
@@ -870,8 +897,9 @@
<attribute>
<description>
<![CDATA[
- The preparer to use to invoke before the definition is rendered. If specified, it overrides
- the preparer specified in the definition itself.
+ The preparer to use to invoke before the definition is
+ rendered. If specified, it overrides the preparer specified in the
+ definition itself.
]]>
</description>
<name>preparer</name>
diff --git a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/AddListAttributeTag.java b/plugins/tiles/src/main/resources/org/apache/tiles/autotag/jsp/bodyTag.vm
similarity index 51%
copy from plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/AddListAttributeTag.java
copy to plugins/tiles/src/main/resources/org/apache/tiles/autotag/jsp/bodyTag.vm
index 5f17d8145..f71d55514 100644
--- a/plugins/tiles/src/main/java/org/apache/tiles/web/jsp/taglib/AddListAttributeTag.java
+++ b/plugins/tiles/src/main/resources/org/apache/tiles/autotag/jsp/bodyTag.vm
@@ -16,64 +16,71 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.tiles.web.jsp.taglib;
+ /*
+ * This file was automatically generated.
+ */
+package ${packageName};
import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.SimpleTagSupport;
+#if(${clazz.hasBody()})
import org.apache.tiles.autotag.core.runtime.ModelBody;
-import org.apache.tiles.request.Request;
-import org.apache.tiles.request.jsp.autotag.JspAutotagRuntime;
-import org.apache.tiles.template.AddListAttributeModel;
+#end
import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
/**
- * <p>
- * Declare a list that will be pass as an attribute.
- * </p>
- * <p>
- * Declare a list that will be pass as an attribute . List elements are added
- * using the tag 'addAttribute' or 'addListAttribute'. This tag can only be used
- * inside 'insertTemplate', 'insertDefinition' or 'definition' tag.
- * </p>
+#foreach($line in $stringTool.splitOnNewlines(${clazz.documentation}))
+ * ${line}
+#end
*/
-public class AddListAttributeTag extends SimpleTagSupport {
+public class ${clazz.tagClassPrefix}Tag extends SimpleTagSupport {
/**
* The template model.
*/
- private AddListAttributeModel model = new AddListAttributeModel();
+ private ${clazz.name} model = new ${clazz.name}();
+#foreach($parameter in ${clazz.parameters})
/**
- * The comma-separated list of roles that can use the list attribute.
+#foreach($line in $stringTool.splitOnNewlines(${parameter.documentation}))
+ * ${line}
+#end
*/
- private String role;
+ private ${parameter.type} ${parameter.name};
+#end
+#foreach($parameter in ${clazz.parameters})
/**
- * Getter for role property.
+ * Getter for ${parameter.exportedName} property.
*
- * @return The comma-separated list of roles that can use the list attribute.
+ * @return
+#foreach($line in $stringTool.splitOnNewlines(${parameter.documentation}))
+ * ${line}
+#end
*/
- public String getRole() {
- return role;
+ public ${parameter.type} #if(${parameter.type} == 'boolean')is#{else}get#end${parameter.getterSetterSuffix}() {
+ return ${parameter.name};
}
/**
- * Setter for role property.
+ * Setter for ${parameter.exportedName} property.
*
- * @param role The comma-separated list of roles that can use the list
- * attribute.
+ * @param ${parameter.name}
+#foreach($line in $stringTool.splitOnNewlines(${parameter.documentation}))
+ * ${line}
+#end
*/
- public void setRole(String role) {
- this.role = role;
+ public void set${parameter.getterSetterSuffix}(${parameter.type} ${parameter.name}) {
+ this.${parameter.name} = ${parameter.name};
}
- /** {@inheritDoc} */
+#end
@Override
public void doTag() throws JspException, IOException {
- AutotagRuntime<Request> runtime = new JspAutotagRuntime();
+ AutotagRuntime<${requestClass}> runtime = new ${runtimeClass}();
if (runtime instanceof SimpleTagSupport) {
SimpleTagSupport tag = (SimpleTagSupport) runtime;
tag.setJspContext(getJspContext());
@@ -81,8 +88,15 @@ public class AddListAttributeTag extends SimpleTagSupport {
tag.setParent(getParent());
tag.doTag();
}
- Request request = runtime.createRequest();
+ ${requestClass} request = runtime.createRequest();
+#if(${clazz.hasBody()})
ModelBody modelBody = runtime.createModelBody();
- model.execute(role, request, modelBody);
+#end
+ model.execute(
+#foreach($parameter in ${clazz.parameters})
+ ${parameter.name},
+#end
+ request#if(${clazz.hasBody()}), modelBody#end
+ );
}
}
diff --git a/plugins/tiles/src/main/resources/org/apache/tiles/autotag/jsp/tld.vm b/plugins/tiles/src/main/resources/org/apache/tiles/autotag/jsp/tld.vm
new file mode 100644
index 000000000..8717882de
--- /dev/null
+++ b/plugins/tiles/src/main/resources/org/apache/tiles/autotag/jsp/tld.vm
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * 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.
+ */
+-->
+<!-- This file was automatically generated. Please do not edit it manually -->
+<taglib
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="2.1">
+ <description>
+ <![CDATA[
+#foreach($line in $stringTool.splitOnNewlines(${suite.documentation}))
+ $line
+#end
+ ]]>
+ </description>
+ <tlib-version>1.2</tlib-version>
+ <short-name>${suite.name}</short-name>
+ <uri>${parameters.taglibURI}</uri>
+#foreach($clazz in ${suite.getTemplateClasses()})
+ <tag>
+ <description>
+ <![CDATA[
+#foreach($line in $stringTool.splitOnNewlines(${clazz.documentation}))
+ $line
+#end
+ ]]>
+ </description>
+ <name>${clazz.tagName}</name>
+ <tag-class>${packageName}.${clazz.tagClassPrefix}Tag</tag-class>
+ <body-content>#if(${clazz.hasBody()})scriptless#{else}empty#end</body-content>
+#foreach($parameter in ${clazz.parameters})
+ <attribute>
+ <description>
+ <![CDATA[
+#foreach($line in $stringTool.splitOnNewlines(${parameter.documentation}))
+ $line
+#end
+ ]]>
+ </description>
+ <name>${parameter.exportedName}</name>
+ <required>${parameter.required}</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>${parameter.type}</type>
+ </attribute>
+#end
+ </tag>
+#end
+</taglib>
diff --git a/plugins/tiles/src/main/resources/org/apache/tiles/autotag/velocity.properties b/plugins/tiles/src/main/resources/org/apache/tiles/autotag/velocity.properties
new file mode 100644
index 000000000..29ae759db
--- /dev/null
+++ b/plugins/tiles/src/main/resources/org/apache/tiles/autotag/velocity.properties
@@ -0,0 +1,114 @@
+ # 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.
+# ----------------------------------------------------------------------------
+# These are the default properties for the
+# Velocity Runtime. These values are used when
+# Runtime.init() is called, and when Runtime.init(properties)
+# fails to find the specificed properties file.
+# ----------------------------------------------------------------------------
+
+
+# ----------------------------------------------------------------------------
+# R U N T I M E L O G
+# ----------------------------------------------------------------------------
+# Velocity uses the Servlet APIs logging facilites.
+
+# ----------------------------------------------------------------------------
+# This controls if Runtime.error(), info() and warn() messages include the
+# whole stack trace. The last property controls whether invalid references
+# are logged.
+# ----------------------------------------------------------------------------
+
+runtime.log.invalid.reference = true
+
+
+# ----------------------------------------------------------------------------
+# T E M P L A T E E N C O D I N G
+# ----------------------------------------------------------------------------
+
+input.encoding=ISO-8859-1
+output.encoding=ISO-8859-1
+
+
+# ----------------------------------------------------------------------------
+# F O R E A C H P R O P E R T I E S
+# ----------------------------------------------------------------------------
+# These properties control how the counter is accessed in the #foreach
+# directive. By default the reference $velocityCount will be available
+# in the body of the #foreach directive. The default starting value
+# for this reference is 1.
+# ----------------------------------------------------------------------------
+
+directive.foreach.counter.name = velocityCount
+directive.foreach.counter.initial.value = 1
+
+
+# ----------------------------------------------------------------------------
+# I N C L U D E P R O P E R T I E S
+# ----------------------------------------------------------------------------
+# These are the properties that governed the way #include'd content
+# is governed.
+# ----------------------------------------------------------------------------
+
+directive.include.output.errormsg.start = <!-- include error :
+directive.include.output.errormsg.end = see error log -->
+
+
+# ----------------------------------------------------------------------------
+# P A R S E P R O P E R T I E S
+# ----------------------------------------------------------------------------
+
+directive.parse.max.depth = 10
+
+
+# ----------------------------------------------------------------------------
+# VELOCIMACRO PROPERTIES
+# ----------------------------------------------------------------------------
+# global : name of default global library. It is expected to be in the regular
+# template path. You may remove it (either the file or this property) if
+# you wish with no harm.
+# ----------------------------------------------------------------------------
+# dev-changes by Marino
+resource.loader=class, string
+
+class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
+
+velocimacro.library.autoreload = false
+
+velocimacro.permissions.allow.inline = true
+velocimacro.permissions.allow.inline.to.replace.global = false
+velocimacro.permissions.allow.inline.local.scope = false
+
+velocimacro.context.localscope = false
+
+# ----------------------------------------------------------------------------
+# INTERPOLATION
+# ----------------------------------------------------------------------------
+# turn off and on interpolation of references and directives in string
+# literals. ON by default :)
+# ----------------------------------------------------------------------------
+runtime.interpolate.string.literals = true
+
+
+# ----------------------------------------------------------------------------
+# RESOURCE MANAGEMENT
+# ----------------------------------------------------------------------------
+# Allows alternative ResourceManager and ResourceCache implementations
+# to be plugged in.
+# ----------------------------------------------------------------------------
+resource.manager.class = org.apache.velocity.runtime.resource.ResourceManagerImpl
+resource.manager.cache.class = org.apache.velocity.runtime.resource.ResourceCacheImpl
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/autotag/jsp/JspTemplateGeneratorFactoryTest.java b/plugins/tiles/src/test/java/org/apache/tiles/autotag/jsp/JspTemplateGeneratorFactoryTest.java
new file mode 100644
index 000000000..a753756c9
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/autotag/jsp/JspTemplateGeneratorFactoryTest.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.jsp;
+
+import static org.easymock.EasyMock.*;
+import static org.junit.Assert.*;
+
+import java.io.File;
+
+import org.apache.tiles.autotag.generate.TemplateGenerator;
+import org.apache.tiles.autotag.generate.TemplateGeneratorBuilder;
+import org.apache.velocity.app.VelocityEngine;
+import org.junit.Test;
+
+/**
+ * Tests JspTemplateGeneratorFactory.
+ */
+public class JspTemplateGeneratorFactoryTest {
+
+ /**
+ * Test method JspTemplateGeneratorFactory#createTemplateGenerator().
+ */
+ @Test
+ public void testCreateTemplateGenerator() {
+ File classesOutputDirectory = createMock(File.class);
+ File resourcesOutputDirectory = createMock(File.class);
+ VelocityEngine velocityEngine = createMock(VelocityEngine.class);
+ TemplateGeneratorBuilder builder = createMock(TemplateGeneratorBuilder.class);
+ TemplateGenerator generator = createMock(TemplateGenerator.class);
+
+ expect(builder.setClassesOutputDirectory(classesOutputDirectory)).andReturn(builder);
+ expect(builder.setResourcesOutputDirectory(resourcesOutputDirectory)).andReturn(builder);
+ expect(builder.addResourcesTemplateSuiteGenerator(isA(TLDGenerator.class))).andReturn(builder);
+ expect(builder.addClassesTemplateClassGenerator(isA(TagClassGenerator.class))).andReturn(builder);
+ expect(builder.build()).andReturn(generator);
+
+ replay(classesOutputDirectory, resourcesOutputDirectory, velocityEngine, builder, generator);
+ JspTemplateGeneratorFactory factory = new JspTemplateGeneratorFactory(
+ classesOutputDirectory, resourcesOutputDirectory,
+ velocityEngine, builder);
+ assertSame(generator, factory.createTemplateGenerator());
+ verify(classesOutputDirectory, resourcesOutputDirectory, velocityEngine, builder, generator);
+ }
+
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/autotag/jsp/TLDGeneratorTest.java b/plugins/tiles/src/test/java/org/apache/tiles/autotag/jsp/TLDGeneratorTest.java
new file mode 100644
index 000000000..0fbe25c07
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/autotag/jsp/TLDGeneratorTest.java
@@ -0,0 +1,129 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.jsp;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.tiles.autotag.core.runtime.ModelBody;
+import org.apache.tiles.autotag.model.TemplateClass;
+import org.apache.tiles.autotag.model.TemplateMethod;
+import org.apache.tiles.autotag.model.TemplateParameter;
+import org.apache.tiles.autotag.model.TemplateSuite;
+import org.apache.velocity.app.VelocityEngine;
+import org.junit.Test;
+
+/**
+ * Tests TLDGenerator.
+ *
+ * @version $Rev: 1349964 $ $Date: 2012-06-13 13:18:51 -0400 (Wed, 13 Jun 2012) $
+ */
+public class TLDGeneratorTest {
+
+ public static final String REQUEST_CLASS = "org.apache.tiles.autotag.jsp.test.Request";
+
+ /**
+ * Test method for TLDGenerator#generate(File, String, TemplateSuite, Map).
+ * @throws Exception If something goes wrong.
+ */
+ @Test
+ public void testGenerate() throws Exception {
+ Properties props = new Properties();
+ InputStream propsStream = getClass().getResourceAsStream("/org/apache/tiles/autotag/velocity.properties");
+ props.load(propsStream);
+ propsStream.close();
+ VelocityEngine velocityEngine = new VelocityEngine(props);
+
+ TLDGenerator generator = new TLDGenerator(velocityEngine);
+ File file = File.createTempFile("autotag", null);
+ file.delete();
+ file.mkdir();
+ file.deleteOnExit();
+ TemplateSuite suite = new TemplateSuite("tldtest", "Test for TLD docs.");
+ Map<String, String> parameters = new HashMap<String, String>();
+ parameters.put("taglibURI", "http://www.initrode.net/tags/test");
+
+ List<TemplateParameter> params = new ArrayList<TemplateParameter>();
+ TemplateParameter param = new TemplateParameter("one", "one", "java.lang.String", null, true, false);
+ param.setDocumentation("Parameter one.");
+ params.add(param);
+ param = new TemplateParameter("two", "two", "int", null, false, false);
+ param.setDocumentation("Parameter two.");
+ params.add(param);
+ param = new TemplateParameter("three", "three", "long", null, false, false);
+ param.setDocumentation("Parameter three.");
+ params.add(param);
+ param = new TemplateParameter("request", "request", REQUEST_CLASS, null, false, true);
+ param.setDocumentation("The request.");
+ params.add(param);
+ param = new TemplateParameter("modelBody", "modelBody", ModelBody.class.getName(), null, false, false);
+ param.setDocumentation("The body.");
+ params.add(param);
+ TemplateMethod executeMethod = new TemplateMethod("execute", params);
+
+ TemplateClass clazz = new TemplateClass("org.apache.tiles.autotag.template.DoStuffTemplate",
+ "doStuff", "DoStuff", executeMethod);
+ clazz.setDocumentation("Documentation of the DoStuff class");
+
+ suite.addTemplateClass(clazz);
+ params = new ArrayList<TemplateParameter>();
+ param = new TemplateParameter("one", "one", "java.lang.Double", null, true, false);
+ param.setDocumentation("Parameter one.");
+ params.add(param);
+ param = new TemplateParameter("two", "two", "float", null, false, false);
+ param.setDocumentation("Parameter two.");
+ params.add(param);
+ param = new TemplateParameter("three", "three", "java.util.Date", null, false, false);
+ param.setDocumentation("Parameter three.");
+ params.add(param);
+ param = new TemplateParameter("request", "request", REQUEST_CLASS, null, false ,true);
+ param.setDocumentation("The request.");
+ params.add(param);
+ executeMethod = new TemplateMethod("execute", params);
+
+ clazz = new TemplateClass("org.apache.tiles.autotag.template.DoStuffNoBodyTemplate",
+ "doStuffNoBody", "DoStuffNoBody", executeMethod);
+ clazz.setDocumentation("Documentation of the DoStuffNoBody class");
+
+ suite.addTemplateClass(clazz);
+
+ generator.generate(file, "org.apache.tiles.autotag.jsp.test", suite, parameters);
+
+ InputStream expected = getClass().getResourceAsStream("/tldtest-jsp.tld");
+ File effectiveFile = new File(file, "META-INF/tld/tldtest-jsp.tld");
+ assertTrue(effectiveFile.exists());
+ InputStream effective = new FileInputStream(effectiveFile);
+ assertTrue(IOUtils.contentEquals(effective, expected));
+ effective.close();
+ expected.close();
+
+ FileUtils.deleteDirectory(file);
+ }
+
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/autotag/jsp/TagClassGeneratorTest.java b/plugins/tiles/src/test/java/org/apache/tiles/autotag/jsp/TagClassGeneratorTest.java
new file mode 100644
index 000000000..834ef8ebd
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/autotag/jsp/TagClassGeneratorTest.java
@@ -0,0 +1,139 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.autotag.jsp;
+
+import static org.junit.Assert.*;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.tiles.autotag.core.runtime.ModelBody;
+import org.apache.tiles.autotag.model.TemplateClass;
+import org.apache.tiles.autotag.model.TemplateMethod;
+import org.apache.tiles.autotag.model.TemplateParameter;
+import org.apache.tiles.autotag.model.TemplateSuite;
+import org.apache.velocity.app.VelocityEngine;
+import org.junit.Test;
+
+/**
+ * Tests TagClassGenerator.
+ */
+public class TagClassGeneratorTest {
+
+ public static final String REQUEST_CLASS = "org.apache.tiles.autotag.jsp.test.Request";
+
+ /**
+ * Test method for TagClassGenerator#generate(File, String, TemplateSuite, TemplateClass, Map).
+ * @throws Exception If something goes wrong.
+ */
+ @Test
+ public void testGenerate() throws Exception {
+ Properties props = new Properties();
+ InputStream propsStream = getClass().getResourceAsStream("/org/apache/tiles/autotag/velocity.properties");
+ props.load(propsStream);
+ propsStream.close();
+ VelocityEngine velocityEngine = new VelocityEngine(props);
+
+ TagClassGenerator generator = new TagClassGenerator(velocityEngine);
+ File file = File.createTempFile("autotag", null);
+ file.delete();
+ file.mkdir();
+ file.deleteOnExit();
+ TemplateSuite suite = new TemplateSuite("tldtest", "Test for TLD docs.");
+ Map<String, String> parameters = new HashMap<String, String>();
+ parameters.put("taglibURI", "http://www.initrode.net/tags/test");
+
+ List<TemplateParameter> params = new ArrayList<TemplateParameter>();
+ TemplateParameter param = new TemplateParameter("one", "one", "java.lang.String", null, true, false);
+ param.setDocumentation("Parameter one.");
+ params.add(param);
+ param = new TemplateParameter("two", "two", "int", null, false, false);
+ param.setDocumentation("Parameter two.");
+ params.add(param);
+ param = new TemplateParameter("three", "three", "boolean", null, false, false);
+ param.setDocumentation("Parameter three.");
+ params.add(param);
+ param = new TemplateParameter("request", "request", REQUEST_CLASS, null, false, true);
+ param.setDocumentation("The request.");
+ params.add(param);
+ param = new TemplateParameter("modelBody", "modelBody", ModelBody.class.getName(), null, false, false);
+ param.setDocumentation("The body.");
+ params.add(param);
+ TemplateMethod executeMethod = new TemplateMethod("execute", params);
+
+ TemplateClass clazz = new TemplateClass("org.apache.tiles.autotag.template.DoStuffTemplate",
+ "doStuff", "DoStuff", executeMethod);
+ clazz.setDocumentation("Documentation of the DoStuff class.");
+
+ generator.generate(file, "org.apache.tiles.autotag.jsp.test", suite, clazz, parameters,
+ "org.apache.tiles.autotag.jsp.test.Runtime", REQUEST_CLASS);
+
+ InputStream expected = getClass().getResourceAsStream("/org/apache/tiles/autotag/jsp/test/DoStuffTag.java");
+ File effectiveFile = new File(file, "/org/apache/tiles/autotag/jsp/test/DoStuffTag.java");
+ assertTrue(effectiveFile.exists());
+ InputStream effective = new FileInputStream(effectiveFile);
+ assertTrue(IOUtils.contentEquals(effective, expected));
+ effective.close();
+ expected.close();
+
+ suite.addTemplateClass(clazz);
+ params = new ArrayList<TemplateParameter>();
+ param = new TemplateParameter("one", "one", "java.lang.Double", null, true, false);
+ param.setDocumentation("Parameter one.");
+ params.add(param);
+ param = new TemplateParameter("two", "two", "float", null, false, false);
+ param.setDocumentation("Parameter two.");
+ params.add(param);
+ param = new TemplateParameter("three", "three", "java.util.Date", null, false, false);
+ param.setDocumentation("Parameter three.");
+ params.add(param);
+ param = new TemplateParameter("request", "request", REQUEST_CLASS, null, false, true);
+ param.setDocumentation("The request.");
+ params.add(param);
+ executeMethod = new TemplateMethod("execute", params);
+
+ clazz = new TemplateClass("org.apache.tiles.autotag.template.DoStuffNoBodyTemplate",
+ "doStuffNoBody", "DoStuffNoBody", executeMethod);
+ clazz.setDocumentation("Documentation of the DoStuffNoBody class.");
+
+ suite.addTemplateClass(clazz);
+
+ generator.generate(file, "org.apache.tiles.autotag.jsp.test", suite, clazz, parameters,
+ "org.apache.tiles.autotag.jsp.test.Runtime", REQUEST_CLASS);
+
+ expected = getClass().getResourceAsStream("/org/apache/tiles/autotag/jsp/test/DoStuffNoBodyTag.java");
+ effectiveFile = new File(file, "/org/apache/tiles/autotag/jsp/test/DoStuffNoBodyTag.java");
+ assertTrue(effectiveFile.exists());
+ effective = new FileInputStream(effectiveFile);
+ assertTrue(IOUtils.contentEquals(effective, expected));
+ effective.close();
+ expected.close();
+
+ FileUtils.deleteDirectory(file);
+ }
+
+}
diff --git a/plugins/tiles/src/test/java/org/apache/tiles/web/jsp/taglib/UseAttributeTagTest.java b/plugins/tiles/src/test/java/org/apache/tiles/web/jsp/taglib/UseAttributeTagTest.java
new file mode 100644
index 000000000..48486746f
--- /dev/null
+++ b/plugins/tiles/src/test/java/org/apache/tiles/web/jsp/taglib/UseAttributeTagTest.java
@@ -0,0 +1,220 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tiles.web.jsp.taglib;
+
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.isA;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.PageContext;
+import javax.servlet.jsp.tagext.JspFragment;
+import javax.servlet.jsp.tagext.JspTag;
+import javax.servlet.jsp.tagext.TagData;
+import javax.servlet.jsp.tagext.VariableInfo;
+
+import org.apache.tiles.api.Attribute;
+import org.apache.tiles.api.AttributeContext;
+import org.apache.tiles.api.TilesContainer;
+import org.apache.tiles.api.access.TilesAccess;
+import org.apache.tiles.request.ApplicationAccess;
+import org.apache.tiles.request.ApplicationContext;
+import org.apache.tiles.request.jsp.JspRequest;
+import org.apache.tiles.web.jsp.taglib.UseAttributeTag;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests UseAttributeTag.
+ */
+public class UseAttributeTagTest {
+
+ /**
+ * The tag to test.
+ */
+ private UseAttributeTag tag;
+
+ /**
+ * Sets up the test.
+ */
+ @Before
+ public void setUp() {
+ tag = new UseAttributeTag();
+ }
+
+ /**
+ * Test method for
+ * {@link org/apache/tiles/web/jsp/taglib.UseAttributeTag#execute(org.apache.tiles.request.Request)}.
+ *
+ * @throws IOException
+ * @throws JspException
+ */
+ @Test
+ public void testExecute() throws JspException, IOException {
+ JspFragment jspBody = createMock(JspFragment.class);
+ PageContext pageContext = createMock(PageContext.class);
+ JspTag parent = createMock(JspTag.class);
+ ApplicationContext applicationContext = createMock(ApplicationContext.class);
+ HttpServletRequest httpServletRequest = createMock(HttpServletRequest.class);
+ HttpServletResponse httpServletResponse = createMock(HttpServletResponse.class);
+ Map<String, Object> applicationScope = createMock(Map.class);
+ TilesContainer container = createMock(TilesContainer.class);
+ AttributeContext attributeContext = createMock(AttributeContext.class);
+ Attribute attribute = createMock(Attribute.class);
+ expect(pageContext.getAttribute(ApplicationAccess.APPLICATION_CONTEXT_ATTRIBUTE, PageContext.APPLICATION_SCOPE))
+ .andReturn(applicationContext);
+ expect(applicationContext.getApplicationScope()).andReturn(applicationScope).anyTimes();
+ expect(pageContext.getRequest()).andReturn(httpServletRequest);
+ expect(pageContext.getResponse()).andReturn(httpServletResponse);
+ expect(pageContext.getAttribute(TilesAccess.CURRENT_CONTAINER_ATTRIBUTE_NAME, PageContext.REQUEST_SCOPE))
+ .andReturn(container);
+ expect(container.getAttributeContext(isA(JspRequest.class))).andReturn(attributeContext);
+ expect(attributeContext.getAttribute("name")).andReturn(attribute);
+ expect(container.evaluate(isA(Attribute.class), isA(JspRequest.class))).andReturn(new Integer(1));
+ pageContext.setAttribute("id", new Integer(1), PageContext.PAGE_SCOPE);
+ replay(jspBody, pageContext, parent, applicationContext, httpServletRequest, httpServletResponse,
+ applicationScope, container, attributeContext, attribute);
+ tag.setName("name");
+ tag.setScope("page");
+ tag.setId("id");
+ tag.setIgnore(false);
+ tag.setJspContext(pageContext);
+ tag.setJspBody(jspBody);
+ tag.setParent(parent);
+ tag.doTag();
+ verify(jspBody, pageContext, parent, applicationContext, httpServletRequest, httpServletResponse, container,
+ attributeContext, attribute);
+ }
+
+ /**
+ * Test method for
+ * {@link org/apache/tiles/web/jsp/taglib.UseAttributeTag#setId(java.lang.String)}.
+ */
+ @Test
+ public void testSetId() {
+ tag.setId("id");
+ assertEquals("id", tag.getId());
+ }
+
+ /**
+ * Test method for
+ * {@link org/apache/tiles/web/jsp/taglib.UseAttributeTag#getScope()}.
+ */
+ @Test
+ public void testGetScope() {
+ tag.setScope("scope");
+ assertEquals("scope", tag.getScope());
+ }
+
+ /**
+ * Test method for
+ * {@link org/apache/tiles/web/jsp/taglib.UseAttributeTag#setName(java.lang.String)}.
+ */
+ @Test
+ public void testSetName() {
+ tag.setName("name");
+ assertEquals("name", tag.getName());
+ }
+
+ /**
+ * Test method for
+ * {@link org/apache/tiles/web/jsp/taglib.UseAttributeTag#setIgnore(boolean)}.
+ */
+ @Test
+ public void testSetIgnore() {
+ tag.setIgnore(true);
+ assertTrue(tag.isIgnore());
+ }
+
+ /**
+ * Test method for
+ * {@link org/apache/tiles/web/jsp/taglib.UseAttributeTag#setClassname(java.lang.String)}.
+ */
+ @Test
+ public void testSetClassname() {
+ tag.setClassname("classname");
+ assertEquals("classname", tag.getClassname());
+ }
+
+ /**
+ * Test method for
+ * {@link org/apache/tiles/web/jsp/taglib.UseAttributeTag#getScriptingVariable()}.
+ */
+ @Test
+ public void testGetScriptingVariable() {
+ tag.setName("name");
+ assertEquals("name", tag.getScriptingVariable());
+ tag.setId("id");
+ assertEquals("id", tag.getScriptingVariable());
+ }
+
+ /**
+ * Tests {@link UseAttributeTag.Tei}.
+ */
+ @Test
+ public void testTei() {
+ TagData tagData = createMock(TagData.class);
+
+ expect(tagData.getAttributeString("classname")).andReturn("my.Clazz");
+ expect(tagData.getAttributeString("id")).andReturn("id");
+
+ replay(tagData);
+ UseAttributeTag.Tei tei = new UseAttributeTag.Tei();
+ VariableInfo[] infos = tei.getVariableInfo(tagData);
+ assertEquals(1, infos.length);
+ VariableInfo info = infos[0];
+ assertEquals("id", info.getVarName());
+ assertEquals("my.Clazz", info.getClassName());
+ assertTrue(info.getDeclare());
+ assertEquals(VariableInfo.AT_END, info.getScope());
+ verify(tagData);
+ }
+
+ /**
+ * Tests {@link UseAttributeTag.Tei}.
+ */
+ @Test
+ public void testTeiDefaults() {
+ TagData tagData = createMock(TagData.class);
+
+ expect(tagData.getAttributeString("classname")).andReturn(null);
+ expect(tagData.getAttributeString("id")).andReturn(null);
+ expect(tagData.getAttributeString("name")).andReturn("name");
+
+ replay(tagData);
+ UseAttributeTag.Tei tei = new UseAttributeTag.Tei();
+ VariableInfo[] infos = tei.getVariableInfo(tagData);
+ assertEquals(1, infos.length);
+ VariableInfo info = infos[0];
+ assertEquals("name", info.getVarName());
+ assertEquals("java.lang.Object", info.getClassName());
+ assertTrue(info.getDeclare());
+ assertEquals(VariableInfo.AT_END, info.getScope());
+ verify(tagData);
+ }
+}
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/autotag/jsp/test/DoStuffNoBodyTag.java b/plugins/tiles/src/test/resources/org/apache/tiles/autotag/jsp/test/DoStuffNoBodyTag.java
new file mode 100644
index 000000000..4dac7e17f
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/autotag/jsp/test/DoStuffNoBodyTag.java
@@ -0,0 +1,134 @@
+/*
+ * 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.
+ */
+ /*
+ * This file was automatically generated.
+ */
+package org.apache.tiles.autotag.jsp.test;
+
+import java.io.IOException;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+
+import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
+
+/**
+ * Documentation of the DoStuffNoBody class.
+ */
+public class DoStuffNoBodyTag extends SimpleTagSupport {
+
+ /**
+ * The template model.
+ */
+ private org.apache.tiles.autotag.template.DoStuffNoBodyTemplate model = new org.apache.tiles.autotag.template.DoStuffNoBodyTemplate();
+
+ /**
+ * Parameter one.
+ */
+ private java.lang.Double one;
+
+ /**
+ * Parameter two.
+ */
+ private float two;
+
+ /**
+ * Parameter three.
+ */
+ private java.util.Date three;
+
+ /**
+ * Getter for one property.
+ *
+ * @return
+ * Parameter one.
+ */
+ public java.lang.Double getOne() {
+ return one;
+ }
+
+ /**
+ * Setter for one property.
+ *
+ * @param one
+ * Parameter one.
+ */
+ public void setOne(java.lang.Double one) {
+ this.one = one;
+ }
+
+ /**
+ * Getter for two property.
+ *
+ * @return
+ * Parameter two.
+ */
+ public float getTwo() {
+ return two;
+ }
+
+ /**
+ * Setter for two property.
+ *
+ * @param two
+ * Parameter two.
+ */
+ public void setTwo(float two) {
+ this.two = two;
+ }
+
+ /**
+ * Getter for three property.
+ *
+ * @return
+ * Parameter three.
+ */
+ public java.util.Date getThree() {
+ return three;
+ }
+
+ /**
+ * Setter for three property.
+ *
+ * @param three
+ * Parameter three.
+ */
+ public void setThree(java.util.Date three) {
+ this.three = three;
+ }
+
+ @Override
+ public void doTag() throws JspException, IOException {
+ AutotagRuntime<org.apache.tiles.autotag.jsp.test.Request> runtime = new org.apache.tiles.autotag.jsp.test.Runtime();
+ if (runtime instanceof SimpleTagSupport) {
+ SimpleTagSupport tag = (SimpleTagSupport) runtime;
+ tag.setJspContext(getJspContext());
+ tag.setJspBody(getJspBody());
+ tag.setParent(getParent());
+ tag.doTag();
+ }
+ org.apache.tiles.autotag.jsp.test.Request request = runtime.createRequest();
+ model.execute(
+ one,
+ two,
+ three,
+ request
+ );
+ }
+}
diff --git a/plugins/tiles/src/test/resources/org/apache/tiles/autotag/jsp/test/DoStuffTag.java b/plugins/tiles/src/test/resources/org/apache/tiles/autotag/jsp/test/DoStuffTag.java
new file mode 100644
index 000000000..3116c37eb
--- /dev/null
+++ b/plugins/tiles/src/test/resources/org/apache/tiles/autotag/jsp/test/DoStuffTag.java
@@ -0,0 +1,136 @@
+/*
+ * 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.
+ */
+ /*
+ * This file was automatically generated.
+ */
+package org.apache.tiles.autotag.jsp.test;
+
+import java.io.IOException;
+
+import javax.servlet.jsp.JspException;
+import javax.servlet.jsp.tagext.SimpleTagSupport;
+
+import org.apache.tiles.autotag.core.runtime.ModelBody;
+import org.apache.tiles.autotag.core.runtime.AutotagRuntime;
+
+/**
+ * Documentation of the DoStuff class.
+ */
+public class DoStuffTag extends SimpleTagSupport {
+
+ /**
+ * The template model.
+ */
+ private org.apache.tiles.autotag.template.DoStuffTemplate model = new org.apache.tiles.autotag.template.DoStuffTemplate();
+
+ /**
+ * Parameter one.
+ */
+ private java.lang.String one;
+
+ /**
+ * Parameter two.
+ */
+ private int two;
+
+ /**
+ * Parameter three.
+ */
+ private boolean three;
+
+ /**
+ * Getter for one property.
+ *
+ * @return
+ * Parameter one.
+ */
+ public java.lang.String getOne() {
+ return one;
+ }
+
+ /**
+ * Setter for one property.
+ *
+ * @param one
+ * Parameter one.
+ */
+ public void setOne(java.lang.String one) {
+ this.one = one;
+ }
+
+ /**
+ * Getter for two property.
+ *
+ * @return
+ * Parameter two.
+ */
+ public int getTwo() {
+ return two;
+ }
+
+ /**
+ * Setter for two property.
+ *
+ * @param two
+ * Parameter two.
+ */
+ public void setTwo(int two) {
+ this.two = two;
+ }
+
+ /**
+ * Getter for three property.
+ *
+ * @return
+ * Parameter three.
+ */
+ public boolean isThree() {
+ return three;
+ }
+
+ /**
+ * Setter for three property.
+ *
+ * @param three
+ * Parameter three.
+ */
+ public void setThree(boolean three) {
+ this.three = three;
+ }
+
+ @Override
+ public void doTag() throws JspException, IOException {
+ AutotagRuntime<org.apache.tiles.autotag.jsp.test.Request> runtime = new org.apache.tiles.autotag.jsp.test.Runtime();
+ if (runtime instanceof SimpleTagSupport) {
+ SimpleTagSupport tag = (SimpleTagSupport) runtime;
+ tag.setJspContext(getJspContext());
+ tag.setJspBody(getJspBody());
+ tag.setParent(getParent());
+ tag.doTag();
+ }
+ org.apache.tiles.autotag.jsp.test.Request request = runtime.createRequest();
+ ModelBody modelBody = runtime.createModelBody();
+ model.execute(
+ one,
+ two,
+ three,
+ request, modelBody
+ );
+ }
+}
diff --git a/plugins/tiles/src/test/resources/tldtest-jsp.tld b/plugins/tiles/src/test/resources/tldtest-jsp.tld
new file mode 100644
index 000000000..6777e39b7
--- /dev/null
+++ b/plugins/tiles/src/test/resources/tldtest-jsp.tld
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * 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.
+ */
+-->
+<!-- This file was automatically generated. Please do not edit it manually -->
+<taglib
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="2.1">
+ <description>
+ <![CDATA[
+ Test for TLD docs.
+ ]]>
+ </description>
+ <tlib-version>1.2</tlib-version>
+ <short-name>tldtest</short-name>
+ <uri>http://www.initrode.net/tags/test</uri>
+ <tag>
+ <description>
+ <![CDATA[
+ Documentation of the DoStuff class
+ ]]>
+ </description>
+ <name>doStuff</name>
+ <tag-class>org.apache.tiles.autotag.jsp.test.DoStuffTag</tag-class>
+ <body-content>scriptless</body-content>
+ <attribute>
+ <description>
+ <![CDATA[
+ Parameter one.
+ ]]>
+ </description>
+ <name>one</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <description>
+ <![CDATA[
+ Parameter two.
+ ]]>
+ </description>
+ <name>two</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>int</type>
+ </attribute>
+ <attribute>
+ <description>
+ <![CDATA[
+ Parameter three.
+ ]]>
+ </description>
+ <name>three</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>long</type>
+ </attribute>
+ </tag>
+ <tag>
+ <description>
+ <![CDATA[
+ Documentation of the DoStuffNoBody class
+ ]]>
+ </description>
+ <name>doStuffNoBody</name>
+ <tag-class>org.apache.tiles.autotag.jsp.test.DoStuffNoBodyTag</tag-class>
+ <body-content>empty</body-content>
+ <attribute>
+ <description>
+ <![CDATA[
+ Parameter one.
+ ]]>
+ </description>
+ <name>one</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.lang.Double</type>
+ </attribute>
+ <attribute>
+ <description>
+ <![CDATA[
+ Parameter two.
+ ]]>
+ </description>
+ <name>two</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>float</type>
+ </attribute>
+ <attribute>
+ <description>
+ <![CDATA[
+ Parameter three.
+ ]]>
+ </description>
+ <name>three</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <type>java.util.Date</type>
+ </attribute>
+ </tag>
+</taglib>