From 2784e24fe38b6e37f1fce4729ceddf75a2927910 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Fri, 5 Oct 2012 10:54:36 +0000 Subject: [PATCH] WW-3872 adds Tiles support to portlet example app git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1394440 13f79535-47bb-0310-9956-ffa450edef68 --- ...ocessTilesFreemarkerExample-validation.xml | 13 ++++++ src/main/resources/struts-tiles.xml | 27 +++++++++++ src/main/webapp/WEB-INF/tiles.xml | 46 +++++++++++++++++++ src/main/webapp/WEB-INF/tiles/footer.ftl | 5 ++ src/main/webapp/WEB-INF/tiles/footer.jsp | 6 +++ src/main/webapp/WEB-INF/tiles/formExample.jsp | 5 ++ .../tiles/formExampleInputValidation.jsp | 8 ++++ src/main/webapp/WEB-INF/tiles/header.jsp | 2 + src/main/webapp/WEB-INF/tiles/index.jsp | 13 ++++++ src/main/webapp/WEB-INF/tiles/layout.jsp | 13 ++++++ 10 files changed, 138 insertions(+) create mode 100644 src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml create mode 100644 src/main/resources/struts-tiles.xml create mode 100644 src/main/webapp/WEB-INF/tiles.xml create mode 100644 src/main/webapp/WEB-INF/tiles/footer.ftl create mode 100644 src/main/webapp/WEB-INF/tiles/footer.jsp create mode 100644 src/main/webapp/WEB-INF/tiles/formExample.jsp create mode 100644 src/main/webapp/WEB-INF/tiles/formExampleInputValidation.jsp create mode 100644 src/main/webapp/WEB-INF/tiles/header.jsp create mode 100644 src/main/webapp/WEB-INF/tiles/index.jsp create mode 100644 src/main/webapp/WEB-INF/tiles/layout.jsp diff --git a/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml b/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml new file mode 100644 index 000000000..3151f2907 --- /dev/null +++ b/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml @@ -0,0 +1,13 @@ + + + + + You must enter a first name + + + + + You must enter a last name + + + diff --git a/src/main/resources/struts-tiles.xml b/src/main/resources/struts-tiles.xml new file mode 100644 index 000000000..8d2b80e16 --- /dev/null +++ b/src/main/resources/struts-tiles.xml @@ -0,0 +1,27 @@ + + + + + + + + + formExampleTiles.index + formExampleTiles.index + + + + formExampleTiles.freemarker + + + + formExampleTiles.freemarker + formExampleTiles.freemarkerResult + + + + + + diff --git a/src/main/webapp/WEB-INF/tiles.xml b/src/main/webapp/WEB-INF/tiles.xml new file mode 100644 index 000000000..a8c1b39c8 --- /dev/null +++ b/src/main/webapp/WEB-INF/tiles.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/tiles/footer.ftl b/src/main/webapp/WEB-INF/tiles/footer.ftl new file mode 100644 index 000000000..adc2fd846 --- /dev/null +++ b/src/main/webapp/WEB-INF/tiles/footer.ftl @@ -0,0 +1,5 @@ +
+<@s.url id="home" action="index" namespace="/view" /> +
+

Powered by Struts2 Portlet/Tiles Plugin | <@s.a href="${home}">Back to front page

+
diff --git a/src/main/webapp/WEB-INF/tiles/footer.jsp b/src/main/webapp/WEB-INF/tiles/footer.jsp new file mode 100644 index 000000000..5dda20467 --- /dev/null +++ b/src/main/webapp/WEB-INF/tiles/footer.jsp @@ -0,0 +1,6 @@ +<%@ taglib prefix="s" uri="/struts-tags" %> +
+ +
+

Powered by Struts2 Portlet/Tiles Plugin | Back to front page

+
diff --git a/src/main/webapp/WEB-INF/tiles/formExample.jsp b/src/main/webapp/WEB-INF/tiles/formExample.jsp new file mode 100644 index 000000000..4d5aee053 --- /dev/null +++ b/src/main/webapp/WEB-INF/tiles/formExample.jsp @@ -0,0 +1,5 @@ +<%@ taglib prefix="s" uri="/struts-tags" %> + +

Hello

+

+ diff --git a/src/main/webapp/WEB-INF/tiles/formExampleInputValidation.jsp b/src/main/webapp/WEB-INF/tiles/formExampleInputValidation.jsp new file mode 100644 index 000000000..83de0b230 --- /dev/null +++ b/src/main/webapp/WEB-INF/tiles/formExampleInputValidation.jsp @@ -0,0 +1,8 @@ +<%@ taglib prefix="s" uri="/struts-tags" %> +"> +

Input your name

+ + + + + diff --git a/src/main/webapp/WEB-INF/tiles/header.jsp b/src/main/webapp/WEB-INF/tiles/header.jsp new file mode 100644 index 000000000..617386a09 --- /dev/null +++ b/src/main/webapp/WEB-INF/tiles/header.jsp @@ -0,0 +1,2 @@ +

Struts2 Portlet Tiles App Example

+
diff --git a/src/main/webapp/WEB-INF/tiles/index.jsp b/src/main/webapp/WEB-INF/tiles/index.jsp new file mode 100644 index 000000000..906abb1c0 --- /dev/null +++ b/src/main/webapp/WEB-INF/tiles/index.jsp @@ -0,0 +1,13 @@ +<%@taglib prefix="s" uri="/struts-tags" %> +
+

This example illustrates the Struts/Portlet/Tiles Plugin.

+ +

Features

+
    +
  • + + View FreeMarker Example +
  • +
+ +
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tiles/layout.jsp b/src/main/webapp/WEB-INF/tiles/layout.jsp new file mode 100644 index 000000000..7cd6b48da --- /dev/null +++ b/src/main/webapp/WEB-INF/tiles/layout.jsp @@ -0,0 +1,13 @@ +<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %> +<%@ taglib prefix="s" uri="/struts-tags" %> + + + +

+

+ +

+ +

Notice that this is a layout made in JSP

+ +