struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lukaszlen...@apache.org
Subject svn commit: r1394440 - in /struts/struts2/trunk/src/main: resources/ resources/org/ resources/org/apache/ resources/org/apache/struts2/ resources/org/apache/struts2/portlet/ resources/org/apache/struts2/portlet/example/ webapp/ webapp/WEB-INF/ webapp/W...
Date Fri, 05 Oct 2012 10:54:37 GMT
Author: lukaszlenart
Date: Fri Oct  5 10:54:36 2012
New Revision: 1394440

URL: http://svn.apache.org/viewvc?rev=1394440&view=rev
Log:
WW-3872 adds Tiles support to portlet example app

Added:
    struts/struts2/trunk/src/main/resources/
    struts/struts2/trunk/src/main/resources/org/
    struts/struts2/trunk/src/main/resources/org/apache/
    struts/struts2/trunk/src/main/resources/org/apache/struts2/
    struts/struts2/trunk/src/main/resources/org/apache/struts2/portlet/
    struts/struts2/trunk/src/main/resources/org/apache/struts2/portlet/example/
    struts/struts2/trunk/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml
    struts/struts2/trunk/src/main/resources/struts-tiles.xml
    struts/struts2/trunk/src/main/webapp/
    struts/struts2/trunk/src/main/webapp/WEB-INF/
    struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/
    struts/struts2/trunk/src/main/webapp/WEB-INF/tiles.xml
    struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/footer.ftl
    struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/footer.jsp
    struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/formExample.jsp
    struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/formExampleInputValidation.jsp
    struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/header.jsp
    struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/index.jsp
    struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/layout.jsp

Added: struts/struts2/trunk/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml?rev=1394440&view=auto
==============================================================================
--- struts/struts2/trunk/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml
(added)
+++ struts/struts2/trunk/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml
Fri Oct  5 10:54:36 2012
@@ -0,0 +1,13 @@
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
+<validators>
+    <field name="firstName">
+        <field-validator type="requiredstring">
+            <message>You must enter a first name</message>
+        </field-validator>
+    </field>
+    <field name="lastName">
+        <field-validator type="requiredstring">
+            <message>You must enter a last name</message>
+        </field-validator>
+    </field>
+</validators>

Added: struts/struts2/trunk/src/main/resources/struts-tiles.xml
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/src/main/resources/struts-tiles.xml?rev=1394440&view=auto
==============================================================================
--- struts/struts2/trunk/src/main/resources/struts-tiles.xml (added)
+++ struts/struts2/trunk/src/main/resources/struts-tiles.xml Fri Oct  5 10:54:36 2012
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE struts PUBLIC
+	"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
+	"http://struts.apache.org/dtds/struts-2.3.dtd">
+
+<struts>
+    <package name="tiles" extends="struts-portlet-tiles-default" namespace="/tiles">
+        <default-action-ref name="index"/>
+
+        <action name="index" class="org.apache.struts2.portlet.example.FormExample">
+            <result type="tiles">formExampleTiles.index</result>
+            <result name="success" type="tiles">formExampleTiles.index</result>
+        </action>
+
+        <action name="processTilesFreemarkerExample" class="org.apache.struts2.portlet.example.FormExample"
method="input">
+            <result name="success" type="tiles">formExampleTiles.freemarker</result>
+        </action>
+        
+        <action name="processTilesFreemarkerExample" class="org.apache.struts2.portlet.example.FormExample"
method="execute">
+            <result name="input" type="tiles">formExampleTiles.freemarker</result>
+            <result name="success" type="tiles">formExampleTiles.freemarkerResult</result>
+        </action>
+        
+    </package>
+</struts>
+
+

Added: struts/struts2/trunk/src/main/webapp/WEB-INF/tiles.xml
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/src/main/webapp/WEB-INF/tiles.xml?rev=1394440&view=auto
==============================================================================
--- struts/struts2/trunk/src/main/webapp/WEB-INF/tiles.xml (added)
+++ struts/struts2/trunk/src/main/webapp/WEB-INF/tiles.xml Fri Oct  5 10:54:36 2012
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!--
+/*
+ * 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.
+ *
+ */
+-->
+
+<!DOCTYPE tiles-definitions PUBLIC
+        "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
+        "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
+
+<tiles-definitions>
+
+    <definition name="formExampleTiles.index" template="/WEB-INF/tiles/layout.jsp">
+        <put-attribute name="title" value="Portlet Tiles FormExample"/>
+        <put-attribute name="header" value="/WEB-INF/tiles/header.jsp"/>
+        <put-attribute name="body" value="/WEB-INF/tiles/index.jsp"/>
+        <put-attribute name="footer" value="/WEB-INF/tiles/footer.jsp"/>
+    </definition>
+    
+    <definition name="formExampleTiles.freemarker" extends="formExampleTiles.index">
+        <put-attribute name="title" value="Portlet Tiles/Freemarker FormExample"/>
+        <put-attribute name="body" value="/WEB-INF/tiles/formExampleInputValidation.jsp"/>
+    </definition>
+    
+     <definition name="formExampleTiles.freemarkerResult" extends="formExampleTiles.freemarker">
+        <put-attribute name="body" value="/WEB-INF/tiles/formExample.jsp"/>
+    </definition>
+
+</tiles-definitions>

Added: struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/footer.ftl
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/footer.ftl?rev=1394440&view=auto
==============================================================================
--- struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/footer.ftl (added)
+++ struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/footer.ftl Fri Oct  5 10:54:36 2012
@@ -0,0 +1,5 @@
+<hr/>
+<@s.url id="home" action="index" namespace="/view" />
+<div>
+	<p>Powered by Struts2 Portlet/Tiles Plugin | <@s.a href="${home}">Back to front
page</@s.a></p>
+</div>

Added: struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/footer.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/footer.jsp?rev=1394440&view=auto
==============================================================================
--- struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/footer.jsp (added)
+++ struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/footer.jsp Fri Oct  5 10:54:36 2012
@@ -0,0 +1,6 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<hr/>
+<s:url id="home" action="index" namespace="/view" />
+<div>
+	<p>Powered by Struts2 Portlet/Tiles Plugin | <s:a href="%{home}">Back to front
page</s:a></p>
+</div>

Added: struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/formExample.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/formExample.jsp?rev=1394440&view=auto
==============================================================================
--- struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/formExample.jsp (added)
+++ struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/formExample.jsp Fri Oct  5 10:54:36
2012
@@ -0,0 +1,5 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<H2>Hello <s:property value="firstName"/> <s:property value="lastName"/></H2>
+<p/>
+

Added: struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/formExampleInputValidation.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/formExampleInputValidation.jsp?rev=1394440&view=auto
==============================================================================
--- struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/formExampleInputValidation.jsp (added)
+++ struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/formExampleInputValidation.jsp Fri
Oct  5 10:54:36 2012
@@ -0,0 +1,8 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<link rel="stylesheet" type="text/css" href="<s:url value="/styles/styles.css"/>">
+<H2>Input your name</H2>
+<s:form action="processTilesFreemarkerExample" namespace="/tiles" method="POST" >
+    <s:textfield label="First name" name="firstName" value="%{firstName}"/>
+    <s:textfield label="Last name" name="lastName" value="%{lastName}"/>
+    <s:submit value="Submit the form"/>
+</s:form>

Added: struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/header.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/header.jsp?rev=1394440&view=auto
==============================================================================
--- struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/header.jsp (added)
+++ struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/header.jsp Fri Oct  5 10:54:36 2012
@@ -0,0 +1,2 @@
+<h1>Struts2 Portlet Tiles App Example</h1>
+<hr/>

Added: struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/index.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/index.jsp?rev=1394440&view=auto
==============================================================================
--- struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/index.jsp (added)
+++ struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/index.jsp Fri Oct  5 10:54:36 2012
@@ -0,0 +1,13 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+<div>
+    <p>This example illustrates the Struts/Portlet/Tiles Plugin.</p>
+
+    <h4>Features</h4>
+    <ul>
+        <li>
+            <s:url id="freemarker" namespace="/tiles" action="processTilesFreemarkerExample"
method="input" />
+    		<s:a href="%{freemarker}">View FreeMarker Example</s:a>
+        </li>
+    </ul>
+
+</div>
\ No newline at end of file

Added: struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/layout.jsp
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/layout.jsp?rev=1394440&view=auto
==============================================================================
--- struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/layout.jsp (added)
+++ struts/struts2/trunk/src/main/webapp/WEB-INF/tiles/layout.jsp Fri Oct  5 10:54:36 2012
@@ -0,0 +1,13 @@
+<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<tiles:importAttribute name="title" scope="request"/>
+
+<tiles:insertAttribute name="header"/>
+<h2><tiles:insertAttribute name="title"/></h2>
+<p id="body">
+    <tiles:insertAttribute name="body"/>
+</p>
+
+<p>Notice that this is a layout made in JSP</p>
+
+<tiles:insertAttribute name="footer"/>



Mime
View raw message