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 2016/07/14 09:50:00 UTC
[4/6] struts-examples git commit: WW-4660 Moves example portlet app
into struts-examples
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/struts-eventing.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/struts-eventing.xml b/portlet/src/main/resources/struts-eventing.xml
new file mode 100644
index 0000000..c571cb9
--- /dev/null
+++ b/portlet/src/main/resources/struts-eventing.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE struts PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
+ "http://struts.apache.org/dtds/struts-2.5.dtd">
+
+<struts>
+ <package name="eventing" extends="struts-portlet-default" namespace="/eventing">
+
+ <action name="publish" class="org.apache.struts2.portlet.example.eventing.PublishAction">
+ <result name="success">/WEB-INF/eventing/index.jsp</result>
+ </action>
+
+ <action name="process" class="org.apache.struts2.portlet.example.eventing.ProcessAction">
+ <result name="success">/WEB-INF/eventing/process.jsp</result>
+ <result name="forward" type="redirectAction">
+ <param name="actionName">process</param>
+ <param name="namespace">/eventing</param>
+ </result>
+ </action>
+ </package>
+</struts>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/struts-help.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/struts-help.xml b/portlet/src/main/resources/struts-help.xml
new file mode 100644
index 0000000..451aa7d
--- /dev/null
+++ b/portlet/src/main/resources/struts-help.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE struts PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
+ "http://struts.apache.org/dtds/struts-2.5.dtd">
+
+<struts>
+ <package name="help" extends="struts-portlet-default"
+ namespace="/help">
+ <action name="index"
+ class="com.opensymphony.xwork2.ActionSupport">
+ <result name="success">/WEB-INF/help/index.jsp</result>
+ </action>
+ </package>
+</struts>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/struts-tiles.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/struts-tiles.xml b/portlet/src/main/resources/struts-tiles.xml
new file mode 100644
index 0000000..042f0c6
--- /dev/null
+++ b/portlet/src/main/resources/struts-tiles.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE struts PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
+ "http://struts.apache.org/dtds/struts-2.5.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>
+
+
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/struts-view.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/struts-view.xml b/portlet/src/main/resources/struts-view.xml
new file mode 100644
index 0000000..e492af1
--- /dev/null
+++ b/portlet/src/main/resources/struts-view.xml
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE struts PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
+ "http://struts.apache.org/dtds/struts-2.5.dtd">
+
+<struts>
+ <package name="view" extends="struts-portlet-default"
+ namespace="/view">
+ <action name="index"
+ class="com.opensymphony.xwork2.ActionSupport">
+ <result name="success">/WEB-INF/view/index.jsp</result>
+ </action>
+
+ <action name="formExample"
+ class="org.apache.struts2.portlet.example.FormExample" method="input">
+ <result name="input">
+ /WEB-INF/view/formExampleInput.jsp
+ </result>
+ </action>
+
+ <action name="processFormExample"
+ class="org.apache.struts2.portlet.example.FormExample">
+ <result name="input">
+ /WEB-INF/view/formExampleInput.jsp
+ </result>
+ <result name="success">
+ /WEB-INF/view/formExample.jsp
+ </result>
+ </action>
+
+ <action name="formExamplePrg" class="org.apache.struts2.portlet.example.FormExample">
+ <result name="input">
+ /WEB-INF/view/formExampleInputPrg.jsp
+ </result>
+ <result name="success" type="redirectAction">
+ <param name="actionName">formExamplePrg</param>
+ <param name="method">displayResult</param>
+ <param name="firstName">${firstName}</param>
+ <param name="lastName">${lastName}</param>
+ </result>
+ <result name="displayResult">
+ /WEB-INF/view/formExample.jsp
+ </result>
+ </action>
+
+ <action name="formExampleModelDriven"
+ class="org.apache.struts2.portlet.example.FormExampleModelDriven">
+ <result name="input">
+ /WEB-INF/view/formExampleInputModelDriven.jsp
+ </result>
+ <result name="success">
+ /WEB-INF/view/formExample.jsp
+ </result>
+ </action>
+
+ <action name="validationExample"
+ class="org.apache.struts2.portlet.example.FormExample" method="input">
+ <result name="input">
+ /WEB-INF/view/formExampleInputValidation.jsp
+ </result>
+ </action>
+
+ <action name="processValidationExample"
+ class="org.apache.struts2.portlet.example.FormExample">
+ <result name="success">
+ /WEB-INF/view/formExample.jsp
+ </result>
+ <result name="input">
+ /WEB-INF/view/formExampleInputValidation.jsp
+ </result>
+ </action>
+
+ <action name="fileUpload" class="org.apache.struts2.portlet.example.fileupload.FileUploadAction">
+ <result name="input">
+ /WEB-INF/view/fileUpload.jsp
+ </result>
+ <result name="success">
+ /WEB-INF/view/fileUploadSuccess.jsp
+ </result>
+ </action>
+
+ <action name="tokenExample"
+ class="com.opensymphony.xwork2.ActionSupport" method="input">
+ <result name="input">
+ /WEB-INF/view/tokenExampleInput.jsp
+ </result>
+ </action>
+
+ <action name="processTokenExample"
+ class="com.opensymphony.xwork2.ActionSupport">
+ <result name="input">
+ /WEB-INF/view/tokenExampleInput.jsp
+ </result>
+ <result name="invalid.token">
+ /WEB-INF/view/tokenExampleInput.jsp
+ </result>
+ <result name="success">
+ /WEB-INF/view/tokenExample.jsp
+ </result>
+ <interceptor-ref name="portletDefaultStackWithToken" />
+ </action>
+
+ <action name="springExample" class="springAction">
+ <result name="success">
+ /WEB-INF/view/springExample.jsp
+ </result>
+ </action>
+
+ <action name="freeMarkerExample"
+ class="com.opensymphony.xwork2.ActionSupport" method="input">
+ <result type="freemarker" name="input">
+ /WEB-INF/view/freeMarkerExampleInput.ftl
+ </result>
+ </action>
+
+ <action name="processFreeMarkerExample"
+ class="org.apache.struts2.portlet.example.FormExample">
+ <result name="success">/view/processFreeMarkerView.action?firstName=${firstName}&lastName=${lastName}</result>
+ </action>
+
+ <action name="processFreeMarkerView" class="org.apache.struts2.portlet.example.FormExample">
+ <result type="freemarker" name="success">/WEB-INF/view/freeMarkerExample.ftl</result>
+ </action>
+
+ <action name="velocityHelloWorld" class="com.opensymphony.xwork2.ActionSupport">
+ <result type="velocity" name="success">/WEB-INF/view/helloWorld.vm</result>
+ </action>
+
+ </package>
+</struts>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/struts.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/struts.xml b/portlet/src/main/resources/struts.xml
new file mode 100644
index 0000000..b493a34
--- /dev/null
+++ b/portlet/src/main/resources/struts.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE struts PUBLIC
+ "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN"
+ "http://struts.apache.org/dtds/struts-2.5.dtd">
+
+<struts>
+ <include file="struts-view.xml"/>
+ <include file="struts-edit.xml"/>
+ <include file="struts-help.xml"/>
+ <include file="struts-eventing.xml"/>
+ <include file="struts-tiles.xml"/>
+</struts>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/template/xhtml/components/checkbox.vm
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/template/xhtml/components/checkbox.vm b/portlet/src/main/resources/template/xhtml/components/checkbox.vm
new file mode 100644
index 0000000..6d952f9
--- /dev/null
+++ b/portlet/src/main/resources/template/xhtml/components/checkbox.vm
@@ -0,0 +1,12 @@
+<div align="center">
+ <input type="checkbox"
+ name="$!struts.htmlEncode($parameters.name)"
+ value="$!struts.htmlEncode($parameters.fieldValue)"
+ #if ($parameters.nameValue) checked="checked" #end
+ #if ($parameters.disabled == true) disabled="disabled" #end
+ #if ($parameters.tabindex) tabindex="$!struts.htmlEncode($parameters.tabindex)" #end
+ #if ($parameters.onchange) onchange="$!struts.htmlEncode($parameters.onchange)" #end
+ #if ($parameters.id) id="$!struts.htmlEncode($parameters.id)" #end
+ /><br />
+ $!struts.htmlEncode($parameters.label)
+</div>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/template/xhtml/components/datefield.vm
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/template/xhtml/components/datefield.vm b/portlet/src/main/resources/template/xhtml/components/datefield.vm
new file mode 100644
index 0000000..7b3f44b
--- /dev/null
+++ b/portlet/src/main/resources/template/xhtml/components/datefield.vm
@@ -0,0 +1,8 @@
+#set ($name = $parameters.name)
+#set ($label = $parameters.label)
+#set ($size = $parameters.mysize)
+#set ($yearsize = $parameters.yearsize)
+$label:
+<input type="text" name="${name}.day" size="$size" /> /
+<input type="text" name="${name}.month" size="$size" /> /
+<input type="text" name="${name}.year" size="$yearsize" /> (dd/mm/yyyy)
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/template/xhtml/components/mytextfield.vm
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/template/xhtml/components/mytextfield.vm b/portlet/src/main/resources/template/xhtml/components/mytextfield.vm
new file mode 100644
index 0000000..21c75be
--- /dev/null
+++ b/portlet/src/main/resources/template/xhtml/components/mytextfield.vm
@@ -0,0 +1,15 @@
+<div align="center">
+ <input type="text"
+ name="$!struts.htmlEncode($parameters.name)"
+ #if ($parameters.size) size="$!struts.htmlEncode($parameters.size)" #end
+ #if ($parameters.maxlength) maxlength="$!struts.htmlEncode($parameters.maxlength)" #end
+ #if ($parameters.nameValue) value="$!struts.htmlEncode($parameters.nameValue)" #end
+ #if ($parameters.disabled == true) disabled="disabled" #end
+ #if ($parameters.readonly) readonly="readonly" #end
+ #if ($parameters.onkeyup) onkeyup="$!struts.htmlEncode($parameters.onkeyup)" #end
+ #if ($parameters.tabindex) tabindex="$!struts.htmlEncode($parameters.tabindex)" #end
+ #if ($parameters.onchange) onchange="$!struts.htmlEncode($parameters.onchange)" #end
+ #if ($parameters.id) id="$!struts.htmlEncode($parameters.id)" #end
+ /><br />
+ $!struts.htmlEncode($parameters.label)
+</div>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/validators.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/validators.xml b/portlet/src/main/resources/validators.xml
new file mode 100644
index 0000000..9b373be
--- /dev/null
+++ b/portlet/src/main/resources/validators.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE validators PUBLIC
+ "-//Apache Struts//XWork Validator Config 1.0//EN"
+ "http://struts.apache.org/dtds/xwork-validator-config-1.0.dtd">
+<validators>
+ <validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/>
+ <validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/>
+ <validator name="int" class="com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator"/>
+ <validator name="short" class="com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator"/>
+ <validator name="double" class="com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator"/>
+ <validator name="date" class="com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator"/>
+ <validator name="expression" class="com.opensymphony.xwork2.validator.validators.ExpressionValidator"/>
+ <validator name="fieldexpression" class="com.opensymphony.xwork2.validator.validators.FieldExpressionValidator"/>
+ <validator name="email" class="com.opensymphony.xwork2.validator.validators.EmailValidator"/>
+ <validator name="url" class="com.opensymphony.xwork2.validator.validators.URLValidator"/>
+ <validator name="visitor" class="com.opensymphony.xwork2.validator.validators.VisitorFieldValidator"/>
+ <validator name="conversion" class="com.opensymphony.xwork2.validator.validators.ConversionErrorFieldValidator"/>
+</validators>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/velocity.properties b/portlet/src/main/resources/velocity.properties
new file mode 100644
index 0000000..6299831
--- /dev/null
+++ b/portlet/src/main/resources/velocity.properties
@@ -0,0 +1 @@
+runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/applicationContext.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/applicationContext.xml b/portlet/src/main/webapp/WEB-INF/applicationContext.xml
new file mode 100644
index 0000000..5df7f35
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/applicationContext.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+
+<!--
+ - Application context definition for "springapp" DispatcherServlet.
+-->
+
+ <bean id="thingManager"
+ class="org.apache.struts2.portlet.example.spring.ThingManager">
+ </bean>
+
+ <bean id="springAction"
+ class="org.apache.struts2.portlet.example.spring.SpringAction" scope="prototype">
+ <property name="thingManager">
+ <ref bean="thingManager" />
+ </property>
+ </bean>
+</beans>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/edit/defaultEdit.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/edit/defaultEdit.jsp b/portlet/src/main/webapp/WEB-INF/edit/defaultEdit.jsp
new file mode 100644
index 0000000..61b05c6
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/edit/defaultEdit.jsp
@@ -0,0 +1,5 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<H1>StrutsPortlet</H1>
+This is the default edit page!
+<p>
+<a href="<s:url value="prefsForm.action"/>">Set some prefs</a>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/edit/formExample.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/edit/formExample.jsp b/portlet/src/main/webapp/WEB-INF/edit/formExample.jsp
new file mode 100644
index 0000000..7d62563
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/edit/formExample.jsp
@@ -0,0 +1,5 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<H2>Hello <s:property value="firstName"/> <s:property value="lastName"/></H2>
+<p/>
+<a href="<s:url action="index"/>">Back to front page</a>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/edit/formExampleInput.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/edit/formExampleInput.jsp b/portlet/src/main/webapp/WEB-INF/edit/formExampleInput.jsp
new file mode 100644
index 0000000..43c981d
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/edit/formExampleInput.jsp
@@ -0,0 +1,8 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<H2>Input your name</H2>
+<s:form action="processFormExampleEdit" 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>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/edit/index.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/edit/index.jsp b/portlet/src/main/webapp/WEB-INF/edit/index.jsp
new file mode 100644
index 0000000..6b03c99
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/edit/index.jsp
@@ -0,0 +1,11 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+There are no examples in edit mode yet
+
+<p/>
+<a href="<s:url action="test"/>">Test</a>
+<p/>
+<a href="<s:url action="formExampleEdit"/>">Form test</a>
+<p/>
+<a href="<s:url action="/test/testAction" namespace="dummy"/>">Dummy test</a>
+<p/>
+<a href="<s:url action="index" portletMode="view"/>">Back to view mode</a>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/edit/namespaceTest.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/edit/namespaceTest.jsp b/portlet/src/main/webapp/WEB-INF/edit/namespaceTest.jsp
new file mode 100644
index 0000000..7e373a1
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/edit/namespaceTest.jsp
@@ -0,0 +1,4 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<a href="<s:url action="test"/>">Test page for namespace /edit/test</a>
+<p/>
+<a href="<s:url action="index"/>">Back to edit index</a>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/edit/prefsForm.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/edit/prefsForm.jsp b/portlet/src/main/webapp/WEB-INF/edit/prefsForm.jsp
new file mode 100644
index 0000000..af8b02c
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/edit/prefsForm.jsp
@@ -0,0 +1,6 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<s:form action="prefsFormSave.action" method="POST">
+ <s:textfield label="Preference one" name="preferenceOne" value="%{preferenceOne}"/>
+ <s:textfield label="Preference two" name="preferenceTwo" value="%{preferenceTwo}"/>
+ <s:submit value="Save prefs"/>
+</s:form>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/edit/prefsSaved.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/edit/prefsSaved.jsp b/portlet/src/main/webapp/WEB-INF/edit/prefsSaved.jsp
new file mode 100644
index 0000000..6aca664
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/edit/prefsSaved.jsp
@@ -0,0 +1,5 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+The preferences has been saved.
+
+<a href="<s:url value="index.action"/>">Back</a>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/edit/test.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/edit/test.jsp b/portlet/src/main/webapp/WEB-INF/edit/test.jsp
new file mode 100644
index 0000000..615860c
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/edit/test.jsp
@@ -0,0 +1,4 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<a href="<s:url action="test"/>">Test page</a>
+<p/>
+<a href="<s:url action="index"/>">Back to edit index</a>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/eventing/index.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/eventing/index.jsp b/portlet/src/main/webapp/WEB-INF/eventing/index.jsp
new file mode 100644
index 0000000..7b36b25
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/eventing/index.jsp
@@ -0,0 +1,11 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<h2>Input your name</h2>
+
+<s:actionmessage/>
+
+<s:form action="publish" method="POST">
+ <s:textfield label="Please enter your name" name="name" value="%{name}"/>
+ <s:submit value="Submit the form"/>
+</s:form>
+
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/eventing/process.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/eventing/process.jsp b/portlet/src/main/webapp/WEB-INF/eventing/process.jsp
new file mode 100644
index 0000000..dcc729f
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/eventing/process.jsp
@@ -0,0 +1,12 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<s:if test="%{name != null}">
+ <h2>Welcome <s:property value="name"/></h2>
+</s:if>
+<s:else>
+ <h2>Please insert a Name in the Publish Portlet Form</h2>
+</s:else>
+
+<s:actionmessage/>
+
+
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/help/defaultHelp.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/help/defaultHelp.jsp b/portlet/src/main/webapp/WEB-INF/help/defaultHelp.jsp
new file mode 100644
index 0000000..c8fb774
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/help/defaultHelp.jsp
@@ -0,0 +1 @@
+This is the default help page!
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/help/index.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/help/index.jsp b/portlet/src/main/webapp/WEB-INF/help/index.jsp
new file mode 100644
index 0000000..ea58ff8
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/help/index.jsp
@@ -0,0 +1 @@
+There are no examples in help mode yet
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/jetty-pluto-web-default.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/jetty-pluto-web-default.xml b/portlet/src/main/webapp/WEB-INF/jetty-pluto-web-default.xml
new file mode 100644
index 0000000..8cfe514
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/jetty-pluto-web-default.xml
@@ -0,0 +1,384 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!-- ===================================================================== -->
+<!-- This file contains the default descriptor for web applications. -->
+<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<!-- The intent of this descriptor is to include jetty specific or common -->
+<!-- configuration for all webapps. If a context has a webdefault.xml -->
+<!-- descriptor, it is applied before the contexts own web.xml file -->
+<!-- -->
+<!-- A context may be assigned a default descriptor by: -->
+<!-- + Calling WebApplicationContext.setDefaultsDescriptor -->
+<!-- + Passed an arg to addWebApplications -->
+<!-- -->
+<!-- This file is used both as the resource within the jetty.jar (which is -->
+<!-- used as the default if no explicit defaults descriptor is set) and it -->
+<!-- is copied to the etc directory of the Jetty distro and explicitly -->
+<!-- by the jetty.xml file. -->
+<!-- -->
+<!-- ===================================================================== -->
+<web-app
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ metadata-complete="true"
+ version="2.5">
+
+ <description>
+ Default web.xml file.
+ This file is applied to a Web application before it's own WEB_INF/web.xml file
+ </description>
+
+ <!-- ==================================================================== -->
+ <!-- Context params to control Session Cookies -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- UNCOMMENT TO ACTIVATE
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.SessionDomain</param-name>
+ <param-value>127.0.0.1</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.SessionPath</param-name>
+ <param-value>/</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>org.mortbay.jetty.servlet.MaxAge</param-name>
+ <param-value>-1</param-value>
+ </context-param>
+ -->
+
+ <context-param>
+ <param-name>org.mortbay.jetty.webapp.NoTLDJarPattern</param-name>
+ <param-value>start.jar|ant-.*\.jar|dojo-.*\.jar|jetty-.*\.jar|jsp-api-.*\.jar|junit-.*\.jar|servlet-api-.*\.jar|dnsns\.jar|rt\.jar|jsse\.jar|tools\.jar|sunpkcs11\.jar|sunjce_provider\.jar|xerces.*\.jar</param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>
+ com.bekk.boss.pluto.embedded.jetty.util.OverrideContextLoaderListener
+ </listener-class>
+ </listener>
+ <listener>
+ <listener-class>
+ com.bekk.boss.pluto.embedded.util.PortalStartupListener
+ </listener-class>
+ </listener>
+ <filter>
+ <filter-name>plutoResourceFilter</filter-name>
+ <filter-class>com.bekk.boss.pluto.embedded.util.PlutResourcesFilter</filter-class>
+ </filter>
+ <filter>
+ <filter-name>plutoPortalDriver</filter-name>
+ <filter-class>com.bekk.boss.pluto.embedded.util.PlutoPortalDriverFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>plutoResourceFilter</filter-name>
+ <url-pattern>*.css</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>plutoResourceFilter</filter-name>
+ <url-pattern>*.gif</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>plutoResourceFilter</filter-name>
+ <url-pattern>*.png</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>plutoResourceFilter</filter-name>
+ <url-pattern>*.js</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>plutoPortalDriver</filter-name>
+ <url-pattern>/pluto/index.jsp</url-pattern>
+ </filter-mapping>
+ <filter-mapping>
+ <filter-name>plutoPortalDriver</filter-name>
+ <url-pattern>/pluto/index.jsp/*</url-pattern>
+ </filter-mapping>
+
+ <!-- ==================================================================== -->
+ <!-- The default servlet. -->
+ <!-- This servlet, normally mapped to /, provides the handling for static -->
+ <!-- content, OPTIONS and TRACE methods for the context. -->
+ <!-- The following initParameters are supported: -->
+ <!-- -->
+ <!-- acceptRanges If true, range requests and responses are -->
+ <!-- supported -->
+ <!-- -->
+ <!-- dirAllowed If true, directory listings are returned if no -->
+ <!-- welcome file is found. Else 403 Forbidden. -->
+ <!-- -->
+ <!-- redirectWelcome If true, redirect welcome file requests -->
+ <!-- else use request dispatcher forwards -->
+ <!-- -->
+ <!-- gzip If set to true, then static content will be served-->
+ <!-- as gzip content encoded if a matching resource is -->
+ <!-- found ending with ".gz" -->
+ <!-- -->
+ <!-- resoureBase Can be set to replace the context resource base -->
+ <!-- -->
+ <!-- relativeResourceBase -->
+ <!-- Set with a pathname relative to the base of the -->
+ <!-- servlet context root. Useful for only serving -->
+ <!-- static content from only specific subdirectories. -->
+ <!-- -->
+ <!-- useFileMappedBuffer -->
+ <!-- If set to true (the default), a memory mapped -->
+ <!-- file buffer will be used to serve static content -->
+ <!-- when using an NIO connector. Setting this value -->
+ <!-- to false means that a direct buffer will be used -->
+ <!-- instead. If you are having trouble with Windows -->
+ <!-- file locking, set this to false. -->
+ <!-- -->
+ <!-- cacheControl If set, all static content will have this value -->
+ <!-- set as the cache-control header. -->
+ <!-- -->
+ <!-- maxCacheSize Maximum size of the static resource cache -->
+ <!-- -->
+ <!-- maxCachedFileSize Maximum size of any single file in the cache -->
+ <!-- -->
+ <!-- maxCachedFiles Maximum number of files in the cache -->
+ <!-- -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <servlet>
+ <servlet-name>default</servlet-name>
+ <servlet-class>org.mortbay.jetty.servlet.DefaultServlet</servlet-class>
+ <init-param>
+ <param-name>acceptRanges</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>dirAllowed</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>redirectWelcome</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxCacheSize</param-name>
+ <param-value>4000000</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxCachedFileSize</param-name>
+ <param-value>254000</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxCachedFiles</param-name>
+ <param-value>1000</param-value>
+ </init-param>
+ <init-param>
+ <param-name>gzip</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>useFileMappedBuffer</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <!--
+ <init-param>
+ <param-name>cacheControl</param-name>
+ <param-value>max-age=3600,public</param-value>
+ </init-param>
+ -->
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
+
+
+ <!-- ==================================================================== -->
+ <!-- JSP Servlet -->
+ <!-- This is the jasper JSP servlet from the jakarta project -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- The JSP page compiler and execution servlet, which is the mechanism -->
+ <!-- used by Glassfish to support JSP pages. Traditionally, this servlet -->
+ <!-- is mapped to URL patterh "*.jsp". This servlet supports the -->
+ <!-- following initialization parameters (default values are in square -->
+ <!-- brackets): -->
+ <!-- -->
+ <!-- checkInterval If development is false and reloading is true, -->
+ <!-- background compiles are enabled. checkInterval -->
+ <!-- is the time in seconds between checks to see -->
+ <!-- if a JSP page needs to be recompiled. [300] -->
+ <!-- -->
+ <!-- compiler Which compiler Ant should use to compile JSP -->
+ <!-- pages. See the Ant documenation for more -->
+ <!-- information. [javac] -->
+ <!-- -->
+ <!-- classdebuginfo Should the class file be compiled with -->
+ <!-- debugging information? [true] -->
+ <!-- -->
+ <!-- classpath What class path should I use while compiling -->
+ <!-- generated servlets? [Created dynamically -->
+ <!-- based on the current web application] -->
+ <!-- Set to ? to make the container explicitly set -->
+ <!-- this parameter. -->
+ <!-- -->
+ <!-- development Is Jasper used in development mode (will check -->
+ <!-- for JSP modification on every access)? [true] -->
+ <!-- -->
+ <!-- enablePooling Determines whether tag handler pooling is -->
+ <!-- enabled [true] -->
+ <!-- -->
+ <!-- fork Tell Ant to fork compiles of JSP pages so that -->
+ <!-- a separate JVM is used for JSP page compiles -->
+ <!-- from the one Tomcat is running in. [true] -->
+ <!-- -->
+ <!-- ieClassId The class-id value to be sent to Internet -->
+ <!-- Explorer when using <jsp:plugin> tags. -->
+ <!-- [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93] -->
+ <!-- -->
+ <!-- javaEncoding Java file encoding to use for generating java -->
+ <!-- source files. [UTF-8] -->
+ <!-- -->
+ <!-- keepgenerated Should we keep the generated Java source code -->
+ <!-- for each page instead of deleting it? [true] -->
+ <!-- -->
+ <!-- logVerbosityLevel The level of detailed messages to be produced -->
+ <!-- by this servlet. Increasing levels cause the -->
+ <!-- generation of more messages. Valid values are -->
+ <!-- FATAL, ERROR, WARNING, INFORMATION, and DEBUG. -->
+ <!-- [WARNING] -->
+ <!-- -->
+ <!-- mappedfile Should we generate static content with one -->
+ <!-- print statement per input line, to ease -->
+ <!-- debugging? [false] -->
+ <!-- -->
+ <!-- -->
+ <!-- reloading Should Jasper check for modified JSPs? [true] -->
+ <!-- -->
+ <!-- suppressSmap Should the generation of SMAP info for JSR45 -->
+ <!-- debugging be suppressed? [false] -->
+ <!-- -->
+ <!-- dumpSmap Should the SMAP info for JSR45 debugging be -->
+ <!-- dumped to a file? [false] -->
+ <!-- False if suppressSmap is true -->
+ <!-- -->
+ <!-- scratchdir What scratch directory should we use when -->
+ <!-- compiling JSP pages? [default work directory -->
+ <!-- for the current web application] -->
+ <!-- -->
+ <!-- tagpoolMaxSize The maximum tag handler pool size [5] -->
+ <!-- -->
+ <!-- xpoweredBy Determines whether X-Powered-By response -->
+ <!-- header is added by generated servlet [false] -->
+ <!-- -->
+ <!-- If you wish to use Jikes to compile JSP pages: -->
+ <!-- Set the init parameter "compiler" to "jikes". Define -->
+ <!-- the property "-Dbuild.compiler.emacs=true" when starting Jetty -->
+ <!-- to cause Jikes to emit error messages in a format compatible with -->
+ <!-- Jasper. -->
+ <!-- If you get an error reporting that jikes can't use UTF-8 encoding, -->
+ <!-- try setting the init parameter "javaEncoding" to "ISO-8859-1". -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <servlet id="jsp">
+ <servlet-name>jsp</servlet-name>
+ <servlet-class>com.bekk.boss.pluto.embedded.util.PortletJspServlet</servlet-class>
+ <init-param>
+ <param-name>logVerbosityLevel</param-name>
+ <param-value>DEBUG</param-value>
+ </init-param>
+ <init-param>
+ <param-name>fork</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>xpoweredBy</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <!--
+ <init-param>
+ <param-name>classpath</param-name>
+ <param-value>?</param-value>
+ </init-param>
+ -->
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>jsp</servlet-name>
+ <url-pattern>*.jsp</url-pattern>
+ <url-pattern>*.jspf</url-pattern>
+ <url-pattern>*.jspx</url-pattern>
+ <url-pattern>*.xsp</url-pattern>
+ <url-pattern>*.JSP</url-pattern>
+ <url-pattern>*.JSPF</url-pattern>
+ <url-pattern>*.JSPX</url-pattern>
+ <url-pattern>*.XSP</url-pattern>
+ </servlet-mapping>
+
+
+
+ <!-- ==================================================================== -->
+ <session-config>
+ <session-timeout>30</session-timeout>
+ </session-config>
+
+ <!-- ==================================================================== -->
+ <!-- Default MIME mappings -->
+ <!-- The default MIME mappings are provided by the mime.properties -->
+ <!-- resource in the org.mortbay.jetty.jar file. Additional or modified -->
+ <!-- mappings may be specified here -->
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+ <!-- UNCOMMENT TO ACTIVATE
+ <mime-mapping>
+ <extension>mysuffix</extension>
+ <mime-type>mymime/type</mime-type>
+ </mime-mapping>
+ -->
+
+ <!-- ==================================================================== -->
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ <welcome-file>index.htm</welcome-file>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <!-- ==================================================================== -->
+ <locale-encoding-mapping-list>
+ <locale-encoding-mapping><locale>ar</locale><encoding>ISO-8859-6</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>be</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>bg</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ca</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>cs</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>da</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>de</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>el</locale><encoding>ISO-8859-7</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>en</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>es</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>et</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>fi</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>fr</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>hr</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>hu</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>is</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>it</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>iw</locale><encoding>ISO-8859-8</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ja</locale><encoding>Shift_JIS</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ko</locale><encoding>EUC-KR</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>lt</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>lv</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>mk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>nl</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>no</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>pl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>pt</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ro</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>ru</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sh</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sk</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sl</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sq</locale><encoding>ISO-8859-2</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sr</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>sv</locale><encoding>ISO-8859-1</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>tr</locale><encoding>ISO-8859-9</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>uk</locale><encoding>ISO-8859-5</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>zh</locale><encoding>GB2312</encoding></locale-encoding-mapping>
+ <locale-encoding-mapping><locale>zh_TW</locale><encoding>Big5</encoding></locale-encoding-mapping>
+ </locale-encoding-mapping-list>
+
+</web-app>
+
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/portlet.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/portlet.xml b/portlet/src/main/webapp/WEB-INF/portlet.xml
new file mode 100644
index 0000000..f4087b7
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/portlet.xml
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<portlet-app
+ id="struts-portlet"
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ version="2.0"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ >
+
+ <portlet id="StrutsPortlet">
+ <description xml:lang="EN">Struts Test Portlet</description>
+ <portlet-name>StrutsPortlet</portlet-name>
+ <display-name xml:lang="EN">Struts Test Portlet</display-name>
+
+ <portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
+
+ <!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
+ <init-param>
+ <name>viewNamespace</name>
+ <value>/view</value>
+ </init-param>
+
+ <!-- The default action to invoke in view mode. -->
+ <init-param>
+ <name>defaultViewAction</name>
+ <value>index</value>
+ </init-param>
+
+ <!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. -->
+ <init-param>
+ <name>editNamespace</name>
+ <value>/edit</value>
+ </init-param>
+
+ <!-- The default action to invoke in edit mode. -->
+ <init-param>
+ <name>defaultEditAction</name>
+ <value>index</value>
+ </init-param>
+
+ <!-- The help mode namespace. Maps to a namespace in the Struts 2 config file. -->
+ <init-param>
+ <name>helpNamespace</name>
+ <value>/help</value>
+ </init-param>
+
+ <!-- The default action to invoke in help mode. -->
+ <init-param>
+ <name>defaultHelpAction</name>
+ <value>index</value>
+ </init-param>
+
+ <expiration-cache>0</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>view</portlet-mode>
+ <portlet-mode>edit</portlet-mode>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+
+ <supported-locale>en</supported-locale>
+
+ <portlet-info>
+ <title>My Struts2 Portlet</title>
+ <short-title>SP2</short-title>
+ <keywords>struts,portlet</keywords>
+ </portlet-info>
+ </portlet>
+
+ <portlet id="StrutsPortlet2">
+ <description xml:lang="EN">Struts Test Portlet with JSR 286 Dispatcher</description>
+ <portlet-name>StrutsPortlet2</portlet-name>
+ <display-name xml:lang="EN">Struts Test Portlet with JSR 286 Dispatcher</display-name>
+
+ <portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class>
+
+ <!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
+ <init-param>
+ <name>viewNamespace</name>
+ <value>/view</value>
+ </init-param>
+
+ <!-- The default action to invoke in view mode. -->
+ <init-param>
+ <name>defaultViewAction</name>
+ <value>index</value>
+ </init-param>
+
+ <!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. -->
+ <init-param>
+ <name>editNamespace</name>
+ <value>/edit</value>
+ </init-param>
+
+ <!-- The default action to invoke in edit mode. -->
+ <init-param>
+ <name>defaultEditAction</name>
+ <value>index</value>
+ </init-param>
+
+ <!-- The help mode namespace. Maps to a namespace in the Struts 2 config file. -->
+ <init-param>
+ <name>helpNamespace</name>
+ <value>/help</value>
+ </init-param>
+
+ <!-- The default action to invoke in help mode. -->
+ <init-param>
+ <name>defaultHelpAction</name>
+ <value>index</value>
+ </init-param>
+
+ <expiration-cache>0</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>edit</portlet-mode>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+
+ <supported-locale>en</supported-locale>
+
+ <portlet-info>
+ <title>My Struts2 Portlet with JSR 286 Dispatcher</title>
+ <short-title>SP2JSR286</short-title>
+ <keywords>struts,portlet</keywords>
+ </portlet-info>
+ </portlet>
+
+
+ <portlet id="Struts2PublishPortlet">
+ <description xml:lang="EN">Struts2 Publish Portlet</description>
+ <portlet-name>Struts2PublishPortlet</portlet-name>
+ <display-name xml:lang="EN">Struts2 Publish Portlet</display-name>
+
+ <portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class>
+
+ <!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
+ <init-param>
+ <name>viewNamespace</name>
+ <value>/eventing</value>
+ </init-param>
+
+ <!-- The default action to invoke in view mode. -->
+ <init-param>
+ <name>defaultViewAction</name>
+ <value>publish</value>
+ </init-param>
+
+ <expiration-cache>0</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+
+ <supported-locale>en</supported-locale>
+
+ <portlet-info>
+ <title>Struts2 Publish Portlet</title>
+ <short-title>S2PUB</short-title>
+ <keywords>struts,publish,portlet</keywords>
+ </portlet-info>
+
+ <supported-publishing-event xmlns:x="http://org.apache.struts2.portlets/events">
+ <qname>x:name</qname>
+ </supported-publishing-event>
+ </portlet>
+
+ <portlet id="Struts2ProcessPortlet">
+ <description xml:lang="EN">Struts2 Process Portlet</description>
+ <portlet-name>Struts2ProcessPortlet</portlet-name>
+ <display-name xml:lang="EN">Struts2 Process Portlet</display-name>
+
+ <portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class>
+
+ <!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. -->
+ <init-param>
+ <name>viewNamespace</name>
+ <value>/eventing</value>
+ </init-param>
+
+ <!-- The default action to invoke in view mode. -->
+ <init-param>
+ <name>defaultViewAction</name>
+ <value>process</value>
+ </init-param>
+
+ <expiration-cache>0</expiration-cache>
+
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+
+ <supported-locale>en</supported-locale>
+
+ <portlet-info>
+ <title>Struts2 Process Portlet</title>
+ <short-title>S2PRO</short-title>
+ <keywords>struts,process,portlet</keywords>
+ </portlet-info>
+
+ <supported-processing-event xmlns:x="http://org.apache.struts2.portlets/events">
+ <qname>x:name</qname>
+ </supported-processing-event>
+ </portlet>
+
+ <event-definition>
+ <qname xmlns:x="http://org.apache.struts2.portlets/events">x:name</qname>
+ <value-type>java.lang.String</value-type>
+ </event-definition>
+
+</portlet-app>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/readme.txt
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/readme.txt b/portlet/src/main/webapp/WEB-INF/readme.txt
new file mode 100644
index 0000000..5363314
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/readme.txt
@@ -0,0 +1,10 @@
+Configurations:
+
+JBoss Portal specific configuration files
+-----------------------------------------
+jboss-app.xml
+jboss-portlet.xml
+jboss-web.xml
+portlet-instances.xml
+struts-example-object.xml
+struts-example-pages.xml
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/tiles.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/tiles.xml b/portlet/src/main/webapp/WEB-INF/tiles.xml
new file mode 100644
index 0000000..a8c1b39
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/tiles.xml
@@ -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>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/fileUpload.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/fileUpload.jsp b/portlet/src/main/webapp/WEB-INF/view/fileUpload.jsp
new file mode 100644
index 0000000..7ba7958
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/fileUpload.jsp
@@ -0,0 +1,13 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+ <h1>Fileupload sample</h1>
+
+ <s:actionerror />
+ <s:fielderror />
+ <s:form action="fileUpload" method="POST" enctype="multipart/form-data">
+ <s:file name="upload" label="File"/>
+ <s:textfield name="caption" label="Caption"/>
+ <s:submit />
+ </s:form>
+
+
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/fileUploadSuccess.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/fileUploadSuccess.jsp b/portlet/src/main/webapp/WEB-INF/view/fileUploadSuccess.jsp
new file mode 100644
index 0000000..8fad0e4
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/fileUploadSuccess.jsp
@@ -0,0 +1,14 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<h1>Fileupload sample</h1>
+
+<p>
+ <ul>
+ <li>ContentType: <s:property value="uploadContentType" /></li>
+ <li>FileName: <s:property value="uploadFileName" /></li>
+ <li>File: <s:property value="upload" /></li>
+ <li>Caption:<s:property value="caption" /></li>
+ </ul>
+</p>
+
+
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/formExample.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/formExample.jsp b/portlet/src/main/webapp/WEB-INF/view/formExample.jsp
new file mode 100644
index 0000000..7d62563
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/formExample.jsp
@@ -0,0 +1,5 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<H2>Hello <s:property value="firstName"/> <s:property value="lastName"/></H2>
+<p/>
+<a href="<s:url action="index"/>">Back to front page</a>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/formExampleInput.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/formExampleInput.jsp b/portlet/src/main/webapp/WEB-INF/view/formExampleInput.jsp
new file mode 100644
index 0000000..468d0eb
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/formExampleInput.jsp
@@ -0,0 +1,8 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<H2>Input your name</H2>
+<s:form action="processFormExample" 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>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/formExampleInputModelDriven.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/formExampleInputModelDriven.jsp b/portlet/src/main/webapp/WEB-INF/view/formExampleInputModelDriven.jsp
new file mode 100644
index 0000000..b65c4e0
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/formExampleInputModelDriven.jsp
@@ -0,0 +1,8 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<H2>Input your name</H2>
+<s:form action="formExampleModelDriven" 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>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/formExampleInputPrg.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/formExampleInputPrg.jsp b/portlet/src/main/webapp/WEB-INF/view/formExampleInputPrg.jsp
new file mode 100644
index 0000000..bd00bbf
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/formExampleInputPrg.jsp
@@ -0,0 +1,8 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<H2>Input your name</H2>
+<s:form action="formExamplePrg" 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>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/formExampleInputValidation.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/formExampleInputValidation.jsp b/portlet/src/main/webapp/WEB-INF/view/formExampleInputValidation.jsp
new file mode 100644
index 0000000..f647457
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/formExampleInputValidation.jsp
@@ -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="processValidationExample" 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>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/formExampleSubmitToSelfWithValidation.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/formExampleSubmitToSelfWithValidation.jsp b/portlet/src/main/webapp/WEB-INF/view/formExampleSubmitToSelfWithValidation.jsp
new file mode 100644
index 0000000..ec7f076
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/formExampleSubmitToSelfWithValidation.jsp
@@ -0,0 +1,6 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<H2>Hello <s:property value="firstName"/> <s:property value="lastName"/></H2>
+<p/>
+<a href="<s:url action="index"/>">Back to front page</a>
+
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/freeMarkerExample.ftl
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/freeMarkerExample.ftl b/portlet/src/main/webapp/WEB-INF/view/freeMarkerExample.ftl
new file mode 100644
index 0000000..426d14f
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/freeMarkerExample.ftl
@@ -0,0 +1,3 @@
+<b>Hello from FreeMarker, ${firstName?html} ${lastName?html}!</b>
+<p/>
+<a href="<@s.url action="index"/>">Back to front page</a>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/freeMarkerExampleInput.ftl
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/freeMarkerExampleInput.ftl b/portlet/src/main/webapp/WEB-INF/view/freeMarkerExampleInput.ftl
new file mode 100644
index 0000000..86ebbfb
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/freeMarkerExampleInput.ftl
@@ -0,0 +1,5 @@
+<@s.form action="processFreeMarkerExample" method="POST">
+ <@s.textfield label="First name" name="firstName"/>
+ <@s.textfield label="Last name" name="lastName"/>
+ <@s.submit value="Say hello!"/>
+</...@s.form>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/helloWorld.vm
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/helloWorld.vm b/portlet/src/main/webapp/WEB-INF/view/helloWorld.vm
new file mode 100644
index 0000000..4fcf4d6
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/helloWorld.vm
@@ -0,0 +1,4 @@
+Hello World from velocity!
+<p />
+#surl ("var=url" "action=index")
+<a href="${url}">Back to the front page</a>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/index.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/index.jsp b/portlet/src/main/webapp/WEB-INF/view/index.jsp
new file mode 100644
index 0000000..6f6b97c
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/index.jsp
@@ -0,0 +1,18 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<H2>Welcome to the Struts example portlet</H2>
+<p/>
+Here you'll find examples of what is possible with the Struts Portlet integration framework.
+<ul>
+<li><a href="<s:url action="formExample"/>">A simple form</a></li>
+<li><a href="<s:url action="formExamplePrg" method="input"/>">Form example with proper PRG</a></li>
+<li><a href="<s:url action="formExampleModelDriven" method="input"/>">Model driven example</a>/li>
+<li><a href="<s:url action="validationExample"/>">Validation</a></li>
+<li><a href="<s:url action="tokenExample"/>">Token</a></li>
+<li><a href="<s:url action="springExample"/>">Spring integration</a></li>
+<li><a href="<s:url action="fileUpload" method="input"/>">File upload</a></li>
+<li><a href="<s:url action="freeMarkerExample"/>">FreeMarker</a></li>
+<li><a href="<s:url action="velocityHelloWorld"/>">Velocity</a></li>
+<li><a href="<s:url action="index" namespace="/tiles"/>">Form Example Validation with Tiles</a></li>
+<li><a href="<s:url action="index" portletMode="edit"/>">Go to edit mode and see what's there</a></li>
+<li><a href="<s:url action="index" portletMode="help"/>">Go to help mode and see what's there</a></li>
+</ul>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/notImplemented.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/notImplemented.jsp b/portlet/src/main/webapp/WEB-INF/view/notImplemented.jsp
new file mode 100644
index 0000000..a3af7eb
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/notImplemented.jsp
@@ -0,0 +1 @@
+<H2>This example has not yet been implemented</H2>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/springExample.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/springExample.jsp b/portlet/src/main/webapp/WEB-INF/view/springExample.jsp
new file mode 100644
index 0000000..8a0da42
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/springExample.jsp
@@ -0,0 +1,16 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<h3>Example of Spring managed singleton. All the 'things' are contained in a Spring defined ThingManager</h3>
+
+<b>Things in the list:</b>
+<p/>
+<s:iterator value="things">
+ <s:property /><br/>
+</s:iterator>
+<p/>
+<s:form action="springExample" method="POST">
+ <s:textfield label="Thing to add?" name="thing" value=""/>
+ <s:submit value="Add the thing"/>
+</s:form>
+<p/>
+<a href="<s:url action="index"/>">Back to front page</a>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/tokenExample.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/tokenExample.jsp b/portlet/src/main/webapp/WEB-INF/view/tokenExample.jsp
new file mode 100644
index 0000000..e41c9e9
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/tokenExample.jsp
@@ -0,0 +1,5 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<H2>The form was successfully submitted with a valid token</H2>
+
+<a href="<s:url action="index"/>"/>Back to front page</a>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/view/tokenExampleInput.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/view/tokenExampleInput.jsp b/portlet/src/main/webapp/WEB-INF/view/tokenExampleInput.jsp
new file mode 100644
index 0000000..7aa2e31
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/view/tokenExampleInput.jsp
@@ -0,0 +1,20 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<s:if test="hasErrors()">
+ ERROR:<br />
+ <font color="red">
+ <s:iterator value="actionErrors">
+ <s:property/><br />
+ </s:iterator>
+ </font>
+</s:if>
+<H2>Form with invalid token</H2>
+<s:form action="processTokenExample" method="POST">
+ <s:textfield label="The value to submit" name="theValue" value=""/>
+ <s:submit value="Submit the form"/>
+</s:form>
+<H2>Form with valid token</H2>
+<s:form action="processTokenExample" method="POST">
+ <s:token/>
+ <s:textfield label="The value to submit" name="theValue" value=""/>
+ <s:submit value="Submit the form"/>
+</s:form>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/WEB-INF/web.xml b/portlet/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..f424419
--- /dev/null
+++ b/portlet/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app id="StrutsPortlet">
+
+ <context-param>
+ <param-name>org.apache.tiles.factory.TilesContainerFactory</param-name>
+ <param-value>org.apache.struts2.tiles.StrutsTilesContainerFactory</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
+ <param-value>/WEB-INF/tiles.xml</param-value>
+ </context-param>
+
+ <!-- Uncomment/comment this if you need/don't need Spring support -->
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>
+ /WEB-INF/applicationContext*.xml
+ </param-value>
+ </context-param>
+ <listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+ </listener>
+
+ <!-- Tiles Plugin -->
+ <listener>
+ <listener-class>org.apache.struts2.tiles.StrutsTilesListener
+ </listener-class>
+ </listener>
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/styles/styles.css
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/styles/styles.css b/portlet/src/main/webapp/styles/styles.css
new file mode 100644
index 0000000..3dafc08
--- /dev/null
+++ b/portlet/src/main/webapp/styles/styles.css
@@ -0,0 +1,7 @@
+.wwFormTable {}
+.label {font-style:italic; }
+.errorLabel {font-style:italic; color:red; }
+.errorMessage {font-weight:bold; text-align: center; color:red; }
+.checkboxLabel {}
+.checkboxErrorLabel {color:red; }
+.required {color:red;}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/tiles/footer.ftl
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/tiles/footer.ftl b/portlet/src/main/webapp/tiles/footer.ftl
new file mode 100644
index 0000000..b5e7a6f
--- /dev/null
+++ b/portlet/src/main/webapp/tiles/footer.ftl
@@ -0,0 +1,5 @@
+<hr/>
+<@s.url var="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>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/tiles/footer.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/tiles/footer.jsp b/portlet/src/main/webapp/tiles/footer.jsp
new file mode 100644
index 0000000..557f007
--- /dev/null
+++ b/portlet/src/main/webapp/tiles/footer.jsp
@@ -0,0 +1,6 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<hr/>
+<s:url var="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>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/tiles/formExample.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/tiles/formExample.jsp b/portlet/src/main/webapp/tiles/formExample.jsp
new file mode 100644
index 0000000..4d5aee0
--- /dev/null
+++ b/portlet/src/main/webapp/tiles/formExample.jsp
@@ -0,0 +1,5 @@
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<H2>Hello <s:property value="firstName"/> <s:property value="lastName"/></H2>
+<p/>
+
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/tiles/formExampleInputValidation.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/tiles/formExampleInputValidation.jsp b/portlet/src/main/webapp/tiles/formExampleInputValidation.jsp
new file mode 100644
index 0000000..83de0b2
--- /dev/null
+++ b/portlet/src/main/webapp/tiles/formExampleInputValidation.jsp
@@ -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>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/tiles/header.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/tiles/header.jsp b/portlet/src/main/webapp/tiles/header.jsp
new file mode 100644
index 0000000..617386a
--- /dev/null
+++ b/portlet/src/main/webapp/tiles/header.jsp
@@ -0,0 +1,2 @@
+<h1>Struts2 Portlet Tiles App Example</h1>
+<hr/>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/tiles/index.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/tiles/index.jsp b/portlet/src/main/webapp/tiles/index.jsp
new file mode 100644
index 0000000..875f60c
--- /dev/null
+++ b/portlet/src/main/webapp/tiles/index.jsp
@@ -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 var="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
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/webapp/tiles/layout.jsp
----------------------------------------------------------------------
diff --git a/portlet/src/main/webapp/tiles/layout.jsp b/portlet/src/main/webapp/tiles/layout.jsp
new file mode 100644
index 0000000..7cd6b48
--- /dev/null
+++ b/portlet/src/main/webapp/tiles/layout.jsp
@@ -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"/>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/test/java/JettyPlutoLauncher.java
----------------------------------------------------------------------
diff --git a/portlet/src/test/java/JettyPlutoLauncher.java b/portlet/src/test/java/JettyPlutoLauncher.java
new file mode 100644
index 0000000..ef24a40
--- /dev/null
+++ b/portlet/src/test/java/JettyPlutoLauncher.java
@@ -0,0 +1,19 @@
+import org.apache.pluto.core.PortletServlet;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.servlet.ServletHolder;
+import org.mortbay.jetty.webapp.WebAppContext;
+
+public class JettyPlutoLauncher {
+ public static void main(String[] args) throws Exception {
+ System.setProperty("org.apache.pluto.embedded.portletIds", "StrutsPortlet");
+ Server server = new Server(8080);
+ WebAppContext webapp = new WebAppContext(System.getProperty("user.dir") + "/apps/portlet/src/main/webapp", "/test");
+ webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
+ ServletHolder portletServlet = new ServletHolder(new PortletServlet());
+ portletServlet.setInitParameter("portlet-name", "StrutsPortlet");
+ portletServlet.setInitOrder(1);
+ webapp.addServlet(portletServlet, "/PlutoInvoker/StrutsPortlet");
+ server.addHandler(webapp);
+ server.start();
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
----------------------------------------------------------------------
diff --git a/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java b/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
new file mode 100644
index 0000000..c46f2ed
--- /dev/null
+++ b/portlet/src/test/java/org/apache/struts2/portlet/test/BasePortletTest.java
@@ -0,0 +1,97 @@
+package org.apache.struts2.portlet.test;
+
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+import org.apache.pluto.core.PortletServlet;
+import org.mortbay.jetty.Server;
+import org.mortbay.jetty.servlet.ServletHolder;
+import org.mortbay.jetty.webapp.WebAppContext;
+
+import junit.framework.TestCase;
+
+import java.io.File;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+public abstract class BasePortletTest extends TestCase {
+
+ protected Server server;
+
+ private String contextPath = "/test";
+
+ private int port;
+
+ public void setUp() throws Exception {
+ System.setProperty("org.apache.pluto.embedded.portletIds", getPortletName());
+ System.setProperty("org.apache.jasper.compiler.disablejsr199", "false");
+
+ server = new Server(port);
+
+ WebAppContext webapp = new WebAppContext("src/main/webapp", contextPath);
+ webapp.setTempDirectory(new File("target/work"));
+ webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
+
+ // Set Classloader of Context to be sane (needed for JSTL)
+ // JSP requires a non-System classloader, this simply wraps the
+ // embedded System classloader in a way that makes it suitable
+ // for JSP to use
+ ClassLoader jspClassLoader = new URLClassLoader(new URL[0], this.getClass().getClassLoader());
+ webapp.setClassLoader(jspClassLoader);
+
+ ServletHolder portletServlet = new ServletHolder(new PortletServlet());
+ portletServlet.setInitParameter("portlet-name", getPortletName());
+ portletServlet.setInitOrder(1);
+ webapp.addServlet(portletServlet, "/PlutoInvoker/" + getPortletName());
+
+ server.addHandler(webapp);
+
+ server.start();
+ // Retrieve the actual port that is used, in case a random, free port is
+ // picked
+ int port = server.getConnectors()[0].getLocalPort();
+ getTestContext().setBaseUrl("http://localhost:" + port + contextPath);
+ }
+
+
+ public void tearDown() throws Exception {
+ server.stop();
+ }
+
+ public void minimizeWindow() {
+ clickElementByXPath("//span[@class='minimized']/..");
+ }
+
+ public void maximizeWindow() {
+ clickElementByXPath("//span[@class='minimized']/..");
+ }
+
+ public void restoreWindow() {
+ clickElementByXPath("//span[@class='normal']/..");
+ }
+
+ public void switchEdit() {
+ clickElementByXPath("//span[@class='edit']/..");
+ }
+
+ public void switchView() {
+ clickElementByXPath("//span[@class='view']/..");
+ }
+
+ public void switchHelp() {
+ clickElementByXPath("//span[@class='help']/..");
+ }
+
+ public void setContextPath(String contextPath) {
+ if(!contextPath.startsWith("/")) {
+ this.contextPath = "/" + contextPath;
+ }
+ else {
+ this.contextPath = contextPath;
+ }
+ }
+
+ public void setPort(int port) {
+ this.port = port;
+ }
+
+ public abstract String getPortletName();
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java
----------------------------------------------------------------------
diff --git a/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java b/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java
new file mode 100644
index 0000000..8daadf9
--- /dev/null
+++ b/portlet/src/test/java/org/apache/struts2/portlet/test/Struts2PortletTest.java
@@ -0,0 +1,87 @@
+package org.apache.struts2.portlet.test;
+
+import static net.sourceforge.jwebunit.junit.JWebUnit.*;
+
+public class Struts2PortletTest extends BasePortletTest {
+
+ private final static String PORTLET_NAME = "StrutsPortlet";
+
+ public void testNone() {}
+
+ public void testIndexPage() throws Exception {
+ beginAt("pluto/index.jsp");
+ assertTextPresent("Welcome to the Struts example portlet");
+ assertLinkPresentWithExactText("A simple form");
+ assertLinkPresentWithExactText("Validation");
+ }
+
+ public void testFormExample() throws Exception {
+ beginAt("pluto/index.jsp");
+ clickLinkWithExactText("A simple form");
+ assertFormPresent("processFormExample");
+ assertTextPresent("Input your name");
+ setWorkingForm("processFormExample");
+ setTextField("firstName", "Nils-Helge");
+ setTextField("lastName", "Garli");
+ submit();
+ assertTextPresent("Hello Nils-Helge Garli");
+ }
+
+ public void testValidationExample() throws Exception {
+ beginAt("pluto/index.jsp");
+ clickLinkWithExactText("Validation");
+ assertFormPresent("processValidationExample");
+ assertTextPresent("Input your name");
+ setWorkingForm("processValidationExample");
+ setTextField("firstName", "Nils-Helge");
+ submit();
+ assertTextFieldEquals("firstName", "Nils-Helge");
+ assertTextPresent("You must enter a last name");
+ setTextField("lastName", "Garli");
+ submit();
+ assertTextPresent("Hello Nils-Helge Garli");
+ }
+
+ public void testValidationErrorMessagesStickBetweenWindowStateChanges() throws Exception {
+ beginAt("pluto/index.jsp");
+ clickLinkWithExactText("Validation");
+ assertFormPresent("processValidationExample");
+ assertTextPresent("Input your name");
+ setWorkingForm("processValidationExample");
+ setTextField("firstName", "Nils-Helge");
+ submit();
+ assertTextFieldEquals("firstName", "Nils-Helge");
+ assertTextPresent("You must enter a last name");
+ minimizeWindow();
+ assertTextNotPresent("Input your name");
+ restoreWindow();
+ assertTextPresent("Input your name");
+ assertTextPresent("You must enter a last name");
+ }
+
+ public void testTokenExample() throws Exception {
+ beginAt("pluto/index.jsp");
+ clickLinkWithText("Token");
+ setWorkingForm(0);
+ setTextField("theValue", "something");
+ submit();
+ assertTextPresent("ERROR");
+ setWorkingForm(1);
+ setTextField("theValue", "somethingElse");
+ submit();
+ assertTextPresent("The form was successfully submitted with a valid token");
+ }
+
+ public void testSwitchFromViewToEditShouldGoToDefaultEditPage() throws Exception {
+ beginAt("pluto/index.jsp");
+ assertTextPresent("Welcome to the Struts example portlet");
+ switchEdit();
+ assertTextPresent("Back to view mode");
+ }
+
+ @Override
+ public String getPortletName() {
+ return PORTLET_NAME;
+ }
+
+}