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 2014/03/02 22:17:43 UTC
[05/10] Moves showcase related JSPs under WEB-INF
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselect.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselect.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselect.jsp
new file mode 100644
index 0000000..d4aca42
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselect.jsp
@@ -0,0 +1,101 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - UI Tags - Optiontransferselect</title>
+ <s:head/>
+</head>
+<body>
+<div class="page-header">
+ <h1>UI Tags - Optiontransferselect</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:form action="lotsOfOptiontransferselectSubmit" namespace="/tags/ui" method="post">
+ <s:optiontransferselect
+ tooltip="Select Your Favourite Cartoon Characters"
+ headerKey="-1"
+ headerValue="--- Please Select ---"
+ doubleHeaderKey="-1"
+ doubleHeaderValue="--- Please Select ---"
+ emptyOption="true"
+ doubleEmptyOption="true"
+ label="Favourite Cartoon Characters"
+ leftTitle="Favourite Cartoon Characters"
+ rightTitle="Non Favourite Cartoon Characters"
+ name="favouriteCartoonCharacters"
+ list="defaultFavouriteCartoonCharacters"
+ doubleName="notFavouriteCartoonCharacters"
+ doubleList="defaultNotFavouriteCartoonCharacters" />
+
+ <br/>
+
+ <s:optiontransferselect
+ tooltip="Select Your Favourite Cars"
+ label="Favourite Cars"
+ leftTitle="Favourite Cars"
+ rightTitle="Non Favourite Cars"
+ name="favouriteCars"
+ list="defaultFavouriteCars"
+ doubleName="notFavouriteCars"
+ doubleList="defaultNotFavouriteCars" />
+
+ <br/>
+
+ <s:optiontransferselect
+ tooltip="Select Your Favourite Motorcycles"
+ headerKey="-1"
+ headerValue="--- Please Select ---"
+ doubleHeaderKey="-1"
+ doubleHeaderValue="--- Please Select ---"
+ label="Favourite Motorcycles"
+ leftTitle="Favourite Motorcycles"
+ rightTitle="Non Favourite Motorcycles"
+ name="favouriteMotorcycles"
+ list="defaultFavouriteMotorcycles"
+ doubleName="notFavouriteMotorcycles"
+ doubleList="defaultNotFavouriteMotorcycles" />
+
+ <br/>
+
+ <s:optiontransferselect
+ tooltip="Select Your Favourite Countries"
+ emptyOption="true"
+ doubleEmptyOption="true"
+ label="Favourite Countries"
+ leftTitle="Favourite Countries"
+ rightTitle="Non Favourite Countries"
+ name="favouriteCountries"
+ list="defaultFavouriteCountries"
+ doubleName="notFavouriteCountries"
+ doubleList="defaultNotFavouriteCountries"
+ />
+
+ <br/>
+
+ <s:optiontransferselect
+ tooltip="Pick One at a Time"
+ label="Favourite Sport"
+ leftTitle="Non Favourite Sports"
+ rightTitle="Favourite Sports"
+ name="nonFavouriteSports"
+ list="defaultNonFavoriteSports"
+ doubleName="favouriteSports"
+ doubleList="defaultFavouriteSports"
+ size="1" multiple="false"
+ doubleSize="5" doubleMultiple="true"
+ allowAddAllToLeft="false"
+ allowAddAllToRight="false"
+ allowSelectAll="false"
+ />
+ <br/>
+
+ <s:submit value="Submit It" />
+ </s:form>
+ </div>
+ </div>
+</div>
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselectSubmit.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselectSubmit.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselectSubmit.jsp
new file mode 100644
index 0000000..03d6adc
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/lotsOfOptiontransferselectSubmit.jsp
@@ -0,0 +1,103 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - UI Tags - Optiontransferselect Result</title>
+ <s:head/>
+</head>
+<body>
+<div class="page-header">
+ <h1>UI Tags - Optiontransferselect Result</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <table>
+ <tr>
+ <td>Favourite Cartoons:</td>
+ <td>
+ <s:iterator value="favouriteCartoonCharacters" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Non Favourite Cartoons:</td>
+ <td>
+ <s:iterator value="notFavouriteCartoonCharacters" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Favourite Cars:</td>
+ <td>
+ <s:iterator value="favouriteCars" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Non Favourite Cars:</td>
+ <td>
+ <s:iterator value="notFavouriteCars" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Favourite Motorcycles:</td>
+ <td>
+ <s:iterator value="favouriteMotorcycles" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Non Favourite Motorcycles:</td>
+ <td>
+ <s:iterator value="notFavouriteMotorcycles" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Favourite Countries:</td>
+ <td>
+ <s:iterator value="favouriteCountries" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Non Favourite Countries:</td>
+ <td>
+ <s:iterator value="notFavouriteCountries" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Favourite Sports:</td>
+ <td>
+ <s:iterator value="favouriteSports" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+
+ <tr>
+ <td>Non Favourite Sports:</td>
+ <td>
+ <s:iterator value="nonfavouriteSports" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tags/ui/moreSelects.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/moreSelects.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/moreSelects.jsp
new file mode 100644
index 0000000..39019f0
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/moreSelects.jsp
@@ -0,0 +1,69 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - UI Tags - More Select Box UI Examples</title>
+ <s:head/>
+</head>
+<body>
+<div class="page-header">
+ <h1>UI Tags - More Select Box UI Examples</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:form action="moreSelectsSubmit" namespace="/tags/ui" method="post">
+
+ <s:updownselect
+ tooltip="Prioritized Your Favourite Cartoon Characters"
+ label="Prioritised Favourite Cartoon Characters"
+ list="defaultFavouriteCartoonCharacters"
+ name="prioritisedFavouriteCartoonCharacters"
+ headerKey="-1"
+ headerValue="--- Please Order ---"
+ emptyOption="true" />
+
+ <br/>
+
+ <s:updownselect
+ tooltip="Prioritise Your Favourite Cars"
+ label="Prioritised Favourite Cars"
+ list="defaultFavouriteCars"
+ name="prioritisedFavouriteCars"
+ headerKey="-10"
+ headerValue="--- Please Order ---" />
+
+ <br/>
+
+ <s:updownselect
+ tooltip="Prioritised Your Favourite Countries"
+ label="Prioritised Favourite Countries"
+ list="defaultFavouriteCountries"
+ name="prioritisedFavouriteCountries"
+ emptyOption="true"
+ value="{'england', 'brazil'}" />
+
+ <br/>
+
+ <s:inputtransferselect
+ list="defaultFavouriteNumbers"
+ name="favouriteNumbers"
+ label="Numbers"/>
+
+ <s:select label="Favourite Cities"
+ list="availableCities"
+ name="favouriteCities"
+ value="%{defaultFavouriteCities}"
+ multiple="true" size="4"/>
+
+ <s:submit value="Submit It" cssClass="btn btn-primary"/>
+
+ <br/>
+
+ </s:form>
+ </div>
+ </div>
+</div>
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tags/ui/moreSelectsSubmit.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/moreSelectsSubmit.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/moreSelectsSubmit.jsp
new file mode 100644
index 0000000..82a0a70
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/moreSelectsSubmit.jsp
@@ -0,0 +1,63 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - UI Tags - More Select Box UI Examples - Result</title>
+ <s:head/>
+</head>
+<body>
+<div class="page-header">
+ <h1>UI Tags - More Select Box UI Examples - Result</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+
+ <table>
+ <tr>
+ <td>Prioritised Favourite Cartoon Characters:</td>
+ <td>
+ <s:iterator value="prioritisedFavouriteCartoonCharacters" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Prioritised Favourite Cars:</td>
+ <td>
+ <s:iterator value="prioritisedFavouriteCars" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Prioritised Favourite Countries</td>
+ <td>
+ <s:iterator value="prioritisedFavouriteCountries" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Favourite Cities</td>
+ <td>
+ <s:iterator value="favouriteCities" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ <tr>
+ <td>Favourite Numbers</td>
+ <td>
+ <s:iterator value="favouriteNumbers" status="stat">
+ <s:property value="%{#stat.count}" />.<s:property />
+ </s:iterator>
+ </td>
+ </tr>
+ </table>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tags/ui/staticTreeSelect.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/staticTreeSelect.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/staticTreeSelect.jsp
new file mode 100644
index 0000000..b126aa9
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/staticTreeSelect.jsp
@@ -0,0 +1,11 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
+
+<%
+ request.setAttribute("decorator", "none");
+ response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
+ response.setHeader("Pragma","no-cache"); //HTTP 1.0
+ response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
+%>
+
+${parameters.nodeId[0]}
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tags/ui/timepicker/index.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/timepicker/index.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/timepicker/index.jsp
new file mode 100644
index 0000000..4c98f12
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/timepicker/index.jsp
@@ -0,0 +1,31 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - UI Tags - Timepicker Tag</title>
+ <sx:head extraLocales="en-us,nl-nl,de-de" />
+</head>
+<body>
+<div class="page-header">
+ <h1>UI Tags - Timepicker Tag</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <table>
+ <sx:datetimepicker label="toggleType='wipe'" type="time" value="%{'10:30'}" toggleType="wipe" toggleDuration="300"/>
+ <sx:datetimepicker label="toggleType='explode'" type="time" value="%{'13:00'}" toggleType="explode" toggleDuration="500"/>
+ <sx:datetimepicker label="toggleType='fade'" type="time" value="%{'13:00'}" toggleType="fade" toggleDuration="500"/>
+ <sx:datetimepicker label="With value='today'" name="dddp4" type="time" value="%{'today'}" />
+ <sx:datetimepicker label="US format, empty" name="dddp5" type="time" language="en-us" />
+ <sx:datetimepicker label="US format, 13:00 hours" name="dddp6" type="time" value="%{'13:00'}" language="en-us" />
+ <sx:datetimepicker label="In German" name="dddp7" type="time" value="%{'13:00'}" language="de" />
+ <sx:datetimepicker label="In Dutch" name="dddp8" type="time" value="%{'13:00'}" language="nl" />
+ </table>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleAjaxDynamic.ftl
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleAjaxDynamic.ftl b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleAjaxDynamic.ftl
new file mode 100644
index 0000000..8c78f6c
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleAjaxDynamic.ftl
@@ -0,0 +1,9 @@
+[
+<#list category.children as node>
+ {
+ label: '${node.name}',
+ id: '${node.id}',
+ hasChildren: ${(node.children.size() > 0)?string}
+ },
+</#list>
+]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleAjaxDynamic.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleAjaxDynamic.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleAjaxDynamic.jsp
new file mode 100644
index 0000000..e858fd5
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleAjaxDynamic.jsp
@@ -0,0 +1,25 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - UI Tags - Tree Example AJAX (Dynamic)</title>
+ <sx:head />
+</head>
+<body>
+<div class="page-header">
+ <h1>UI Tags - Tree Example AJAX (Dynamic)</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:url var="nodesUrl" namespace="/nodecorate" action="getNodes" />
+ <div style="float:left; margin-right: 50px;">
+ <sx:tree id="tree" href="%{#nodesUrl}" />
+ </div>
+ </div>
+ </div>
+</div>
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleDynamic.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleDynamic.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleDynamic.jsp
new file mode 100644
index 0000000..07a5adb
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleDynamic.jsp
@@ -0,0 +1,54 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - UI Tags - Tree Example (Dynamic)</title>
+ <sx:head/>
+</head>
+<body>
+<div class="page-header">
+ <h1>UI Tags - Tree Example (Dynamic)</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <!-- START SNIPPET: treeExampleDynamicJsp -->
+
+ <script language="JavaScript" type="text/javascript">
+ dojo.event.topic.subscribe("treeSelected", function treeNodeSelected(node) {
+ dojo.io.bind({
+ url: "<s:url value='/tags/ui/ajax/dynamicTreeSelectAction.action'/>?nodeId="+node.node.widgetId,
+ load: function(type, data, evt) {
+ var divDisplay = dojo.byId("displayId");
+ divDisplay.innerHTML=data;
+ },
+ mimeType: "text/html"
+ });
+ });
+ </script>
+
+
+
+ <div style="float:left; margin-right: 50px;">
+ <sx:tree
+ id="tree"
+ rootNode="%{treeRootNode}"
+ childCollectionProperty="children"
+ nodeIdProperty="id"
+ nodeTitleProperty="name"
+ treeSelectedTopic="treeSelected">
+ </sx:tree>
+ </div>
+
+ <div id="displayId">
+ Please click on any of the tree nodes.
+ </div>
+
+ <!-- END SNIPPET: treeExampleDynamicJsp -->
+ </div>
+ </div>
+</div>
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleStatic.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleStatic.jsp b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleStatic.jsp
new file mode 100644
index 0000000..76ab074
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tags/ui/treeExampleStatic.jsp
@@ -0,0 +1,61 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - UI Tags - Tree Example (Static)</title>
+<sx:head/>
+</head>
+<body>
+<div class="page-header">
+ <h1>UI Tags - Tree Example (Static)</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <!-- START SNIPPET: treeExampleStaticJsp -->
+
+ <script language="JavaScript" type="text/javascript">
+ dojo.event.topic.subscribe("treeSelected", function treeNodeSelected(node) {
+ dojo.io.bind({
+ url: "<s:url value='/tags/ui/ajax/staticTreeSelectAction.action'/>?nodeId="+node.node.title,
+ load: function(type, data, evt) {
+ var divDisplay = dojo.byId("displayIt");
+ divDisplay.innerHTML=data;
+ },
+ mimeType: "text/html"
+ });
+ });
+ </script>
+
+
+ <div style="float:left; margin-right: 50px;">
+ <sx:tree label="parent" templateCssPath="/struts/tree.css"
+ showRootGrid="true" showGrid="true" treeSelectedTopic="treeSelected">
+ <sx:treenode label="child1" >
+ <sx:treenode label="grandchild1" id="grandchild1Id"/>
+ <sx:treenode label="grandchild2" id="grandchild2Id"/>
+ <sx:treenode label="grandchild3" id="grandchild3Id"/>
+ </sx:treenode>
+ <sx:treenode label="child2" id="child2Id"/>
+ <sx:treenode label="child3" id="child3Id"/>
+ <sx:treenode label="child4" id="child4Id"/>
+ <sx:treenode label="child5" id="child5Id">
+ <sx:treenode label="gChild1" id="gChild1Id"/>
+ <sx:treenode label="gChild2" id="gChild2Id"/>
+ </sx:treenode>
+ </sx:tree>
+ </div>
+
+
+ <div id="displayIt">
+ Please click on any node on the tree.
+ </div>
+
+ <!-- END SNIPPET: treeExampleStaticJsp -->
+ </div>
+ </div>
+</div>
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/template/xhtml/mytemplate.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/template/xhtml/mytemplate.jsp b/apps/showcase/src/main/webapp/WEB-INF/template/xhtml/mytemplate.jsp
new file mode 100644
index 0000000..7ebb967
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/template/xhtml/mytemplate.jsp
@@ -0,0 +1,9 @@
+
+<%@taglib prefix="s" uri="/struts-tags" %>
+
+<div style="background-color:yellow;">
+<p>
+JSP Custom Template -
+parameter 'paramName' - <s:property value="%{parameters.paramName}" />
+</p>
+</div>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tiles/body.ftl
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tiles/body.ftl b/apps/showcase/src/main/webapp/WEB-INF/tiles/body.ftl
new file mode 100644
index 0000000..bdaac05
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tiles/body.ftl
@@ -0,0 +1,16 @@
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+ <div>
+ <p>This example illustrates the freemarker support in the Struts/Tiles Plugin.</p>
+
+ <p>Tiles 2 is an effort to extract the Tiles library from Struts. It is currently housed
+ in the Sandbox area of the Apache Struts Subversion repository.</p>
+
+ <@s.form>
+ <@s.textfield name="Textfield" value="Textfield"/>
+ </...@s.form>
+ </div>
+ </div>
+ </div>
+</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tiles/body.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tiles/body.jsp b/apps/showcase/src/main/webapp/WEB-INF/tiles/body.jsp
new file mode 100644
index 0000000..095762f
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tiles/body.jsp
@@ -0,0 +1,24 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+ <div>
+ <p>This example illustrates the Struts/Tiles Plugin.</p>
+
+ <p>Tiles 2 is an effort to extract the Tiles library from Struts. It is currently housed
+ in the Sandbox area of the Apache Struts Subversion repository.</p>
+
+ <h4>Features</h4>
+ <ul>
+ <li>
+ <a href="freemarker.action">View FreeMarker Example</a>
+ </li>
+ <li>
+ <a href="freemarkerLayout.action">View Example with a FreeMarker Layout</a>
+ </li>
+ </ul>
+
+ </div>
+ </div>
+ </div>
+</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tiles/header.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tiles/header.jsp b/apps/showcase/src/main/webapp/WEB-INF/tiles/header.jsp
new file mode 100644
index 0000000..d98f001
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tiles/header.jsp
@@ -0,0 +1,3 @@
+<div class="page-header">
+ <h1>${title}</h1>
+</div>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tiles/layout.ftl
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tiles/layout.ftl b/apps/showcase/src/main/webapp/WEB-INF/tiles/layout.ftl
new file mode 100644
index 0000000..9ce5915
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/tiles/layout.ftl
@@ -0,0 +1,10 @@
+<#assign tiles=JspTaglibs["http://tiles.apache.org/tags-tiles"]>
+<@tiles.importAttribute name="title" scope="request"/>
+<html>
+ <head><title>Struts2 Showcase - <@tiles.getAsString name="title"/></title></head>
+<body>
+ <@tiles.insertAttribute name="header"/>
+ <@tiles.insertAttribute name="body"/>
+ <p>Notice that this is a layout made in FreeMarker</p>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/tiles/layout.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/tiles/layout.jsp b/apps/showcase/src/main/webapp/WEB-INF/tiles/layout.jsp
new file mode 100644
index 0000000..964d014
--- /dev/null
+++ b/apps/showcase/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" %>
+
+<%-- Show usage; Used in Header --%>
+<tiles:importAttribute name="title" scope="request"/>
+<html>
+ <head><title>Struts2 Showcase - <tiles:getAsString name="title"/></title></head>
+<body>
+ <tiles:insertAttribute name="header"/>
+ <tiles:insertAttribute name="body"/>
+ <p>Notice that this is a layout made in JSP</p>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/token/doublePost.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/token/doublePost.jsp b/apps/showcase/src/main/webapp/WEB-INF/token/doublePost.jsp
new file mode 100644
index 0000000..761d44b
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/token/doublePost.jsp
@@ -0,0 +1,28 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Token Examples - Double post</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Token Examples - Double post</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p class="alert alert-warning">
+ Double post. Struts intercepted this request and prevents the action from executing again.
+ </p>
+
+ <p/>
+ Click here to
+ <s:url var="back" value="/token/index.jsp"/><s:a href="%{back}">return</s:a>.
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/token/example1.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/token/example1.jsp b/apps/showcase/src/main/webapp/WEB-INF/token/example1.jsp
new file mode 100644
index 0000000..9495671
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/token/example1.jsp
@@ -0,0 +1,50 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Token Examples - Example 1</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Token Examples - Example 1</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p>
+ <b>Example 1:</b> This example illustrates a situation where you can transfer money from
+ one account to another. We use the token to prevent double posts so the transfer only
+ happens once.
+ <p/>
+
+ <p>
+ <br/>Balance of source account: <s:property value="#session.balanceSource"/>
+ <br/>Balance of destination account: <s:property value="#session.balanceDestination"/>
+ <p/>
+
+ <s:form action="transfer">
+ <s:token/>
+ <s:textfield label="Amount" name="amount" required="true" value="100"/>
+ <s:submit value="Transfer money" cssClass="btn btn-primary"/>
+ </s:form>
+
+ </div>
+ </div>
+</div>
+</body>
+</html>
+
+
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+ <head><title>Token Examples</title></head>
+
+<body>
+ <h1>Token Example 1</h1>
+
+
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/token/example2.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/token/example2.jsp b/apps/showcase/src/main/webapp/WEB-INF/token/example2.jsp
new file mode 100644
index 0000000..7042ce8
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/token/example2.jsp
@@ -0,0 +1,38 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Token Examples - Example 2</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Token Examples - Example 2</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p>
+ <b>Example 2:</b> This example illustrates a situation where you can transfer money from
+ one account to another. We use the token to prevent double posts so the transfer only
+ happens once. This action will redirect after you have submitted the form.
+ <p/>
+
+ <p>
+ Balance of source account: <s:property value="#session.balanceSource"/>
+ <br/>Balance of destination account: <s:property value="#session.balanceDestination"/>
+ <p/>
+
+ <s:form action="transfer2">
+ <s:token/>
+ <s:textfield label="Amount" name="amount" required="true" value="200"/>
+ <s:submit value="Transfer money" cssClass="btn btn-primary"/>
+ </s:form>
+
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/token/example3.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/token/example3.jsp b/apps/showcase/src/main/webapp/WEB-INF/token/example3.jsp
new file mode 100644
index 0000000..4cf2b5a
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/token/example3.jsp
@@ -0,0 +1,37 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Token Examples - Example 3</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Token Examples - Example 3</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p>
+ <b>Example 3:</b> This example illustrates a situation where you can transfer money from
+ one account to another. We use the token to prevent double posts so the transfer only
+ happens once. This example uses the token session based interceptor and redirect after post.
+ <p/>
+
+ <p>Balance of source account: <s:property value="#session.balanceSource"/>
+ <br/>Balance of destination account: <s:property value="#session.balanceDestination"/>
+ <p/>
+
+ <s:form action="transfer3">
+ <s:token/>
+ <s:textfield label="Amount" name="amount" required="true" value="300"/>
+ <s:submit value="Transfer money" cssClass="btn btn-primary"/>
+ </s:form>
+
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl b/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl
new file mode 100644
index 0000000..e66b045
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/token/example4.ftl
@@ -0,0 +1,40 @@
+<html>
+<head>
+ <title>Struts2 Showcase - Token Examples - Example 4</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Token Examples - Example 4</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p>
+ <b>Example 4:</b> This example illustrates a situation where you can transfer money from
+ one account to another. We use the token to prevent double posts so the transfer only
+ happens once. This page is rendered using freemarker. See the xwork-token.xml where
+ we must also use the createSession interceptor to be sure that a HttpSession exists
+ when freemarker renders this webpage, otherwise the @s.token tag causes an exception
+ while rendering the page.
+
+ <p/>
+
+ <p>Balance of source account: <@s.property value="#session.balanceSource"/>
+ <br/>Balance of destination account: <@s.property value="#session.balanceDestination"/>
+
+ <p/>
+
+ <@s.form action="transfer4">
+ <@s.token/>
+ <@s.textfield label="Amount" name="amount" required="true" value="400"/>
+ <@s.submit value="Transfer money" cssClass="btn btn-primary"/>
+ </...@s.form>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/token/index.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/token/index.jsp b/apps/showcase/src/main/webapp/WEB-INF/token/index.jsp
new file mode 100644
index 0000000..b65ff4e
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/token/index.jsp
@@ -0,0 +1,48 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Token Examples (double post)</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Token Examples</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12" style="text-align: center;">
+
+ <p>
+ These examples illustrate Struts build in support of using tokens to prevent double post.
+ <p/>
+ <p>
+ You have a web page where user can input data and press a button to submit.
+ There could be a problem that the user submit the data many times, by either clicking the
+ button many times, or use the browser back button and then submit the form again.
+ <br/> A good solution is to use a hidden token in the form. The token is autogenerated and unique
+ from time to time. This token is then validated with the HttpSession that it is the first time
+ it is submitted, if not we have a double post and therefore can prevent the second submit action.
+ <p/>
+ <p>
+ For more information check out javadoc for org.apache.struts2.interceptor.TokenInterceptor
+ and org.apache.struts2.interceptor.TokenSessionStoreInterceptor.
+ <p/>
+
+ <br/>
+ <br/><a href="tokenPrepare!input.action">Example 1 (token based .jsp example)</a>
+
+ <br/>
+ <br/><a href="tokenPrepare2!input.action">Example 2 (as example 1 with redirect after post)</a>
+
+ <br/>
+ <br/><a href="tokenPrepare3!input.action">Example 3 (token-session based .jsp example)</a>
+
+ <br/>
+ <br/><a href="tokenPrepare4!input.action">Example 4 (token based freemarker example)</a>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/token/transferDone.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/token/transferDone.jsp b/apps/showcase/src/main/webapp/WEB-INF/token/transferDone.jsp
new file mode 100644
index 0000000..a67078c
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/token/transferDone.jsp
@@ -0,0 +1,48 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Token Examples - Transfer is Done</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Token Examples - Transfer is Done</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p>
+ The transfer is done at
+ <s:text name="token.transfer.time">
+ <s:param value="#session.time"/>
+ </s:text>
+
+ <br/>New balance of source account:
+ <s:property value="#session.balanceSource"/>
+ <br/>New balance of destination account:
+ <s:property value="#session.balanceDestination"/>
+
+ <p/>
+
+ <p>
+ Try using the browser back button and submit the form again. This should result in a double post
+ that Struts should intercept and handle accordingly.
+
+ <p/>
+
+ <p>
+ For example 3 (session token) you should notice that the date/time stays the same. This interceptor
+ catches that this is a double post but doens't display the double post page, but just renders the
+ web page result from the first post.
+
+ <p/>
+ Click here to
+ <s:url var="back" value="/token/index.jsp"/><s:a href="%{back}">return</s:a>.
+ </div>
+ </div>
+</div>
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/clientSideValidationExample.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/clientSideValidationExample.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/clientSideValidationExample.jsp
new file mode 100644
index 0000000..f199c31
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/clientSideValidationExample.jsp
@@ -0,0 +1,64 @@
+<%--
+ fieldValidatorExample.jsp
+
+ @author tm_jee
+ @version $Date$ $Id$
+--%>
+
+<%@taglib prefix="s" uri="/struts-tags" %>
+
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Field Validators Example</title>
+ <s:head/>
+</head>
+<body>
+
+<div class="page-header">
+ <h1>Client Side Validation Examples</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <!-- START SNIPPET: fieldValidatorsExample -->
+
+ <h3>All Field Errors Will Appear Here</h3>
+ <s:fielderror/>
+ <hr/>
+
+ <h3>Field Error due to 'Required String Validator Field' Will Appear Here</h3>
+ <s:fielderror>
+ <s:param value="%{'requiredStringValidatorField'}"/>
+ </s:fielderror>
+ <hr/>
+
+ <h3>Field Error due to 'String Length Validator Field' Will Appear Here</h3>
+ <s:fielderror>
+ <s:param>stringLengthValidatorField</s:param>
+ </s:fielderror>
+ <hr/>
+
+ <s:form action="submitClientSideValidationExample" namespace="/validation" method="POST" validate="true">
+ <s:textfield label="Required Validator Field" name="requiredValidatorField"/>
+ <s:textfield label="Required String Validator Field" name="requiredStringValidatorField"/>
+ <s:textfield label="Integer Validator Field" name="integerValidatorField"/>
+ <s:textfield label="Date Validator Field" name="dateValidatorField"/>
+ <s:textfield label="Email Validator Field" name="emailValidatorField"/>
+ <s:textfield label="URL Validator Field" name="urlValidatorField"/>
+ <s:textfield label="String Length Validator Field" name="stringLengthValidatorField"/>
+ <s:textfield label="Regex Validator Field" name="regexValidatorField"/>
+ <s:textfield label="Field Expression Validator Field" name="fieldExpressionValidatorField"/>
+ <s:submit label="Submit" cssClass="btn btn-primary"/>
+ </s:form>
+
+ <!-- END SNIPPET: fieldValidatorsExample -->
+
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/fieldValidatorsExample.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/fieldValidatorsExample.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/fieldValidatorsExample.jsp
new file mode 100644
index 0000000..13a29f0
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/fieldValidatorsExample.jsp
@@ -0,0 +1,63 @@
+<%--
+ fieldValidatorExample.jsp
+
+ @author tm_jee
+ @version $Date$ $Id$
+--%>
+
+<%@taglib prefix="s" uri="/struts-tags" %>
+
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Field Validators Example</title>
+ <s:head theme="xhtml"/>
+</head>
+<body>
+
+<div class="page-header">
+ <h1>Field Validation Examples</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <!-- START SNIPPET: fieldValidatorsExample -->
+
+ <h3>All Field Errors Will Appear Here</h3>
+ <s:fielderror/>
+ <hr/>
+
+ <h3>Field Error due to 'Required String Validator Field' Will Appear Here</h3>
+ <s:fielderror>
+ <s:param value="%{'requiredStringValidatorField'}"/>
+ </s:fielderror>
+ <hr/>
+
+ <h3>Field Error due to 'String Length Validator Field' Will Appear Here</h3>
+ <s:fielderror>
+ <s:param>stringLengthValidatorField</s:param>
+ </s:fielderror>
+ <hr/>
+
+ <s:form action="submitFieldValidatorsExamples" namespace="/validation" method="POST" theme="xhtml">
+ <s:textfield label="Required Validator Field" name="requiredValidatorField"/>
+ <s:textfield label="Required String Validator Field" name="requiredStringValidatorField"/>
+ <s:textfield label="Integer Validator Field" name="integerValidatorField"/>
+ <s:textfield label="Date Validator Field" name="dateValidatorField"/>
+ <s:textfield label="Email Validator Field" name="emailValidatorField"/>
+ <s:textfield label="URL Validator Field" name="urlValidatorField"/>
+ <s:textfield label="String Length Validator Field" name="stringLengthValidatorField"/>
+ <s:textfield label="Regex Validator Field" name="regexValidatorField"/>
+ <s:textfield label="Field Expression Validator Field" name="fieldExpressionValidatorField"/>
+ <s:submit label="Submit" cssClass="btn btn-primary"/>
+ </s:form>
+
+ <!-- END SNIPPET: fieldValidatorsExample -->
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/footer.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/footer.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/footer.jsp
new file mode 100644
index 0000000..20fa2ad
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/footer.jsp
@@ -0,0 +1,8 @@
+ <%@taglib prefix="s" uri="/struts-tags" %>
+
+<hr/>
+
+<s:url var="backToValidationExamples" action="list" namespace="/validation" />
+<s:url var="backToShowCase" action="showcase" namespace="/" />
+
+<s:a href="%{backToValidationExamples}" cssClass="btn btn-info"><i class="icon icon-arrow-left"></i> Back To Validation Examples</s:a>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/index.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/index.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/index.jsp
new file mode 100644
index 0000000..661d032
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/index.jsp
@@ -0,0 +1,51 @@
+<%--
+ index.jsp
+
+ @author tm_jee
+ @version $Date$ $Id$
+--%>
+
+<%@taglib prefix="s" uri="/struts-tags" %>
+
+<html>
+<head>
+ <title>Struts2 Showcase - Validation</title>
+</head>
+<body>
+
+<div class="page-header">
+ <h1>Validation Examples</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:url var="quizBasic" namespace="/validation" action="quizBasic" method="input"/>
+ <s:url var="quizClient" namespace="/validation" action="quizClient" method="input"/>
+ <s:url var="quizClientCss" namespace="/validation" action="quizClientCss" method="input"/>
+ <s:url var="quizAjax" namespace="/validation" action="quizAjax" method="input"/>
+ <s:url var="fieldValidatorUrl" action="showFieldValidatorsExamples" namespace="/validation"/>
+ <s:url var="nonFieldValidatorUrl" action="showNonFieldValidatorsExamples" namespace="/validation"/>
+ <s:url var="visitorValidatorUrl" action="showVisitorValidatorsExamples" namespace="/validation"/>
+ <s:url var="clientSideValidationUrl" action="clientSideValidationExample" namespace="/validation"/>
+ <s:url var="backToShowcase" action="showcase" namespace="/"/>
+ <s:url var="storeMessageAcrossRequestExample" value="/validation/storeErrorsAcrossRequestExample.jsp"/>
+
+ <ul>
+ <li><s:a href="%{fieldValidatorUrl}">Field Validators</s:a></li>
+ <li><s:a href="%{clientSideValidationUrl}">Field Validators with client-side JavaScript</s:a></li>
+ <li><s:a href="%{nonFieldValidatorUrl}">Non Field Validator</s:a></li>
+ <li><s:a href="%{storeMessageAcrossRequestExample}">Store across request using MessageStoreInterceptor (Example)</s:a></li>
+ <li><s:a href="%{quizAjax}">Validation (ajax)</s:a></li>
+ <li><s:a href="%{quizBasic}">Validation (basic)</s:a></li>
+ <li><s:a href="%{quizClient}">Validation (client)</s:a></li>
+ <li><s:a href="%{quizClientCss}">Validation (client using css_xhtml theme)</s:a></li>
+ <li><s:a href="%{visitorValidatorUrl}">Visitor Validator</s:a></li>
+ </ul>
+ </div>
+ </div>
+</div>
+</body>
+</html>
+
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/nonFieldValidatorsExample.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/nonFieldValidatorsExample.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/nonFieldValidatorsExample.jsp
new file mode 100644
index 0000000..27c8f8b
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/nonFieldValidatorsExample.jsp
@@ -0,0 +1,46 @@
+<%--
+ nonFieldValidatorsExample.jsp
+
+ @author tm_jee
+ @version $Date$ $Id$
+--%>
+
+
+<%@taglib prefix="s" uri="/struts-tags" %>
+
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Non Field Validator Example</title>
+ <s:head/>
+</head>
+<body>
+
+<div class="page-header">
+ <h1>Non Field Validator Example</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <!-- START SNIPPET: nonFieldValidatorsExample -->
+ <s:actionerror/>
+
+ <s:form method="POST" action="submitNonFieldValidatorsExamples" namespace="/validation">
+ <s:textfield name="someText" label="Some Text"/>
+ <s:textfield name="someTextRetype" label="Retype Some Text"/>
+ <s:textfield name="someTextRetypeAgain" label="Retype Some Text Again"/>
+ <s:submit label="Submit" cssClass="btn btn-primary"/>
+ </s:form>
+
+
+ <!-- END SNIPPET: nonFieldValidatorsExample -->
+
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
+
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-ajax.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-ajax.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-ajax.jsp
new file mode 100644
index 0000000..9ce9bdb
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-ajax.jsp
@@ -0,0 +1,104 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
+
+<!-- START SNIPPET: ajaxValidation -->
+
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Ajax</title>
+ <sx:head cache="true" compressed="true"/>
+</head>
+
+<s:url var="url" namespace="/validation" action="quizAjax"/>
+
+<body>
+
+<div class="page-header">
+ <h1>AJAX validation Example</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+ <h5>1.Use AJAX validation, and AJAX request (ajaxAfterValidation="true"), if validation succeeds</h5>
+
+ <div id="response" class="well">
+ Response goes here
+ </div>
+
+ <br/>
+
+ <s:form method="post" theme="xhtml" namespace="/nodecorate" action="quizAjax" id="form">
+ <s:textfield label="Name" name="name"/>
+ <s:textfield label="Age" name="age"/>
+ <s:textfield label="Favorite color" name="answer"/>
+ <sx:submit
+ validate="true"
+ ajaxAfterValidation="true"
+ targets="response"
+ showLoadingText="false"
+ cssClass="btn btn-primary"/>
+ </s:form>
+
+ <sx:a
+ formId="form"
+ validate="true"
+ ajaxAfterValidation="true"
+ targets="response"
+ showLoadingText="false"
+ cssClass="btn btn-primary">Submit Form with a link</sx:a>
+ <br/><br/>
+
+ <input type="checkbox" id="checkbox">Submit Form listening to an event on an element (check to submit)
+ <sx:bind
+ id="bind"
+ formId="form"
+ sources="checkbox"
+ validate="true"
+ events="onchange"
+ ajaxAfterValidation="true"
+ targets="response"
+ showLoadingText="false"/>
+
+ <br/><br/><br/><br/>
+
+ <h5>2.Use AJAX validation, and regular request (ajaxAfterValidation="false", default), if validation
+ succeeds</h5>
+ <br/>
+
+ <s:form method="post" theme="xhtml" namespace="/nodecorate" action="quizAjax" id="form2">
+ <s:textfield label="Name" name="name"/>
+ <s:textfield label="Age" name="age"/>
+ <s:textfield label="Favorite color" name="answer"/>
+ <sx:submit
+ validate="true"
+ ajaxAfterValidation="false"
+ showLoadingText="false"
+ cssClass="btn btn-primary"/>
+ </s:form>
+
+ <sx:a
+ formId="form2"
+ validate="true"
+ ajaxAfterValidation="false"
+ showLoadingText="false"
+ cssClass="btn btn-primary">Submit Form with a link</sx:a>
+ <br/><br/>
+
+ <input type="checkbox" id="checkbox2">Submit Form listening to an event on an element (check to submit)
+ <sx:bind
+ formId="form2"
+ sources="checkbox2"
+ validate="true"
+ events="onchange"
+ ajaxAfterValidation="false"
+ showLoadingText="false"/>
+
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
+<!-- END SNIPPET: ajaxValidation -->
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-basic.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-basic.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-basic.jsp
new file mode 100644
index 0000000..e7cb1f9
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-basic.jsp
@@ -0,0 +1,41 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<!-- START SNIPPET: basicValidation -->
+
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Basic</title>
+ <s:head/>
+</head>
+
+<body>
+
+<div class="page-header">
+ <h1>Basic validation Example</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p>
+ <b>What is your favorite color?</b>
+
+ <p/>
+
+ <s:form method="post">
+ <s:textfield label="Name" name="name"/>
+ <s:textfield label="Age" name="age"/>
+ <s:textfield label="Favorite color" name="answer"/>
+ <s:submit cssClass="btn btn-primary"/>
+ </s:form>
+
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
+<!-- END SNIPPET: basicValidation -->
+
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-client-css.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-client-css.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-client-css.jsp
new file mode 100644
index 0000000..c675893
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-client-css.jsp
@@ -0,0 +1,37 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<!-- START SNIPPET: clientCssValidation -->
+
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Basic (CSS Theme)</title>
+ <s:head theme="css_xhtml"/>
+</head>
+
+<body>
+
+<div class="page-header">
+ <h1>Basic validation Example (CSS Theme)</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:form method="post" theme="css_xhtml" validate="true">
+ <s:textfield label="Name" name="name"/>
+ <s:textfield label="Age" name="age"/>
+ <s:textfield label="Favorite color" name="answer"/>
+ <s:submit cssClass="btn btn-primary"/>
+ </s:form>
+
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
+
+<!-- END SNIPPET: clientCssValidation -->
+
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-client.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-client.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-client.jsp
new file mode 100644
index 0000000..27268b8
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-client.jsp
@@ -0,0 +1,37 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<!-- START SNIPPET: clientValidation -->
+
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Basic</title>
+ <s:head/>
+</head>
+
+<body>
+
+<div class="page-header">
+ <h1>Basic validation Example</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+
+ <s:form method="post" validate="true">
+ <s:textfield label="Name" name="name"/>
+ <s:textfield label="Age" name="age"/>
+ <s:textfield label="Favorite color" name="answer"/>
+ <s:submit cssClass="btn btn-primary"/>
+ </s:form>
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
+
+<!-- END SNIPPET: clientValidation -->
+
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-success.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-success.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-success.jsp
new file mode 100644
index 0000000..58180bb
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/quiz-success.jsp
@@ -0,0 +1,27 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Quiz submitted!</title>
+ <s:head/>
+</head>
+
+<body>
+
+<div class="page-header">
+ <h1>Quiz submitted!</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ Thank you, <b><s:property value="name"/></b>. Your answer has been submitted as:
+
+ <b><s:property value="answer"/></b>
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestCancel.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestCancel.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestCancel.jsp
new file mode 100644
index 0000000..fd9fb55
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestCancel.jsp
@@ -0,0 +1,30 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Store Errors Across Request Example</title>
+ <s:head/>
+</head>
+
+<body>
+
+<div class="page-header">
+ <h1>Application Canceled</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:actionmessage cssClass="alert alert-info"/>
+ <s:actionerror cssClass="alert alert-error"/>
+ <s:fielderror cssClass="alert alert-error"/>
+
+ <s:url var="url" value="/validation/storeErrorsAcrossRequestExample.jsp" />
+ <s:a href="%{#url}">Try Again</s:a>
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestExample.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestExample.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestExample.jsp
new file mode 100644
index 0000000..939e0ac
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestExample.jsp
@@ -0,0 +1,54 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Store Errors Across Request Example</title>
+ <s:head/>
+</head>
+
+<body>
+
+<div class="page-header">
+ <h1>Store Errors Across Request Example</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p>
+ This is an example demonstrating the use of MessageStoreInterceptor.
+ When this form is submited a redirect is issue both when there's a validation
+ error or not. Normally, when a redirect is issue the action messages / errors and
+ field errors stored in the action will be lost (due to an action lives
+ only as long as a request). With a MessageStoreInterceptor in place and
+ configured, the action errors / messages / field errors will be store and
+ remains retrieveable even after a redirect.
+ </p>
+
+ <table border="1">
+ <tr><td>ActionMessages: </td><td></td><s:actionmessage/></tr>
+ <tr><td>ActionErrors: </td><td><s:actionerror/></td></tr>
+ </table>
+
+ <p>
+ <s:form action="submitApplication" namespace="/validation">
+ <s:textfield name="name" label="Name" />
+ <s:textfield name="age" label="Age" />
+ <s:submit cssClass="btn btn-primary"/>
+ <s:submit action="cancelApplication" value="%{'Cancel'}" cssClass="btn btn-danger"/>
+ </s:form>
+ </p>
+ <p>
+ Try submitting with an invalid age value,
+ and note that the browser location changes,
+ but validation messages are retained.
+ Because of the redirect,
+ the input values are not retained.
+ </p>
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestOk.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestOk.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestOk.jsp
new file mode 100644
index 0000000..6c5ddb1
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/storeErrorsAcrossRequestOk.jsp
@@ -0,0 +1,31 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Store Errors Across Request Example</title>
+ <s:head/>
+</head>
+
+<body>
+
+<div class="page-header">
+ <h1>Ok !</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <s:actionmessage cssClass="alert alert-info"/>
+ <s:actionerror cssClass="alert alert-error"/>
+ <s:fielderror cssClass="alert alert-error"/>
+
+ <s:url var="url" value="/validation/storeErrorsAcrossRequestExample.jsp" />
+ <s:a href="%{#id}">Try Again</s:a>
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
+
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/successClientSideValidationExample.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/successClientSideValidationExample.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/successClientSideValidationExample.jsp
new file mode 100644
index 0000000..cb56e9c
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/successClientSideValidationExample.jsp
@@ -0,0 +1,64 @@
+<%--
+ successFieldValidatorsExample.jsp
+
+ @author tm_jee
+ @version $Date$ $Id$
+--%>
+
+<%@taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Success Client Side Validators Example</title>
+ <s:head/>
+</head>
+<body>
+
+<div class="page-header">
+ <h1>Success !</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <table class="table table-striped table-bordered table-hover table-condensed">
+ <tr>
+ <td>Required Validator Field:</td>
+ <td><s:property value="requiredValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>Required String Validator Field:</td>
+ <td><s:property value="requiredStringValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>Integer Validator Field: </td>
+ <td><s:property value="integerValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>Date Validator Field: </td>
+ <td><s:property value="dateValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>Email Validator Field: </td>
+ <td><s:property value="emailValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>URL Validator Field: </td>
+ <td><s:property value="urlValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>String Length Validator Field: </td>
+ <td><s:property value="stringLengthValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>Regex Validator Field: <s:property value="regexValidatorField" /></td>
+ <td>Field Expression Validator Field: <s:property value="fieldExpressionValidatorField" /></td>
+ </tr>
+ </table>
+
+ <s:include value="footer.jsp" />
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/successFieldValidatorsExample.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/successFieldValidatorsExample.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/successFieldValidatorsExample.jsp
new file mode 100644
index 0000000..f795bcc
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/successFieldValidatorsExample.jsp
@@ -0,0 +1,61 @@
+<%--
+ successFieldValidatorsExample.jsp
+
+ @author tm_jee
+ @version $Date$ $Id$
+--%>
+
+
+<%@taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Success Field Validators Example</title>
+ <s:head/>
+</head>
+<body>
+
+<div class="page-header">
+ <h1>Success !</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <table class="table table-striped table-bordered table-hover table-condensed">
+ <tr>
+ <td>Required Validator Field:</td>
+ <td><s:property value="requiredValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>Required String Validator Field:</td>
+ <td><s:property value="requiredStringValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>Integer Validator Field: </td>
+ <td><s:property value="integerValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>Date Validator Field: </td>
+ <td><s:property value="dateValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>Email Validator Field: </td>
+ <td><s:property value="emailValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>String Length Validator Field: </td>
+ <td><s:property value="stringLengthValidatorField" /></td>
+ </tr>
+ <tr>
+ <td>Regex Validator Field: <s:property value="regexValidatorField" /></td>
+ <td>Field Expression Validator Field: <s:property value="fieldExpressionValidatorField" /></td>
+ </tr>
+ </table>
+
+ <s:include value="footer.jsp" />
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/successNonFieldValidatorsExample.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/successNonFieldValidatorsExample.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/successNonFieldValidatorsExample.jsp
new file mode 100644
index 0000000..4033300
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/successNonFieldValidatorsExample.jsp
@@ -0,0 +1,45 @@
+<%--
+ successNonFieldValidatorsExample.jsp
+
+ @author tm_jee
+ @version $Date$ $Id$
+--%>
+
+
+<%@taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Success Non Field Validators Example</title>
+ <s:head/>
+</head>
+<body>
+
+<div class="page-header">
+ <h1>Success !</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <table class="table table-striped table-bordered table-hover table-condensed">
+ <tr>
+ <td>Some Text: </td>
+ <td><s:property value="someText" /></td>
+ </tr>
+ <tr>
+ <td>Some Text Retyped: </td>
+ <td><s:property value="someTextRetype" /></td>
+ </tr>
+ <tr>
+ <td>Some Text Retyped Again: </td>
+ <td><s:property value="someTextRetypeAgain" /></td>
+ </tr>
+ </table>
+
+ <s:include value="footer.jsp" />
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/successVisitorValidatorsExample.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/successVisitorValidatorsExample.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/successVisitorValidatorsExample.jsp
new file mode 100644
index 0000000..6eecc62
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/successVisitorValidatorsExample.jsp
@@ -0,0 +1,46 @@
+<%--
+ successVisitorValidatorsExample.jsp
+
+ @author tm_jee
+ @version $Date$ $Id$
+--%>
+
+
+<%@taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Success Visitor Validators Exameple</title>
+ <s:head/>
+</head>
+<body>
+
+<div class="page-header">
+ <h1>Success !</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <table class="table table-striped table-bordered table-hover table-condensed">
+ <tr>
+ <td>User Name:</td>
+ <td><s:property value="user.name" /></td>
+ </tr>
+ <tr>
+ <td>User Age:</td>
+ <td><s:property value="user.age" /></td>
+ </tr>
+ <tr>
+ <td>User Birthday:</td>
+ <td><s:property value="user.birthday" /></td>
+ </tr>
+ </table>
+
+ <s:include value="footer.jsp" />
+
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/validation/visitorValidatorsExample.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/validation/visitorValidatorsExample.jsp b/apps/showcase/src/main/webapp/WEB-INF/validation/visitorValidatorsExample.jsp
new file mode 100644
index 0000000..06ee70e
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/validation/visitorValidatorsExample.jsp
@@ -0,0 +1,43 @@
+<%--
+ visitorValidatorsExample.jsp
+
+ @author tm_jee
+ @version $Date$ $Id$
+--%>
+
+
+<%@taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Validation - Visitor Validators Example</title>
+ <s:head/>
+</head>
+<body>
+
+<div class="page-header">
+ <h1>Visitor Validators Example</h1>
+</div>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <!-- START SNIPPET: visitorValidatorsExample -->
+
+ <s:fielderror cssClass="alert alert-error"/>
+
+ <s:form method="POST" action="submitVisitorValidatorsExamples" namespace="/validation">
+ <s:textfield name="user.name" label="User Name"/>
+ <s:textfield name="user.age" label="User Age"/>
+ <s:textfield name="user.birthday" label="Birthday"/>
+ <s:submit label="Submit" cssClass="btn btn-primary"/>
+ </s:form>
+
+ <!-- END SNIPPET: visitorValidatorsExample -->
+
+ <s:include value="footer.jsp"/>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/viewSource.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/viewSource.jsp b/apps/showcase/src/main/webapp/WEB-INF/viewSource.jsp
new file mode 100644
index 0000000..84448de
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/viewSource.jsp
@@ -0,0 +1,54 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>View Sources</title>
+</head>
+<body>
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+ <h1>View Sources</h1>
+
+ <ul class="nav nav-tabs" id="codeTab">
+ <li class="active"><a href="#page">Page</a></li>
+ <li><a href="#config">Configuration</a></li>
+ <li><a href="#java">Java Action</a></li>
+ </ul>
+
+ <div class="tab-content">
+ <div class="tab-pane active" id="page">
+ <h3><s:property default="Unknown page" value="page"/></h3>
+ <pre class="prettyprint lang-html linenums">
+ <s:iterator value="pageLines" status="row">
+<s:property/></s:iterator>
+ </pre>
+ </div>
+ <div class="tab-pane" id="config">
+ <h3><s:property default="Unknown configuration" value="config"/></h3>
+ <pre class="prettyprint lang-xml linenums">
+ <s:iterator value="configLines" status="row">
+<s:property/></s:iterator>
+ </pre>
+ </div>
+ <div class="tab-pane" id="java">
+ <h3><s:property default="Unknown or unavailable Action class" value="className"/></h3>
+ <pre class="prettyprint lang-java linenums">
+ <s:iterator value="classLines" status="row">
+<s:property/></s:iterator>
+ </pre>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+
+
+<script>
+ $('#codeTab a').click(function (e) {
+ e.preventDefault();
+ $(this).tab('show');
+ })
+</script>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/wait/complete.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/wait/complete.jsp b/apps/showcase/src/main/webapp/WEB-INF/wait/complete.jsp
new file mode 100644
index 0000000..9ab7b78
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/wait/complete.jsp
@@ -0,0 +1,25 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Execute and Wait Examples - Complete</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>The process is complete</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12" style="text-align: center;">
+
+ <b>We have processed your request.</b>
+ <p/>
+ Click here to <s:url var="back" value="/wait/index.jsp"/><s:a href="%{back}" cssClass="btn btn-link">return</s:a>.
+
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/wait/example1.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/wait/example1.jsp b/apps/showcase/src/main/webapp/WEB-INF/wait/example1.jsp
new file mode 100644
index 0000000..de83f93
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/wait/example1.jsp
@@ -0,0 +1,28 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Execute and Wait Examples - Example 1</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Execute and Wait Examples - Example 1</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12" style="text-align: center;">
+
+ <p><b>Example 1:</b> In the form below enter how long time to simulate the process should take.</p>
+
+ <s:form action="longProcess1">
+ <s:textfield label="Time (millis)" name="time" required="true" value="7000"/>
+ <s:submit value="submit" cssClass="btn btn-primary"/>
+ </s:form>
+
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/wait/example2.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/wait/example2.jsp b/apps/showcase/src/main/webapp/WEB-INF/wait/example2.jsp
new file mode 100644
index 0000000..df68dfc
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/wait/example2.jsp
@@ -0,0 +1,29 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Execute and Wait Examples - Example 2</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Execute and Wait Examples - Example 2</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p><b>Example 2:</b> As example 1 but uses a delay of 2000 millis before the wait page is shown. Try simulating with
+ a value of 500 millis to see that no wait page is shown at all.</p>
+
+ <s:form action="longProcess2">
+ <s:textfield label="Time (millis)" name="time" required="true" value="8000"/>
+ <s:submit value="submit" cssClass="btn btn-primary"/>
+ </s:form>
+
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/wait/example3.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/wait/example3.jsp b/apps/showcase/src/main/webapp/WEB-INF/wait/example3.jsp
new file mode 100644
index 0000000..b77baae
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/wait/example3.jsp
@@ -0,0 +1,29 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Execute and Wait Examples - Example 3</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Execute and Wait Examples - Example 3</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12">
+
+ <p><b>Example 3:</b> As example 1 but uses a delay of 3000 millis before the wait page is shown.
+ While waiting for the wait page it will check every 1000 millis if the background process is already
+ done. Try simulating with a value of 700 millis to see that the wait page is shown soon thereafter.</p>
+
+ <s:form action="longProcess3">
+ <s:textfield label="Time (millis)" name="time" required="true" value="9000"/>
+ <s:submit value="submit" cssClass="btn btn-primary"/>
+ </s:form>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/wait/index.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/wait/index.jsp b/apps/showcase/src/main/webapp/WEB-INF/wait/index.jsp
new file mode 100644
index 0000000..14f4e19
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/wait/index.jsp
@@ -0,0 +1,34 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Execute and Wait Examples</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Execute and Wait Examples</h1>
+</div>
+
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12" style="text-align: center;">
+
+ <p>
+ These examples illustrate Struts build in support for execute and wait.
+ <p/>
+ <p>
+ When you have a process that takes a long time your users can be impatient and starts to submit/click again.
+ <br/> A good solution is to show the user a progress page (wait page) while the process takes it time.
+ <p/>
+
+ <br/>
+ <br/><a href="example1.jsp">Example 1 (no delay)</a>
+ <br/><a href="example2.jsp">Example 2 (with delay)</a>
+ <br/><a href="example3.jsp">Example 3 (with longer check delay)</a>
+ </div>
+ </div>
+</div>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/wait/wait.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/wait/wait.jsp b/apps/showcase/src/main/webapp/WEB-INF/wait/wait.jsp
new file mode 100644
index 0000000..deb8151
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/wait/wait.jsp
@@ -0,0 +1,53 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>Struts2 Showcase - Execute and Wait Examples - Wait</title>
+</head>
+
+<body>
+<div class="page-header">
+ <h1>Execute and Wait Examples - Wait</h1>
+</div>
+
+
+<div class="container-fluid">
+ <div class="row-fluid">
+ <div class="span12" style="text-align: center;">
+
+ <p class="well">
+ We are processing your request. Please wait.
+ </p>
+
+ <div class="progress progress-striped active">
+ <div class="bar" style="width: 50%;"></div>
+ </div>
+
+ <p/>
+ You can click this link to <a href="<s:url includeParams="all"/>">refresh</a>.
+
+ <b>We have processed your request.</b>
+ <p/>
+ Click here to <s:url var="back" value="/wait/index.jsp"/><s:a href="%{back}" cssClass="btn btn-link">return</s:a>.
+
+ </div>
+ </div>
+</div>
+</body>
+</html>
+
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <meta http-equiv="refresh" content="5;url=<s:url includeParams="all"/>"/>
+</head>
+
+<body>
+ <p style="border: 1px solid silver; padding: 5px; background: #ffd; text-align: center;">
+ We are processing your request. Please wait.
+ </p>
+
+ <p/>
+ You can click this link to <a href="<s:url includeParams="all"/>">refresh</a>.
+
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/WEB-INF/xslt/index.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/WEB-INF/xslt/index.jsp b/apps/showcase/src/main/webapp/WEB-INF/xslt/index.jsp
new file mode 100644
index 0000000..2a2f0a2
--- /dev/null
+++ b/apps/showcase/src/main/webapp/WEB-INF/xslt/index.jsp
@@ -0,0 +1,26 @@
+<%@taglib prefix="s" uri="/struts-tags" %>
+
+<html>
+<head>
+<title>Showcase - XSLT </title>
+</head>
+<body>
+<h1> XSLT Result Showcase</h1>
+
+<p>
+ The XSLT result can be used to generate xml from the action. By default, each of the action's
+ properties will be converted into a DOM and rendered. These results can be transformed via
+ xslt. Additionally, the result's exposedValue parameter can be used to define an ognl expression
+ which can be used to manipulate the object which will be converted to xml.
+
+ <ul>
+ <li><s:url var="url" namespace="/xslt" action="jvmInfo"/><s:a href="%{url}">Render the exposed portion of the action as html</s:a></li>
+ <li><s:url var="url" namespace="/xslt" action="jvmInfoRaw"/><s:a href="%{url}">Render the exposed portion of the action as xml</s:a></li>
+ <li><s:url var="url" namespace="/xslt" action="jvmInfoAll"/><s:a href="%{url}">Render the action as xml</s:a></li>
+ <li><s:url var="url" namespace="/xslt" action="classpath"/><s:a href="%{url}">Render an ognl property</s:a></li>
+ </ul>
+</p>
+
+
+</body>
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/actionchaining/actionChainingResult.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/actionchaining/actionChainingResult.jsp b/apps/showcase/src/main/webapp/actionchaining/actionChainingResult.jsp
deleted file mode 100644
index 87566e8..0000000
--- a/apps/showcase/src/main/webapp/actionchaining/actionChainingResult.jsp
+++ /dev/null
@@ -1,23 +0,0 @@
-<%@taglib prefix="s" uri="/struts-tags" %>
-
-<html>
-<head>
- <title>Struts2 Showcase - Action Chaining Result</title>
-</head>
-<body>
- <div class="page-header">
- <h1>Action Chaining Result:</h1>
- </div>
-
- <div class="container-fluid">
- <div class="row-fluid">
- <div class="span12">
- <s:label label="Action Chain 1 Property 1" name="actionChain1Property1" /><br/>
- <s:label label="Action Chain 2 Property 1" name="actionChain2Property1" /><br/>
- <s:label label="Action Chain 3 Property 1" name="actionChain3Property1" /><br/>
- </div>
- </div>
- </div>
-</body>
-</html>
-
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/ajax/AjaxResult.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/ajax/AjaxResult.jsp b/apps/showcase/src/main/webapp/ajax/AjaxResult.jsp
deleted file mode 100644
index 3dc8521..0000000
--- a/apps/showcase/src/main/webapp/ajax/AjaxResult.jsp
+++ /dev/null
@@ -1,12 +0,0 @@
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<%
- request.setAttribute("decorator", "none");
- response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
- response.setHeader("Pragma","no-cache"); //HTTP 1.0
- response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
-%>
-
-Result: <s:property value="count"/> @ <s:property value="serverTime"/>
-<br/>
-<s:property value="data"/>
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/ajax/AjaxResult2.js
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/ajax/AjaxResult2.js b/apps/showcase/src/main/webapp/ajax/AjaxResult2.js
deleted file mode 100644
index 537c390..0000000
--- a/apps/showcase/src/main/webapp/ajax/AjaxResult2.js
+++ /dev/null
@@ -1,2 +0,0 @@
-alert('This JavaScript currently being evaluated is the result...');
-alert('... of an action executed on the server!');
http://git-wip-us.apache.org/repos/asf/struts/blob/65eb9751/apps/showcase/src/main/webapp/ajax/AjaxResult3.jsp
----------------------------------------------------------------------
diff --git a/apps/showcase/src/main/webapp/ajax/AjaxResult3.jsp b/apps/showcase/src/main/webapp/ajax/AjaxResult3.jsp
deleted file mode 100644
index 45cb2b0..0000000
--- a/apps/showcase/src/main/webapp/ajax/AjaxResult3.jsp
+++ /dev/null
@@ -1,12 +0,0 @@
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<%
- request.setAttribute("decorator", "none");
- response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
- response.setHeader("Pragma","no-cache"); //HTTP 1.0
- response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
-%>
-
-Result: <s:property value="count"/> @ <s:property value="serverTime"/>
-
-The value you entered was: <s:property value="data"/><br/>