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:49:57 UTC
[1/6] struts-examples git commit: Adds missing dependencies
Repository: struts-examples
Updated Branches:
refs/heads/master f59d7baa2 -> 62a6110bf
Adds missing dependencies
Project: http://git-wip-us.apache.org/repos/asf/struts-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts-examples/commit/4a7216c3
Tree: http://git-wip-us.apache.org/repos/asf/struts-examples/tree/4a7216c3
Diff: http://git-wip-us.apache.org/repos/asf/struts-examples/diff/4a7216c3
Branch: refs/heads/master
Commit: 4a7216c3c8aac6baa7836841b7fec38a1efb6196
Parents: f59d7ba
Author: Lukasz Lenart <lu...@gmail.com>
Authored: Sat Jun 18 09:13:37 2016 +0200
Committer: Lukasz Lenart <lu...@gmail.com>
Committed: Sat Jun 18 09:13:37 2016 +0200
----------------------------------------------------------------------
blank/pom.xml | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/4a7216c3/blank/pom.xml
----------------------------------------------------------------------
diff --git a/blank/pom.xml b/blank/pom.xml
index 2cd237b..25c9927 100644
--- a/blank/pom.xml
+++ b/blank/pom.xml
@@ -36,6 +36,12 @@
<dependencies>
<dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-core</artifactId>
+ <version>${struts2.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
@@ -50,6 +56,17 @@
</dependency>
<dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
<version>${struts2.version}</version>
[4/6] struts-examples git commit: WW-4660 Moves example portlet app
into struts-examples
Posted by lu...@apache.org.
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;
+ }
+
+}
[3/6] struts-examples git commit: Adds missing dependencies
Posted by lu...@apache.org.
Adds missing dependencies
Project: http://git-wip-us.apache.org/repos/asf/struts-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts-examples/commit/81b2df4e
Tree: http://git-wip-us.apache.org/repos/asf/struts-examples/tree/81b2df4e
Diff: http://git-wip-us.apache.org/repos/asf/struts-examples/diff/81b2df4e
Branch: refs/heads/master
Commit: 81b2df4e0b9f3db2261b5e8dead8e93533d77946
Parents: 7ce189c
Author: Lukasz Lenart <lu...@gmail.com>
Authored: Sat Jun 18 09:17:59 2016 +0200
Committer: Lukasz Lenart <lu...@gmail.com>
Committed: Sat Jun 18 09:17:59 2016 +0200
----------------------------------------------------------------------
rest-angular/pom.xml | 13 ++++++++++++-
unit-testing/pom.xml | 10 ++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/81b2df4e/rest-angular/pom.xml
----------------------------------------------------------------------
diff --git a/rest-angular/pom.xml b/rest-angular/pom.xml
index 86967a5..37705cb 100644
--- a/rest-angular/pom.xml
+++ b/rest-angular/pom.xml
@@ -10,7 +10,7 @@
<artifactId>rest-angular</artifactId>
- <name>REST Plugin based application with AngularJS frontend</name>
+ <name>REST Plugin based application with AngularJS</name>
<description>A REST Plugin based Struts2 application with AngularJS frontend, Bean validation, Exception Handling and multi language support.</description>
@@ -96,6 +96,17 @@
</dependency>
<dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/81b2df4e/unit-testing/pom.xml
----------------------------------------------------------------------
diff --git a/unit-testing/pom.xml b/unit-testing/pom.xml
index d01d742..5a6ce0e 100644
--- a/unit-testing/pom.xml
+++ b/unit-testing/pom.xml
@@ -36,6 +36,16 @@
<version>2.0</version>
</dependency>
<dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_3.0_spec</artifactId>
<version>1.0</version>
[5/6] struts-examples git commit: WW-4660 Moves example portlet app
into struts-examples
Posted by lu...@apache.org.
WW-4660 Moves example portlet app into struts-examples
Project: http://git-wip-us.apache.org/repos/asf/struts-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts-examples/commit/1dfc0aa2
Tree: http://git-wip-us.apache.org/repos/asf/struts-examples/tree/1dfc0aa2
Diff: http://git-wip-us.apache.org/repos/asf/struts-examples/diff/1dfc0aa2
Branch: refs/heads/master
Commit: 1dfc0aa2081e5ec5a28cfea513e66c728df2fdcd
Parents: 81b2df4
Author: Lukasz Lenart <lu...@gmail.com>
Authored: Thu Jul 14 11:49:12 2016 +0200
Committer: Lukasz Lenart <lu...@gmail.com>
Committed: Thu Jul 14 11:49:12 2016 +0200
----------------------------------------------------------------------
pom.xml | 5 +-
portlet/README.txt | 22 ++
portlet/pom.xml | 218 +++++++++++
portlet/src/main/etc/exo/web.xml | 63 +++
.../main/etc/gridsphere/README-gridsphere.txt | 2 +
.../main/etc/gridsphere/gridsphere-portlet.xml | 24 ++
portlet/src/main/etc/gridsphere/group.xml | 10 +
portlet/src/main/etc/gridsphere/layout.xml | 19 +
portlet/src/main/etc/gridsphere/struts-portlet | 0
portlet/src/main/etc/gridsphere/web.xml | 63 +++
.../src/main/etc/jbossportal2.0/jboss-app.xml | 3 +
.../main/etc/jbossportal2.0/jboss-portlet.xml | 12 +
.../src/main/etc/jbossportal2.0/jboss-web.xml | 3 +
.../etc/jbossportal2.0/portlet-instances.xml | 11 +
.../etc/jbossportal2.0/struts-portlet-pages.xml | 18 +
.../src/main/etc/jbossportal2.2/jboss-app.xml | 3 +
.../main/etc/jbossportal2.2/jboss-portlet.xml | 12 +
.../src/main/etc/jbossportal2.2/jboss-web.xml | 3 +
.../jbossportal2.2/struts-portlet-object.xml | 25 ++
.../src/main/etc/jetspeed2/README-jetspeed2.txt | 1 +
.../src/main/etc/jetspeed2/struts-portlet.psml | 20 +
portlet/src/main/etc/liferay3.6.1/web.xml | 75 ++++
.../struts2/portlet/example/ExampleAction.java | 39 ++
.../struts2/portlet/example/FormExample.java | 50 +++
.../portlet/example/FormExampleModelDriven.java | 37 ++
.../example/FormExampleWithValidation.java | 47 +++
.../portlet/example/FormResultAction.java | 49 +++
.../struts2/portlet/example/FormTestAction.java | 36 ++
.../portlet/example/SavePrefsAction.java | 62 +++
.../portlet/example/eventing/ProcessAction.java | 61 +++
.../portlet/example/eventing/PublishAction.java | 52 +++
.../example/fileupload/FileUploadAction.java | 81 ++++
.../struts2/portlet/example/model/Name.java | 18 +
.../portlet/example/spring/SpringAction.java | 58 +++
.../portlet/example/spring/ThingManager.java | 38 ++
portlet/src/main/resources/LICENSE.txt | 174 +++++++++
portlet/src/main/resources/NOTICE.txt | 5 +
portlet/src/main/resources/log4j2.xml | 15 +
.../FormExample-formExamplePrg-validation.xml | 13 +
...processTilesFreemarkerExample-validation.xml | 13 +
...mple-processValidationExample-validation.xml | 13 +
.../pluto-portal-driver-services-config.xml | 155 ++++++++
portlet/src/main/resources/struts-edit.xml | 48 +++
portlet/src/main/resources/struts-eventing.xml | 21 +
portlet/src/main/resources/struts-help.xml | 14 +
portlet/src/main/resources/struts-tiles.xml | 27 ++
portlet/src/main/resources/struts-view.xml | 130 +++++++
portlet/src/main/resources/struts.xml | 12 +
.../template/xhtml/components/checkbox.vm | 12 +
.../template/xhtml/components/datefield.vm | 8 +
.../template/xhtml/components/mytextfield.vm | 15 +
portlet/src/main/resources/validators.xml | 18 +
portlet/src/main/resources/velocity.properties | 1 +
.../main/webapp/WEB-INF/applicationContext.xml | 22 ++
.../main/webapp/WEB-INF/edit/defaultEdit.jsp | 5 +
.../main/webapp/WEB-INF/edit/formExample.jsp | 5 +
.../webapp/WEB-INF/edit/formExampleInput.jsp | 8 +
portlet/src/main/webapp/WEB-INF/edit/index.jsp | 11 +
.../main/webapp/WEB-INF/edit/namespaceTest.jsp | 4 +
.../src/main/webapp/WEB-INF/edit/prefsForm.jsp | 6 +
.../src/main/webapp/WEB-INF/edit/prefsSaved.jsp | 5 +
portlet/src/main/webapp/WEB-INF/edit/test.jsp | 4 +
.../src/main/webapp/WEB-INF/eventing/index.jsp | 11 +
.../main/webapp/WEB-INF/eventing/process.jsp | 12 +
.../main/webapp/WEB-INF/help/defaultHelp.jsp | 1 +
portlet/src/main/webapp/WEB-INF/help/index.jsp | 1 +
.../webapp/WEB-INF/jetty-pluto-web-default.xml | 384 +++++++++++++++++++
portlet/src/main/webapp/WEB-INF/portlet.xml | 214 +++++++++++
portlet/src/main/webapp/WEB-INF/readme.txt | 10 +
portlet/src/main/webapp/WEB-INF/tiles.xml | 46 +++
.../src/main/webapp/WEB-INF/view/fileUpload.jsp | 13 +
.../webapp/WEB-INF/view/fileUploadSuccess.jsp | 14 +
.../main/webapp/WEB-INF/view/formExample.jsp | 5 +
.../webapp/WEB-INF/view/formExampleInput.jsp | 8 +
.../view/formExampleInputModelDriven.jsp | 8 +
.../webapp/WEB-INF/view/formExampleInputPrg.jsp | 8 +
.../WEB-INF/view/formExampleInputValidation.jsp | 8 +
.../formExampleSubmitToSelfWithValidation.jsp | 6 +
.../webapp/WEB-INF/view/freeMarkerExample.ftl | 3 +
.../WEB-INF/view/freeMarkerExampleInput.ftl | 5 +
.../src/main/webapp/WEB-INF/view/helloWorld.vm | 4 +
portlet/src/main/webapp/WEB-INF/view/index.jsp | 18 +
.../main/webapp/WEB-INF/view/notImplemented.jsp | 1 +
.../main/webapp/WEB-INF/view/springExample.jsp | 16 +
.../main/webapp/WEB-INF/view/tokenExample.jsp | 5 +
.../webapp/WEB-INF/view/tokenExampleInput.jsp | 20 +
portlet/src/main/webapp/WEB-INF/web.xml | 31 ++
portlet/src/main/webapp/styles/styles.css | 7 +
portlet/src/main/webapp/tiles/footer.ftl | 5 +
portlet/src/main/webapp/tiles/footer.jsp | 6 +
portlet/src/main/webapp/tiles/formExample.jsp | 5 +
.../webapp/tiles/formExampleInputValidation.jsp | 8 +
portlet/src/main/webapp/tiles/header.jsp | 2 +
portlet/src/main/webapp/tiles/index.jsp | 13 +
portlet/src/main/webapp/tiles/layout.jsp | 13 +
portlet/src/test/java/JettyPlutoLauncher.java | 19 +
.../struts2/portlet/test/BasePortletTest.java | 97 +++++
.../portlet/test/Struts2PortletTest.java | 87 +++++
98 files changed, 3116 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 8d03f4d..fd3ce41 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.struts</groupId>
<artifactId>struts-examples</artifactId>
@@ -61,8 +60,10 @@
<module>helloworld</module>
<module>http-session</module>
<module>interceptors</module>
+ <module>json</module>
<module>mailreader</module>
<module>message-resource</module>
+ <module>portlet</module>
<module>preparable-interface</module>
<module>restful2actionmapper</module>
<module>rest-angular</module>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/README.txt
----------------------------------------------------------------------
diff --git a/portlet/README.txt b/portlet/README.txt
new file mode 100644
index 0000000..ce8a425
--- /dev/null
+++ b/portlet/README.txt
@@ -0,0 +1,22 @@
+README.txt - portlet
+
+This is a simple example of using the portlet API with Struts applications.
+
+For more on getting started with Struts, see
+
+* http://cwiki.apache.org/WW/home.html
+
+WARNING - Additional configuration required for deployment
+
+Due to difference in portlet container implementations, the portlet
+WAR is not ready-to-run. Extract the portlet WAR, and then copy the
+contents of apps/portlet/src/main/etc/<your_portal_server>/ into the
+WAR's WEB-INF directory.
+
+I18N:
+=====
+Please note that this project was created with the assumption that it will be run
+in an environment where the default locale is set to English. This means that
+the default messages defined in package.properties are in English. If the default
+locale for your server is different, then rename package.properties to package_en.properties
+and create a new package.properties with proper values for your default locale.
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/pom.xml
----------------------------------------------------------------------
diff --git a/portlet/pom.xml b/portlet/pom.xml
new file mode 100644
index 0000000..2d8025f
--- /dev/null
+++ b/portlet/pom.xml
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * $Id$
+ *
+ * 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.
+ */
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-apps</artifactId>
+ <version>2.5.3-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>struts2-portlet</artifactId>
+ <packaging>war</packaging>
+ <name>Struts 2 Portlet Webapp</name>
+
+ <profiles>
+ <profile>
+ <id>pluto</id>
+ <build>
+ <plugins>
+ <!-- configure maven-war-plugin to use updated web.xml -->
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
+ </configuration>
+ </plugin>
+ <!-- bind 'pluto:assemble' goal to 'process-resources' lifecycle -->
+ <plugin>
+ <groupId>org.apache.pluto</groupId>
+ <artifactId>maven-pluto-plugin</artifactId>
+ <version>1.1.7</version>
+ <executions>
+ <execution>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>assemble</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.26</version>
+ <configuration>
+ <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
+ <webDefaultXml>src/main/webapp/WEB-INF/jetty-pluto-web-default.xml</webDefaultXml>
+ <systemProperties>
+ <systemProperty>
+ <name>org.apache.pluto.embedded.portletIds</name>
+ <value>StrutsPortlet</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>com.bekk.boss</groupId>
+ <artifactId>maven-jetty-pluto-embedded</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-spring-plugin</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-portlet-plugin</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-dwr-plugin</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-portlet-tiles-plugin</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity-tools</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ </dependency>
+
+ <!-- Logging -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>net.sourceforge.jwebunit</groupId>
+ <artifactId>jwebunit-htmlunit-plugin</artifactId>
+ <version>3.3</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>com.bekk.boss</groupId>
+ <artifactId>maven-jetty-pluto-embedded</artifactId>
+ <version>1.0.1</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jsp-2.1</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-lang3</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>rat-maven-plugin</artifactId>
+ <version>1.0-alpha-2</version>
+ <configuration>
+ <includes>
+ <include>pom.xml</include>
+ <include>src/**</include>
+ </includes>
+ <excludes>
+ <exclude>src/main/etc/gridsphere/README-gridsphere.txt</exclude>
+ <exclude>src/main/etc/gridsphere/struts-portlet</exclude>
+ <exclude>src/main/etc/jetspeed2/README-jetspeed2.txt</exclude>
+ <exclude>src/main/etc/jetspeed2/struts-portlet.psml</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+</project>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/exo/web.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/exo/web.xml b/portlet/src/main/etc/exo/web.xml
new file mode 100644
index 0000000..a6357e9
--- /dev/null
+++ b/portlet/src/main/etc/exo/web.xml
@@ -0,0 +1,63 @@
+<?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>
+ <display-name>struts-portlet</display-name>
+ <!-- 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>
+ <filter>
+ <filter-name>action2</filter-name>
+ <filter-class>
+ org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
+ </filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>action2</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <listener>
+ <listener-class>
+ org.springframework.web.context.ContextLoaderListener
+ </listener-class>
+ </listener>
+ <listener>
+ <listener-class>
+ org.apache.struts2.portlet.context.ServletContextHolderListener
+ </listener-class>
+ </listener>
+ <listener>
+ <listener-class>
+ org.exoplatform.services.portletcontainer.impl.servlet.PortletApplicationListener
+ </listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>preparator</servlet-name>
+ <servlet-class>
+ org.apache.struts2.portlet.context.PreparatorServlet
+ </servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>dwr</servlet-name>
+ <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>PortletWrapper</servlet-name>
+ <servlet-class>
+ org.exoplatform.services.portletcontainer.impl.servlet.ServletWrapper
+ </servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>dwr</servlet-name>
+ <url-pattern>/dwr/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>PortletWrapper</servlet-name>
+ <url-pattern>/PortletWrapper</url-pattern>
+ </servlet-mapping>
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/gridsphere/README-gridsphere.txt
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/gridsphere/README-gridsphere.txt b/portlet/src/main/etc/gridsphere/README-gridsphere.txt
new file mode 100644
index 0000000..e502e06
--- /dev/null
+++ b/portlet/src/main/etc/gridsphere/README-gridsphere.txt
@@ -0,0 +1,2 @@
+Put the empty 'struts-portlet' file in the $CATALINA_HOME/webapps/gridsphere/WEB-INF/CustomPortal/portlets
+folder of your Gridsphere installation. You will need to add the gridsphere-ui-tags-2.1.2.jar to your project.
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/gridsphere/gridsphere-portlet.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/gridsphere/gridsphere-portlet.xml b/portlet/src/main/etc/gridsphere/gridsphere-portlet.xml
new file mode 100644
index 0000000..ed15d11
--- /dev/null
+++ b/portlet/src/main/etc/gridsphere/gridsphere-portlet.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-app-collection>
+
+<portlet-app-def>
+
+<portlet-app id="org.gridlab.gridsphere.provider.portlet.jsr.PortletServlet">
+ <portlet-name>JSR Portlet Servlet</portlet-name>
+ <servlet-name>PortletServlet</servlet-name>
+</portlet-app>
+
+<concrete-portlet-app id="org.gridlab.gridsphere.provider.portlet.jsr.PortletServlet.1">
+ <concrete-portlet>
+ <portlet-name>Portlet Servlet</portlet-name>
+ <default-locale>en</default-locale>
+ <language locale="en">
+ <title>Portlet Servlet</title>
+ <title-short>Portlet Servlet</title-short>
+ <description>A JSR Portlet Loader</description>
+ <keywords>portlet servlet</keywords>
+ </language>
+ </concrete-portlet>
+</concrete-portlet-app>
+</portlet-app-def>
+</portlet-app-collection>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/gridsphere/group.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/gridsphere/group.xml b/portlet/src/main/etc/gridsphere/group.xml
new file mode 100644
index 0000000..d04e4e7
--- /dev/null
+++ b/portlet/src/main/etc/gridsphere/group.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<portlet-group>
+ <group-name>StrutsPortlet</group-name>
+ <group-description>StrutsPortlet Example Application</group-description>
+ <group-visibility>PUBLIC</group-visibility>
+ <portlet-role-info>
+ <portlet-class>struts-portlet#StrutsPortlet</portlet-class>
+ <required-role>USER</required-role>
+ </portlet-role-info>
+</portlet-group>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/gridsphere/layout.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/gridsphere/layout.xml b/portlet/src/main/etc/gridsphere/layout.xml
new file mode 100644
index 0000000..14a160b
--- /dev/null
+++ b/portlet/src/main/etc/gridsphere/layout.xml
@@ -0,0 +1,19 @@
+<portlet-tabbed-pane>
+ <portlet-tab label="StrutsPortlet">
+ <title lang="en">StrutsPortlet Example</title>
+ <portlet-tabbed-pane style="sub-menu">
+ <portlet-tab label="strutsportlettab">
+ <title lang="en">StrutsPortlet Example Application</title>
+ <table-layout>
+ <row-layout>
+ <column-layout>
+ <portlet-frame label="strutsportlet">
+ <portlet-class>struts-portlet#StrutsPortlet</portlet-class>
+ </portlet-frame>
+ </column-layout>
+ </row-layout>
+ </table-layout>
+ </portlet-tab>
+ </portlet-tabbed-pane>
+ </portlet-tab>
+</portlet-tabbed-pane>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/gridsphere/struts-portlet
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/gridsphere/struts-portlet b/portlet/src/main/etc/gridsphere/struts-portlet
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/gridsphere/web.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/gridsphere/web.xml b/portlet/src/main/etc/gridsphere/web.xml
new file mode 100644
index 0000000..0653b25
--- /dev/null
+++ b/portlet/src/main/etc/gridsphere/web.xml
@@ -0,0 +1,63 @@
+<?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>
+ <display-name>struts-portlet</display-name>
+ <!-- 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>
+ <filter>
+ <filter-name>action2</filter-name>
+ <filter-class>
+ org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
+ </filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>action2</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <listener>
+ <listener-class>
+ org.springframework.web.context.ContextLoaderListener
+ </listener-class>
+ </listener>
+ <listener>
+ <listener-class>
+ org.apache.struts2.portlet.context.ServletContextHolderListener
+ </listener-class>
+ </listener>
+ <listener>
+ <listener-class>
+ org.gridlab.gridsphere.provider.portlet.jsr.PortletServlet
+ </listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>preparator</servlet-name>
+ <servlet-class>
+ org.apache.struts2.portlet.context.PreparatorServlet
+ </servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>dwr</servlet-name>
+ <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>PortletServlet</servlet-name>
+ <servlet-class>
+ org.gridlab.gridsphere.provider.portlet.jsr.PortletServlet
+ </servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>dwr</servlet-name>
+ <url-pattern>/dwr/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>PortletServlet</servlet-name>
+ <url-pattern>/jsr/struts-portlet</url-pattern>
+ </servlet-mapping>
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/jbossportal2.0/jboss-app.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/jbossportal2.0/jboss-app.xml b/portlet/src/main/etc/jbossportal2.0/jboss-app.xml
new file mode 100644
index 0000000..02e09d5
--- /dev/null
+++ b/portlet/src/main/etc/jbossportal2.0/jboss-app.xml
@@ -0,0 +1,3 @@
+<jboss-app>
+ <app-name>struts-portlet</app-name>
+</jboss-app>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/jbossportal2.0/jboss-portlet.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/jbossportal2.0/jboss-portlet.xml b/portlet/src/main/etc/jbossportal2.0/jboss-portlet.xml
new file mode 100644
index 0000000..663eaf3
--- /dev/null
+++ b/portlet/src/main/etc/jbossportal2.0/jboss-portlet.xml
@@ -0,0 +1,12 @@
+<portlet-app>
+ <portlet>
+ <portlet-name>StrutsPortlet</portlet-name>
+ <security>
+ </security>
+ </portlet>
+ <portlet>
+ <portlet-name>StrutsPortlet2</portlet-name>
+ <security>
+ </security>
+ </portlet>
+</portlet-app>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/jbossportal2.0/jboss-web.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/jbossportal2.0/jboss-web.xml b/portlet/src/main/etc/jbossportal2.0/jboss-web.xml
new file mode 100644
index 0000000..9d9c645
--- /dev/null
+++ b/portlet/src/main/etc/jbossportal2.0/jboss-web.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<jboss-web>
+</jboss-web>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/jbossportal2.0/portlet-instances.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/jbossportal2.0/portlet-instances.xml b/portlet/src/main/etc/jbossportal2.0/portlet-instances.xml
new file mode 100644
index 0000000..c22073d
--- /dev/null
+++ b/portlet/src/main/etc/jbossportal2.0/portlet-instances.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" standalone="yes"?>
+<instances>
+ <instance>
+ <instance-name>StrutsPortletInstance</instance-name>
+ <component-ref>StrutsPortlet</component-ref>
+ </instance>
+ <instance>
+ <instance-name>StrutsPortlet2Instance</instance-name>
+ <component-ref>StrutsPortlet2</component-ref>
+ </instance>
+</instances>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/jbossportal2.0/struts-portlet-pages.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/jbossportal2.0/struts-portlet-pages.xml b/portlet/src/main/etc/jbossportal2.0/struts-portlet-pages.xml
new file mode 100644
index 0000000..255c453
--- /dev/null
+++ b/portlet/src/main/etc/jbossportal2.0/struts-portlet-pages.xml
@@ -0,0 +1,18 @@
+<pages>
+ <portal-name>default</portal-name>
+ <page>
+ <page-name>struts-portlet</page-name>
+ <window>
+ <window-name>StrutsPortletWindow</window-name>
+ <instance-ref>struts-portlet.StrutsPortlet.StrutsPortletInstance</instance-ref>
+ <region>left</region>
+ <height>0</height>
+ </window>
+ <window>
+ <window-name>StrutsPortletWindow2</window-name>
+ <instance-ref>struts-portlet.StrutsPortlet2.StrutsPortlet2Instance</instance-ref>
+ <region>right</region>
+ <height>0</height>
+ </window>
+ </page>
+</pages>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/jbossportal2.2/jboss-app.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/jbossportal2.2/jboss-app.xml b/portlet/src/main/etc/jbossportal2.2/jboss-app.xml
new file mode 100644
index 0000000..02e09d5
--- /dev/null
+++ b/portlet/src/main/etc/jbossportal2.2/jboss-app.xml
@@ -0,0 +1,3 @@
+<jboss-app>
+ <app-name>struts-portlet</app-name>
+</jboss-app>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/jbossportal2.2/jboss-portlet.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/jbossportal2.2/jboss-portlet.xml b/portlet/src/main/etc/jbossportal2.2/jboss-portlet.xml
new file mode 100644
index 0000000..663eaf3
--- /dev/null
+++ b/portlet/src/main/etc/jbossportal2.2/jboss-portlet.xml
@@ -0,0 +1,12 @@
+<portlet-app>
+ <portlet>
+ <portlet-name>StrutsPortlet</portlet-name>
+ <security>
+ </security>
+ </portlet>
+ <portlet>
+ <portlet-name>StrutsPortlet2</portlet-name>
+ <security>
+ </security>
+ </portlet>
+</portlet-app>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/jbossportal2.2/jboss-web.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/jbossportal2.2/jboss-web.xml b/portlet/src/main/etc/jbossportal2.2/jboss-web.xml
new file mode 100644
index 0000000..9d9c645
--- /dev/null
+++ b/portlet/src/main/etc/jbossportal2.2/jboss-web.xml
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<jboss-web>
+</jboss-web>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/jbossportal2.2/struts-portlet-object.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/jbossportal2.2/struts-portlet-object.xml b/portlet/src/main/etc/jbossportal2.2/struts-portlet-object.xml
new file mode 100644
index 0000000..2e062ad
--- /dev/null
+++ b/portlet/src/main/etc/jbossportal2.2/struts-portlet-object.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deployments>
+ <deployment>
+ <if-exists>overwrite</if-exists>
+ <parent-ref>default</parent-ref>
+ <properties />
+ <page>
+ <page-name>StrutsPortlet Example</page-name>
+ <properties />
+ <window>
+ <window-name>StrutsWindow</window-name>
+ <instance-ref>StrutsPortletInstance</instance-ref>
+ <region>center</region>
+ <height>0</height>
+ </window>
+ </page>
+ </deployment>
+ <deployment>
+ <if-exists>overwrite</if-exists>
+ <instance>
+ <instance-name>StrutsPortletInstance</instance-name>
+ <component-ref>struts-portlet.StrutsPortlet</component-ref>
+ </instance>
+ </deployment>
+</deployments>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/jetspeed2/README-jetspeed2.txt
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/jetspeed2/README-jetspeed2.txt b/portlet/src/main/etc/jetspeed2/README-jetspeed2.txt
new file mode 100644
index 0000000..acde566
--- /dev/null
+++ b/portlet/src/main/etc/jetspeed2/README-jetspeed2.txt
@@ -0,0 +1 @@
+Copy the struts-portlet.psml file to the JETSPEED2_INSTALL_DIR/webapps/jetspeed/WEB-INF/pages directory.
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/jetspeed2/struts-portlet.psml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/jetspeed2/struts-portlet.psml b/portlet/src/main/etc/jetspeed2/struts-portlet.psml
new file mode 100644
index 0000000..bf865ba
--- /dev/null
+++ b/portlet/src/main/etc/jetspeed2/struts-portlet.psml
@@ -0,0 +1,20 @@
+<page>
+ <defaults
+ skin="orange"
+ layout-decorator="tigris"
+ portlet-decorator="tigris"
+ />
+ <title>Struts Portlet Example Application</title>
+ <metadata name="title" xml:lang="en">Struts Portlet Example Application</metadata>
+
+ <fragment id="simplest" type="layout" name="jetspeed-layouts::VelocityTwoColumns">
+ <fragment id="struts-portlet-1" type="portlet" name="struts-portlet::StrutsPortlet">
+ <property layout="TwoColumns" name="row" value="0" />
+ <property layout="TwoColumns" name="column" value="0" />
+ </fragment>
+ </fragment>
+
+ <security-constraints>
+ <security-constraints-ref>public-view</security-constraints-ref>
+ </security-constraints>
+</page>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/etc/liferay3.6.1/web.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/etc/liferay3.6.1/web.xml b/portlet/src/main/etc/liferay3.6.1/web.xml
new file mode 100644
index 0000000..73c769f
--- /dev/null
+++ b/portlet/src/main/etc/liferay3.6.1/web.xml
@@ -0,0 +1,75 @@
+<?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>
+ <display-name>struts-portlet</display-name>
+ <context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>/WEB-INF/applicationContext*.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>company_id</param-name>
+ <param-value>struts.apache.org</param-value>
+ </context-param>
+ <filter>
+ <filter-name>action2</filter-name>
+ <filter-class>
+ org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
+ </filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>action2</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ <listener>
+ <listener-class>
+ com.liferay.portal.servlet.PortletContextListener
+ </listener-class>
+ </listener>
+ <listener>
+ <listener-class>
+ org.springframework.web.context.ContextLoaderListener
+ </listener-class>
+ </listener>
+ <listener>
+ <listener-class>
+ org.apache.struts2.portlet.context.ServletContextHolderListener
+ </listener-class>
+ </listener>
+
+
+ <servlet>
+ <servlet-name>StrutsPortlet</servlet-name>
+ <servlet-class>
+ com.liferay.portal.servlet.PortletServlet
+ </servlet-class>
+ <init-param>
+ <param-name>portlet-class</param-name>
+ <param-value>
+ org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher
+ </param-value>
+ </init-param>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>preparator</servlet-name>
+ <servlet-class>
+ org.apache.struts2.portlet.context.PreparatorServlet
+ </servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>dwr</servlet-name>
+ <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>dwr</servlet-name>
+ <url-pattern>/dwr/*</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>StrutsPortlet</servlet-name>
+ <url-pattern>/StrutsPortlet/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/ExampleAction.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/ExampleAction.java b/portlet/src/main/java/org/apache/struts2/portlet/example/ExampleAction.java
new file mode 100644
index 0000000..d3e0741
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/ExampleAction.java
@@ -0,0 +1,39 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example;
+
+import java.util.Map;
+
+import com.opensymphony.xwork2.ActionContext;
+import com.opensymphony.xwork2.ActionSupport;
+
+public class ExampleAction extends ActionSupport {
+
+ private String name = "PortletWork Example";
+
+ public String getName() {
+ return name;
+ }
+
+ public Map getRenderParameters() {
+ return ActionContext.getContext().getParameters();
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/FormExample.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/FormExample.java b/portlet/src/main/java/org/apache/struts2/portlet/example/FormExample.java
new file mode 100644
index 0000000..98b8517
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/FormExample.java
@@ -0,0 +1,50 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example;
+
+import org.apache.struts2.dispatcher.DefaultActionSupport;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ */
+public class FormExample extends DefaultActionSupport {
+
+ String firstName = null;
+ String lastName = null;
+
+ public String getFirstName() {
+ return firstName;
+ }
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+ public String getLastName() {
+ return lastName;
+ }
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String displayResult() {
+ return "displayResult";
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleModelDriven.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleModelDriven.java b/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleModelDriven.java
new file mode 100644
index 0000000..0ad526e
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleModelDriven.java
@@ -0,0 +1,37 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example;
+
+import org.apache.struts2.portlet.example.model.Name;
+
+import com.opensymphony.xwork2.ActionSupport;
+import com.opensymphony.xwork2.ModelDriven;
+
+/**
+ */
+public class FormExampleModelDriven extends ActionSupport implements ModelDriven<Name> {
+
+ private Name name = new Name();
+
+ public Name getModel() {
+ return name;
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleWithValidation.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleWithValidation.java b/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleWithValidation.java
new file mode 100644
index 0000000..a26609c
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/FormExampleWithValidation.java
@@ -0,0 +1,47 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ */
+public class FormExampleWithValidation extends ActionSupport {
+ private String firstName = null;
+ private String lastName = null;
+
+ public String input() {
+ return SUCCESS;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+ public String getLastName() {
+ return lastName;
+ }
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/FormResultAction.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/FormResultAction.java b/portlet/src/main/java/org/apache/struts2/portlet/example/FormResultAction.java
new file mode 100644
index 0000000..6e9aeae
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/FormResultAction.java
@@ -0,0 +1,49 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example;
+
+import java.util.Collection;
+import java.util.Map;
+
+import javax.portlet.RenderRequest;
+
+import org.apache.struts2.portlet.context.PortletActionContext;
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ */
+public class FormResultAction extends ActionSupport {
+
+ private String result = null;
+
+ public String getResult() {
+ return result;
+ }
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+ public Collection getRenderParams() {
+ RenderRequest req = PortletActionContext.getRenderRequest();
+ Map params = req.getParameterMap();
+ return params.entrySet();
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/FormTestAction.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/FormTestAction.java b/portlet/src/main/java/org/apache/struts2/portlet/example/FormTestAction.java
new file mode 100644
index 0000000..ebbe102
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/FormTestAction.java
@@ -0,0 +1,36 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ */
+public class FormTestAction extends ActionSupport {
+
+ private String name = null;
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/SavePrefsAction.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/SavePrefsAction.java b/portlet/src/main/java/org/apache/struts2/portlet/example/SavePrefsAction.java
new file mode 100644
index 0000000..1998e37
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/SavePrefsAction.java
@@ -0,0 +1,62 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.PortletPreferences;
+
+import org.apache.struts2.portlet.context.PortletActionContext;
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ */
+public class SavePrefsAction extends ActionSupport {
+ private String preferenceOne = null;
+ private String preferenceTwo = null;
+ public String getPreferenceOne() {
+ return preferenceOne;
+ }
+ public void setPreferenceOne(String preferenceOne) {
+ this.preferenceOne = preferenceOne;
+ }
+ public String getPreferenceTwo() {
+ return preferenceTwo;
+ }
+ public void setPreferenceTwo(String preferenceTwo) {
+ this.preferenceTwo = preferenceTwo;
+ }
+
+ public String execute() throws Exception {
+ ActionRequest req = PortletActionContext.getActionRequest();
+ PortletPreferences prefs = req.getPreferences();
+ prefs.setValue("preferenceOne", preferenceOne);
+ prefs.setValue("preferenceTwo", preferenceTwo);
+ prefs.store();
+ return SUCCESS;
+ }
+
+ public String showForm() throws Exception {
+ PortletPreferences prefs = PortletActionContext.getRequest().getPreferences();
+ preferenceOne = prefs.getValue("preferenceOne", "not set");
+ preferenceTwo = prefs.getValue("preferenceTwo", "not set");
+ return SUCCESS;
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/eventing/ProcessAction.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/eventing/ProcessAction.java b/portlet/src/main/java/org/apache/struts2/portlet/example/eventing/ProcessAction.java
new file mode 100644
index 0000000..81efcef
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/eventing/ProcessAction.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example.eventing;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.portlet.interceptor.PortletRequestAware;
+import org.apache.struts2.portlet.interceptor.PortletResponseAware;
+
+import javax.portlet.EventRequest;
+import javax.portlet.EventResponse;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
+
+public class ProcessAction extends ActionSupport implements PortletRequestAware, PortletResponseAware {
+
+ private PortletRequest request;
+ private PortletResponse response;
+ private String name;
+
+ public String execute() throws Exception {
+
+ if (request instanceof EventRequest) {
+ EventRequest req = (EventRequest) request;
+ EventResponse res = (EventResponse) response;
+ res.setRenderParameter("eventName", (String) req.getEvent().getValue());
+ return "forward";
+ } else {
+ name = request.getParameter("eventName");
+ }
+
+ return SUCCESS;
+ }
+
+ public void setPortletRequest(PortletRequest request) {
+ this.request = request;
+ }
+
+ public void setPortletResponse(PortletResponse response) {
+ this.response = response;
+ }
+
+ public String getName() {
+ return this.name;
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/eventing/PublishAction.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/eventing/PublishAction.java b/portlet/src/main/java/org/apache/struts2/portlet/example/eventing/PublishAction.java
new file mode 100644
index 0000000..439b4d4
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/eventing/PublishAction.java
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example.eventing;
+
+import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.portlet.interceptor.PortletResponseAware;
+
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletResponse;
+import javax.xml.namespace.QName;
+
+public class PublishAction extends ActionSupport implements PortletResponseAware {
+
+ private PortletResponse response;
+ private String name;
+
+ public String execute() throws Exception {
+
+ if (name != null) {
+ ((ActionResponse) response).setEvent(new QName("http://org.apache.struts2.portlets/events", "name"), name);
+
+ addActionMessage("Publishing Event with Parameter name : " + name);
+ }
+
+ return SUCCESS;
+ }
+
+ public void setPortletResponse(PortletResponse response) {
+ this.response = response;
+
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/fileupload/FileUploadAction.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/fileupload/FileUploadAction.java b/portlet/src/main/java/org/apache/struts2/portlet/example/fileupload/FileUploadAction.java
new file mode 100644
index 0000000..398078c
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/fileupload/FileUploadAction.java
@@ -0,0 +1,81 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example.fileupload;
+
+import java.io.File;
+
+import org.apache.struts2.dispatcher.DefaultActionSupport;
+
+/**
+ * File Upload example's action. <code>FileUploadAction</code>
+ *
+ */
+public class FileUploadAction extends DefaultActionSupport {
+
+ private static final long serialVersionUID = 5156288255337069381L;
+
+ private String contentType;
+ private File upload;
+ private String fileName;
+ private String caption;
+
+ // since we are using <s:file name="upload" .../> the file name will be
+ // obtained through getter/setter of <file-tag-name>FileName
+ public String getUploadFileName() {
+ return fileName;
+ }
+ public void setUploadFileName(String fileName) {
+ this.fileName = fileName;
+ }
+
+
+ // since we are using <s:file name="upload" ... /> the content type will be
+ // obtained through getter/setter of <file-tag-name>ContentType
+ public String getUploadContentType() {
+ return contentType;
+ }
+ public void setUploadContentType(String contentType) {
+ this.contentType = contentType;
+ }
+
+
+ // since we are using <s:file name="upload" ... /> the File itself will be
+ // obtained through getter/setter of <file-tag-name>
+ public File getUpload() {
+ return upload;
+ }
+ public void setUpload(File upload) {
+ this.upload = upload;
+ }
+
+
+ public String getCaption() {
+ return caption;
+ }
+ public void setCaption(String caption) {
+ this.caption = caption;
+ }
+
+ public String upload() throws Exception {
+ return SUCCESS;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/model/Name.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/model/Name.java b/portlet/src/main/java/org/apache/struts2/portlet/example/model/Name.java
new file mode 100644
index 0000000..21856bb
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/model/Name.java
@@ -0,0 +1,18 @@
+package org.apache.struts2.portlet.example.model;
+
+public class Name {
+ private String firstName;
+ private String lastName;
+ public String getFirstName() {
+ return firstName;
+ }
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+ public String getLastName() {
+ return lastName;
+ }
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/spring/SpringAction.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/spring/SpringAction.java b/portlet/src/main/java/org/apache/struts2/portlet/example/spring/SpringAction.java
new file mode 100644
index 0000000..6db753c
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/spring/SpringAction.java
@@ -0,0 +1,58 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example.spring;
+
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ */
+public class SpringAction extends ActionSupport {
+
+ private ThingManager thingManager = null;
+ private String thing = null;
+
+ public void setThingManager(ThingManager thingManager) {
+ this.thingManager = thingManager;
+ }
+
+ public List getThings() {
+ return thingManager.getThings();
+ }
+
+ public String getThing() {
+ return thing;
+ }
+
+ public void setThing(String thing) {
+ this.thing = thing;
+ }
+
+ public String execute() {
+ if(StringUtils.isNotEmpty(thing)) {
+ thingManager.addThing(thing);
+ }
+ return SUCCESS;
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/java/org/apache/struts2/portlet/example/spring/ThingManager.java
----------------------------------------------------------------------
diff --git a/portlet/src/main/java/org/apache/struts2/portlet/example/spring/ThingManager.java b/portlet/src/main/java/org/apache/struts2/portlet/example/spring/ThingManager.java
new file mode 100644
index 0000000..ba117a5
--- /dev/null
+++ b/portlet/src/main/java/org/apache/struts2/portlet/example/spring/ThingManager.java
@@ -0,0 +1,38 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.portlet.example.spring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ */
+public class ThingManager {
+ private List things = new ArrayList();
+
+ public void addThing(String thing) {
+ things.add(thing);
+ }
+
+ public List getThings() {
+ return things;
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/LICENSE.txt
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/LICENSE.txt b/portlet/src/main/resources/LICENSE.txt
new file mode 100644
index 0000000..dd5b3a5
--- /dev/null
+++ b/portlet/src/main/resources/LICENSE.txt
@@ -0,0 +1,174 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/NOTICE.txt
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/NOTICE.txt b/portlet/src/main/resources/NOTICE.txt
new file mode 100644
index 0000000..bfba90c
--- /dev/null
+++ b/portlet/src/main/resources/NOTICE.txt
@@ -0,0 +1,5 @@
+Apache Struts
+Copyright 2000-2011 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/log4j2.xml b/portlet/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..092d5f6
--- /dev/null
+++ b/portlet/src/main/resources/log4j2.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration>
+ <Appenders>
+ <Console name="STDOUT" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Logger name="com.opensymphony.xwork2" level="info"/>
+ <Logger name="org.apache.struts2" level="info"/>
+ <Root level="warn">
+ <AppenderRef ref="STDOUT"/>
+ </Root>
+ </Loggers>
+</Configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-formExamplePrg-validation.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-formExamplePrg-validation.xml b/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-formExamplePrg-validation.xml
new file mode 100644
index 0000000..3151f29
--- /dev/null
+++ b/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-formExamplePrg-validation.xml
@@ -0,0 +1,13 @@
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
+<validators>
+ <field name="firstName">
+ <field-validator type="requiredstring">
+ <message>You must enter a first name</message>
+ </field-validator>
+ </field>
+ <field name="lastName">
+ <field-validator type="requiredstring">
+ <message>You must enter a last name</message>
+ </field-validator>
+ </field>
+</validators>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml b/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml
new file mode 100644
index 0000000..3151f29
--- /dev/null
+++ b/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-processTilesFreemarkerExample-validation.xml
@@ -0,0 +1,13 @@
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
+<validators>
+ <field name="firstName">
+ <field-validator type="requiredstring">
+ <message>You must enter a first name</message>
+ </field-validator>
+ </field>
+ <field name="lastName">
+ <field-validator type="requiredstring">
+ <message>You must enter a last name</message>
+ </field-validator>
+ </field>
+</validators>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-processValidationExample-validation.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-processValidationExample-validation.xml b/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-processValidationExample-validation.xml
new file mode 100644
index 0000000..3151f29
--- /dev/null
+++ b/portlet/src/main/resources/org/apache/struts2/portlet/example/FormExample-processValidationExample-validation.xml
@@ -0,0 +1,13 @@
+<!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.2//EN" "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
+<validators>
+ <field name="firstName">
+ <field-validator type="requiredstring">
+ <message>You must enter a first name</message>
+ </field-validator>
+ </field>
+ <field name="lastName">
+ <field-validator type="requiredstring">
+ <message>You must enter a last name</message>
+ </field-validator>
+ </field>
+</validators>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/pluto-portal-driver-services-config.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/pluto-portal-driver-services-config.xml b/portlet/src/main/resources/pluto-portal-driver-services-config.xml
new file mode 100644
index 0000000..6803d03
--- /dev/null
+++ b/portlet/src/main/resources/pluto-portal-driver-services-config.xml
@@ -0,0 +1,155 @@
+<?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">
+ <!--
+ 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.
+ -->
+ <!--
+
+ ************************************************************
+
+ NOTE:
+
+ The following configuration file contains the spring bean
+ configuration needed to run the pluto-portal in memory
+ mode. Optional services are available which allow
+ persistence to an rdbms, xml files, etc. . . however,
+ we strongly recomend that if you are looking at these
+ advanced features that you consider an enterprise portal
+ such as Apache Jetspeed.
+
+ Service Functions Include:
+ - Preference Persistence
+ - User Attribute Persistence
+ - Portlet Registry
+ - Page Registry
+ ************************************************************
+
+ -->
+
+ <bean id="RequiredContainerServices"
+ name="OptionalContainerServices"
+ class="org.apache.pluto.driver.services.container.ContainerServicesImpl"
+ scope="singleton">
+ <constructor-arg>
+ <ref bean="PortalContext"/>
+ </constructor-arg>
+ <constructor-arg>
+ <ref bean="DriverConfiguration"/>
+ </constructor-arg>
+ </bean>
+
+ <bean id="PortalContext"
+ class="org.apache.pluto.driver.services.container.PortalContextImpl">
+ <constructor-arg>
+ <ref bean="DriverConfiguration"/>
+ </constructor-arg>
+ </bean>
+
+
+ <!-- ================================================ -->
+ <!-- The single top element of the configuration tree -->
+ <!-- ================================================ -->
+ <bean id="DriverConfiguration"
+ class="org.apache.pluto.driver.config.impl.DriverConfigurationImpl">
+
+ <!-- ===== Portal Services ===== -->
+ <constructor-arg>
+ <ref bean="PortalURLParser"/>
+ </constructor-arg>
+ <constructor-arg>
+ <ref bean="PropertyConfigService"/>
+ </constructor-arg>
+ <constructor-arg>
+ <ref bean="RenderConfigService"/>
+ </constructor-arg>
+ <constructor-arg>
+ <ref bean="SupportedModesService"/>
+ </constructor-arg>
+ <constructor-arg>
+ <ref bean="SupportedWindowStatesService"/>
+ </constructor-arg>
+
+ <!-- === Container Services === -->
+ <constructor-arg>
+ <ref bean="PortalCallbackService"/>
+ </constructor-arg>
+
+ <!-- Optional Container Services -->
+ <!--
+ <property name="portletPreferencesService"><ref bean="PortletPreferencesService"/></property>
+ <property name="userAttributeService"><ref bean="UserAttributeService"/></property>
+ -->
+ </bean>
+
+ <!-- ================================================ -->
+ <!-- The single top element of the administration tree -->
+ <!-- ================================================ -->
+ <bean id="AdminConfiguration" class="org.apache.pluto.driver.config.impl.AdminConfigurationImpl">
+ <property name="renderConfigAdminService">
+ <ref bean="RenderConfigService"/>
+ </property>
+ </bean>
+
+
+ <!-- ================================================ -->
+ <!-- Portal Services injected into the Configuration -->
+ <!-- ================================================ -->
+ <bean id="PortalURLParser"
+ class="org.apache.pluto.driver.url.impl.PortalURLParserImpl"
+ factory-method="getParser"
+ scope="singleton">
+ </bean>
+
+ <bean id="PropertyConfigService"
+ class="org.apache.pluto.driver.services.impl.resource.PropertyConfigServiceImpl"
+ scope="singleton">
+ </bean>
+
+ <bean id="RenderConfigService"
+ class="org.apache.pluto.driver.services.impl.resource.RenderConfigServiceImpl"
+ scope="singleton">
+ </bean>
+
+ <bean id="SupportedModesService"
+ class="org.apache.pluto.driver.services.impl.resource.SupportedModesServiceImpl"
+ scope="singleton">
+ <constructor-arg>
+ <ref bean="PropertyConfigService"/>
+ </constructor-arg>
+ </bean>
+
+ <bean id="SupportedWindowStatesService"
+ class="org.apache.pluto.driver.services.impl.resource.SupportedWindowStateServiceImpl"
+ scope="singleton">
+ <constructor-arg>
+ <ref bean="PropertyConfigService"/>
+ </constructor-arg>
+ </bean>
+
+ <!-- ================================================ -->
+ <!-- Container Services injected into Configuration -->
+ <!-- ================================================ -->
+ <bean id="PortalCallbackService"
+ class="org.apache.pluto.driver.services.container.PortalCallbackServiceImpl"
+ scope="singleton">
+ </bean>
+
+</beans>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/1dfc0aa2/portlet/src/main/resources/struts-edit.xml
----------------------------------------------------------------------
diff --git a/portlet/src/main/resources/struts-edit.xml b/portlet/src/main/resources/struts-edit.xml
new file mode 100644
index 0000000..a31691c
--- /dev/null
+++ b/portlet/src/main/resources/struts-edit.xml
@@ -0,0 +1,48 @@
+<?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="edit" extends="struts-portlet-default"
+ namespace="/edit">
+ <action name="index"
+ class="com.opensymphony.xwork2.ActionSupport">
+ <result name="success">/WEB-INF/edit/index.jsp</result>
+ </action>
+ <action name="test"
+ class="com.opensymphony.xwork2.ActionSupport">
+ <result name="success">/WEB-INF/edit/test.jsp</result>
+ </action>
+ <action name="formExampleEdit"
+ class="org.apache.struts2.portlet.example.FormExample" method="input">
+ <result name="input">
+ /WEB-INF/edit/formExampleInput.jsp
+ </result>
+ </action>
+
+ <action name="processFormExampleEdit"
+ class="org.apache.struts2.portlet.example.FormExample">
+ <result name="input">
+ /WEB-INF/edit/formExampleInput.jsp
+ </result>
+ <result name="success">
+ /edit/processFormExampleForward.action?firstName=${firstName}&lastName=${lastName}
+ </result>
+ </action>
+
+ <action name="processFormExampleForward"
+ class="org.apache.struts2.portlet.example.FormExample">
+ <result name="success">
+ /WEB-INF/edit/formExample.jsp
+ </result>
+ </action>
+ </package>
+
+ <package name="editTest" extends="edit" namespace="/edit/dummy/test">
+ <action name="testAction"
+ class="com.opensymphony.xwork2.ActionSupport">
+ <result name="success">/WEB-INF/edit/namespaceTest.jsp</result>
+ </action>
+ </package>
+</struts>
\ No newline at end of file
[6/6] struts-examples git commit: Adds simple JSON example
Posted by lu...@apache.org.
Adds simple JSON example
Project: http://git-wip-us.apache.org/repos/asf/struts-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts-examples/commit/62a6110b
Tree: http://git-wip-us.apache.org/repos/asf/struts-examples/tree/62a6110b
Diff: http://git-wip-us.apache.org/repos/asf/struts-examples/diff/62a6110b
Branch: refs/heads/master
Commit: 62a6110bfd78a135d56c53bf1261d68cc3d8f646
Parents: 1dfc0aa
Author: Lukasz Lenart <lu...@gmail.com>
Authored: Thu Jul 14 11:49:45 2016 +0200
Committer: Lukasz Lenart <lu...@gmail.com>
Committed: Thu Jul 14 11:49:45 2016 +0200
----------------------------------------------------------------------
json/pom.xml | 108 ++++++++++++++++++++
json/src/main/java/org/demo/ConsumeAction.java | 38 +++++++
json/src/main/java/org/demo/MyBean.java | 36 +++++++
json/src/main/java/org/demo/ProduceAction.java | 43 ++++++++
json/src/main/resources/log4j2.xml | 16 +++
json/src/main/resources/struts.xml | 31 ++++++
json/src/main/webapp/WEB-INF/result.jsp | 21 ++++
json/src/main/webapp/WEB-INF/web.xml | 23 +++++
json/src/main/webapp/index.html | 10 ++
9 files changed, 326 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/62a6110b/json/pom.xml
----------------------------------------------------------------------
diff --git a/json/pom.xml b/json/pom.xml
new file mode 100644
index 0000000..fc758c7
--- /dev/null
+++ b/json/pom.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>struts-examples</artifactId>
+ <groupId>org.apache.struts</groupId>
+ <version>1.0.0</version>
+ </parent>
+
+ <groupId>org.demo</groupId>
+ <artifactId>json</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <name>json</name>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-core</artifactId>
+ <version>${struts2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-config-browser-plugin</artifactId>
+ <version>${struts2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.struts</groupId>
+ <artifactId>struts2-json-plugin</artifactId>
+ <version>${struts2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j2.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.5</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>javax.servlet-api</artifactId>
+ <version>3.1.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ <scope>provided</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.3</version>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>8.1.16.v20140903</version>
+ <configuration>
+ <stopKey>CTRL+C</stopKey>
+ <stopPort>8999</stopPort>
+ <systemProperties>
+ <systemProperty>
+ <name>xwork.loggerFactory</name>
+ <value>com.opensymphony.xwork2.util.logging.log4j2.Log4j2LoggerFactory</value>
+ </systemProperty>
+ </systemProperties>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
+ <webAppConfig>
+ <descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
+ </webAppConfig>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/62a6110b/json/src/main/java/org/demo/ConsumeAction.java
----------------------------------------------------------------------
diff --git a/json/src/main/java/org/demo/ConsumeAction.java b/json/src/main/java/org/demo/ConsumeAction.java
new file mode 100644
index 0000000..c142581
--- /dev/null
+++ b/json/src/main/java/org/demo/ConsumeAction.java
@@ -0,0 +1,38 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.demo;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+public class ConsumeAction extends ActionSupport {
+
+ private MyBean bean = new MyBean();
+
+ public String execute() throws Exception {
+ return SUCCESS;
+ }
+
+ public MyBean getBean() {
+ return bean;
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/62a6110b/json/src/main/java/org/demo/MyBean.java
----------------------------------------------------------------------
diff --git a/json/src/main/java/org/demo/MyBean.java b/json/src/main/java/org/demo/MyBean.java
new file mode 100644
index 0000000..17deffb
--- /dev/null
+++ b/json/src/main/java/org/demo/MyBean.java
@@ -0,0 +1,36 @@
+package org.demo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class MyBean {
+
+ private int counter;
+ private List<String> names;
+
+ public MyBean() {
+ counter = 0;
+ names = new ArrayList<String>();
+ }
+
+ public MyBean(int counter, List<String> names) {
+ this.counter = counter;
+ this.names = names;
+ }
+
+ public int getCounter() {
+ return counter;
+ }
+
+ public List<String> getNames() {
+ return names;
+ }
+
+ public void setCounter(int counter) {
+ this.counter = counter;
+ }
+
+ public void setNames(List<String> names) {
+ this.names = names;
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/62a6110b/json/src/main/java/org/demo/ProduceAction.java
----------------------------------------------------------------------
diff --git a/json/src/main/java/org/demo/ProduceAction.java b/json/src/main/java/org/demo/ProduceAction.java
new file mode 100644
index 0000000..35c674b
--- /dev/null
+++ b/json/src/main/java/org/demo/ProduceAction.java
@@ -0,0 +1,43 @@
+/*
+ * $Id$
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.demo;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+import java.util.Arrays;
+
+/**
+ * <code>Set welcome message.</code>
+ */
+public class ProduceAction extends ActionSupport {
+
+ private MyBean bean;
+
+ public String execute() throws Exception {
+ bean = new MyBean(2, Arrays.asList("Lukas", "Antonio"));
+ return SUCCESS;
+ }
+
+ public MyBean getBean() {
+ return bean;
+ }
+}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/62a6110b/json/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/json/src/main/resources/log4j2.xml b/json/src/main/resources/log4j2.xml
new file mode 100644
index 0000000..e3c583b
--- /dev/null
+++ b/json/src/main/resources/log4j2.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Configuration>
+ <Appenders>
+ <Console name="STDOUT" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <Logger name="com.opensymphony.xwork2" level="info"/>
+ <Logger name="org.apache.struts2" level="info"/>
+ <Logger name="org.demo" level="debug"/>
+ <Root level="warn">
+ <AppenderRef ref="STDOUT"/>
+ </Root>
+ </Loggers>
+</Configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/62a6110b/json/src/main/resources/struts.xml
----------------------------------------------------------------------
diff --git a/json/src/main/resources/struts.xml b/json/src/main/resources/struts.xml
new file mode 100644
index 0000000..b82521b
--- /dev/null
+++ b/json/src/main/resources/struts.xml
@@ -0,0 +1,31 @@
+<?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>
+ <constant name="struts.enable.DynamicMethodInvocation" value="false"/>
+ <constant name="struts.devMode" value="true"/>
+
+ <package name="default" namespace="/" extends="json-default">
+
+ <default-action-ref name="produce"/>
+
+ <action name="produce" class="org.demo.ProduceAction">
+ <result type="json">
+ <param name="root">bean</param>
+ </result>
+ </action>
+
+ <action name="consume" class="org.demo.ConsumeAction">
+ <interceptor-ref name="basicStack"/>
+ <interceptor-ref name="json">
+ <param name="root">bean</param>
+ <param name="accept">application/json</param>
+ </interceptor-ref>
+ <result>WEB-INF/result.jsp</result>
+ </action>
+
+ </package>
+
+ <!-- Add addition packages and configuration here. -->
+</struts>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/62a6110b/json/src/main/webapp/WEB-INF/result.jsp
----------------------------------------------------------------------
diff --git a/json/src/main/webapp/WEB-INF/result.jsp b/json/src/main/webapp/WEB-INF/result.jsp
new file mode 100644
index 0000000..de96c61
--- /dev/null
+++ b/json/src/main/webapp/WEB-INF/result.jsp
@@ -0,0 +1,21 @@
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+<head>
+ <title>JSON Result</title>
+</head>
+
+<body>
+<ul>
+ <li>
+ counter: <s:property value="bean.counter"/>
+ </li>
+ <s:iterator value="bean.names" var="name" status="idx">
+ <li>
+ name<s:property value="#idx"/>: <s:property value="#name"/>
+ </li>
+ </s:iterator>
+</ul>
+
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/62a6110b/json/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/json/src/main/webapp/WEB-INF/web.xml b/json/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..8858656
--- /dev/null
+++ b/json/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app id="struts_blank" version="2.4"
+ xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <display-name>Struts Blank</display-name>
+
+ <filter>
+ <filter-name>struts2</filter-name>
+ <filter-class>
+ org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter
+ </filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>struts2</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+</web-app>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/62a6110b/json/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/json/src/main/webapp/index.html b/json/src/main/webapp/index.html
new file mode 100644
index 0000000..dc2bbd0
--- /dev/null
+++ b/json/src/main/webapp/index.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+ <META HTTP-EQUIV="Refresh" CONTENT="0;URL=example/HelloWorld.action">
+</head>
+
+<body>
+<p>Loading ...</p>
+</body>
+</html>
[2/6] struts-examples git commit: Drops jboss-blank as a duplication
of blank
Posted by lu...@apache.org.
Drops jboss-blank as a duplication of blank
Project: http://git-wip-us.apache.org/repos/asf/struts-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/struts-examples/commit/7ce189c0
Tree: http://git-wip-us.apache.org/repos/asf/struts-examples/tree/7ce189c0
Diff: http://git-wip-us.apache.org/repos/asf/struts-examples/diff/7ce189c0
Branch: refs/heads/master
Commit: 7ce189c030433b9208b04dd02982d13770b36b20
Parents: 4a7216c
Author: Lukasz Lenart <lu...@gmail.com>
Authored: Sat Jun 18 09:13:51 2016 +0200
Committer: Lukasz Lenart <lu...@gmail.com>
Committed: Sat Jun 18 09:13:51 2016 +0200
----------------------------------------------------------------------
jboss-blank/README.txt | 16 --
jboss-blank/pom.xml | 63 -------
.../src/main/java/example/ExampleSupport.java | 30 ----
.../src/main/java/example/HelloWorld.java | 61 -------
jboss-blank/src/main/java/example/Login.java | 59 -------
jboss-blank/src/main/resources/LICENSE.txt | 174 -------------------
jboss-blank/src/main/resources/NOTICE.txt | 5 -
jboss-blank/src/main/resources/example.xml | 25 ---
.../main/resources/example/Login-validation.xml | 16 --
.../main/resources/example/package.properties | 5 -
.../resources/example/package_es.properties | 5 -
jboss-blank/src/main/resources/log4j2.xml | 15 --
jboss-blank/src/main/resources/struts.xml | 27 ---
.../src/main/resources/velocity.properties | 1 -
.../webapp/WEB-INF/jsp/example/HelloWorld.jsp | 28 ---
.../main/webapp/WEB-INF/jsp/example/Login.jsp | 15 --
.../main/webapp/WEB-INF/jsp/example/Menu.jsp | 3 -
.../main/webapp/WEB-INF/jsp/example/Missing.jsp | 11 --
.../webapp/WEB-INF/jsp/example/Register.jsp | 3 -
.../main/webapp/WEB-INF/jsp/example/Welcome.jsp | 18 --
jboss-blank/src/main/webapp/WEB-INF/web.xml | 37 ----
jboss-blank/src/main/webapp/index.html | 10 --
.../src/test/java/example/ConfigTest.java | 96 ----------
.../src/test/java/example/HelloWorldTest.java | 37 ----
.../src/test/java/example/LoginTest.java | 55 ------
pom.xml | 1 -
26 files changed, 816 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/README.txt
----------------------------------------------------------------------
diff --git a/jboss-blank/README.txt b/jboss-blank/README.txt
deleted file mode 100644
index b05df6c..0000000
--- a/jboss-blank/README.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-README.txt - JBoss Blank
-
-This is an "empty" application that you can deploy as the basis of your own
-application. This specially dedicated to JBoss server as it includes the Javassist library.
-
-For more on getting started with Struts, see
-
-* http://cwiki.apache.org/WW/home.html
-
-I18N:
-=====
-Please note that this project was created with the assumption that it will be run
-in an environment where the default locale is set to English. This means that
-the default messages defined in package.properties are in English. If the default
-locale for your server is different, then rename package.properties to package_en.properties
-and create a new package.properties with proper values for your default locale.
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/pom.xml
----------------------------------------------------------------------
diff --git a/jboss-blank/pom.xml b/jboss-blank/pom.xml
deleted file mode 100644
index 32624d2..0000000
--- a/jboss-blank/pom.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * $Id$
- *
- * 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.
- */
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts-examples</artifactId>
- <version>1.0.0</version>
- </parent>
-
- <artifactId>struts2-jboss-blank</artifactId>
- <packaging>war</packaging>
- <name>Struts 2 JBoss Blank Webapp</name>
-
- <dependencies>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.1.0</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jsp-api</artifactId>
- <version>2.0</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.struts</groupId>
- <artifactId>struts2-junit-plugin</artifactId>
- <version>${struts2.version}</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-</project>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/java/example/ExampleSupport.java
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/java/example/ExampleSupport.java b/jboss-blank/src/main/java/example/ExampleSupport.java
deleted file mode 100644
index 02264ed..0000000
--- a/jboss-blank/src/main/java/example/ExampleSupport.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * $Id: ExampleSupport.java 471756 2006-11-06 15:01:43Z husted $
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-import com.opensymphony.xwork2.ActionSupport;
-
-/**
- * Base Action class for the Tutorial package.
- */
-public class ExampleSupport extends ActionSupport {
-}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/java/example/HelloWorld.java
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/java/example/HelloWorld.java b/jboss-blank/src/main/java/example/HelloWorld.java
deleted file mode 100644
index 941ba49..0000000
--- a/jboss-blank/src/main/java/example/HelloWorld.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * $Id: HelloWorld.java 471756 2006-11-06 15:01:43Z husted $
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-/**
- * <code>Set welcome message.</code>
- */
-public class HelloWorld extends ExampleSupport {
-
- public String execute() throws Exception {
- setMessage(getText(MESSAGE));
- return SUCCESS;
- }
-
- /**
- * Provide default valuie for Message property.
- */
- public static final String MESSAGE = "HelloWorld.message";
-
- /**
- * Field for Message property.
- */
- private String message;
-
- /**
- * Return Message property.
- *
- * @return Message property
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Set Message property.
- *
- * @param message Text to display on HelloWorld page.
- */
- public void setMessage(String message) {
- this.message = message;
- }
-}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/java/example/Login.java
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/java/example/Login.java b/jboss-blank/src/main/java/example/Login.java
deleted file mode 100644
index b7c046f..0000000
--- a/jboss-blank/src/main/java/example/Login.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * $Id: Login.java 471756 2006-11-06 15:01:43Z husted $
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-public class Login extends ExampleSupport {
-
- public String execute() throws Exception {
-
- if (isInvalid(getUsername())) return INPUT;
-
- if (isInvalid(getPassword())) return INPUT;
-
- return SUCCESS;
- }
-
- private boolean isInvalid(String value) {
- return (value == null || value.length() == 0);
- }
-
- private String username;
-
- public String getUsername() {
- return username;
- }
-
- public void setUsername(String username) {
- this.username = username;
- }
-
- private String password;
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/resources/LICENSE.txt
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/resources/LICENSE.txt b/jboss-blank/src/main/resources/LICENSE.txt
deleted file mode 100644
index c6055ec..0000000
--- a/jboss-blank/src/main/resources/LICENSE.txt
+++ /dev/null
@@ -1,174 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/resources/NOTICE.txt
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/resources/NOTICE.txt b/jboss-blank/src/main/resources/NOTICE.txt
deleted file mode 100644
index 12fa3b8..0000000
--- a/jboss-blank/src/main/resources/NOTICE.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Struts
-Copyright 2000-2011 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/resources/example.xml
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/resources/example.xml b/jboss-blank/src/main/resources/example.xml
deleted file mode 100644
index d929de1..0000000
--- a/jboss-blank/src/main/resources/example.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE struts PUBLIC
- "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
- "http://struts.apache.org/dtds/struts-2.0.dtd">
-
-<struts>
-
- <package name="example" namespace="/example" extends="struts-default">
-
- <action name="HelloWorld" class="example.HelloWorld">
- <result>/WEB-INF/jsp/example/HelloWorld.jsp</result>
- </action>
-
- <action name="Login_*" method="{1}" class="example.Login">
- <result name="input">/WEB-INF/jsp/example/Login.jsp</result>
- <result type="redirectAction">Menu</result>
- </action>
-
- <action name="*" class="example.ExampleSupport">
- <result>/WEB-INF/jsp/example/{1}.jsp</result>
- </action>
-
- <!-- Add actions here -->
- </package>
-</struts>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/resources/example/Login-validation.xml
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/resources/example/Login-validation.xml b/jboss-blank/src/main/resources/example/Login-validation.xml
deleted file mode 100644
index bd26502..0000000
--- a/jboss-blank/src/main/resources/example/Login-validation.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE validators PUBLIC
- "-//Apache Struts//XWork Validator 1.0.2//EN"
- "http://struts.apache.org/dtds/xwork-validator-1.0.2.dtd">
-
-<validators>
- <field name="username">
- <field-validator type="requiredstring">
- <message key="requiredstring"/>
- </field-validator>
- </field>
- <field name="password">
- <field-validator type="requiredstring">
- <message key="requiredstring"/>
- </field-validator>
- </field>
-</validators>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/resources/example/package.properties
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/resources/example/package.properties b/jboss-blank/src/main/resources/example/package.properties
deleted file mode 100644
index 77d589d..0000000
--- a/jboss-blank/src/main/resources/example/package.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-HelloWorld.message= Struts is up and running ...
-requiredstring = ${getText(fieldName)} is required.
-password = Password
-username = User Name
-Missing.message = This feature is under construction. Please try again in the next interation.
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/resources/example/package_es.properties
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/resources/example/package_es.properties b/jboss-blank/src/main/resources/example/package_es.properties
deleted file mode 100644
index e4740a4..0000000
--- a/jboss-blank/src/main/resources/example/package_es.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-HelloWorld.message= \ufffdStruts est\ufffd bien! ...
-requiredstring = ${getText(fieldName)} se requiere.
-password = Contrase\ufffda
-username = Nombre de Usuario
-Missing.message = \ufffden obras! \ufffdseguir intentando!
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/resources/log4j2.xml
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/resources/log4j2.xml b/jboss-blank/src/main/resources/log4j2.xml
deleted file mode 100644
index abe3dde..0000000
--- a/jboss-blank/src/main/resources/log4j2.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Configuration>
- <Appenders>
- <Console name="STDOUT" target="SYSTEM_OUT">
- <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
- </Console>
- </Appenders>
- <Loggers>
- <Logger name="com.opensymphony.xwork2" level="info"/>
- <Logger name="org.apache.struts2" level="info"/>
- <Root level="info">
- <AppenderRef ref="STDOUT"/>
- </Root>
- </Loggers>
-</Configuration>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/resources/struts.xml
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/resources/struts.xml b/jboss-blank/src/main/resources/struts.xml
deleted file mode 100644
index 591ff8f..0000000
--- a/jboss-blank/src/main/resources/struts.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?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>
-
- <constant name="struts.enable.DynamicMethodInvocation" value="false" />
- <constant name="struts.devMode" value="false" />
-
- <include file="example.xml"/>
-
-
-
- <package name="default" namespace="/" extends="struts-default">
- <default-action-ref name="index" />
- <action name="index">
- <result type="redirectAction">
- <param name="actionName">HelloWorld</param>
- <param name="namespace">/example</param>
- </result>
- </action>
- </package>
-
- <!-- Add packages here -->
-
-</struts>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/resources/velocity.properties
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/resources/velocity.properties b/jboss-blank/src/main/resources/velocity.properties
deleted file mode 100644
index 6299831..0000000
--- a/jboss-blank/src/main/resources/velocity.properties
+++ /dev/null
@@ -1 +0,0 @@
-runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/webapp/WEB-INF/jsp/example/HelloWorld.jsp
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/HelloWorld.jsp b/jboss-blank/src/main/webapp/WEB-INF/jsp/example/HelloWorld.jsp
deleted file mode 100644
index 938c761..0000000
--- a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/HelloWorld.jsp
+++ /dev/null
@@ -1,28 +0,0 @@
-<%@ page contentType="text/html; charset=UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<html>
-<head>
- <title><s:text name="HelloWorld.message"/></title>
-</head>
-
-<body>
-<h2><s:property value="message"/></h2>
-
-<h3>Languages</h3>
-<ul>
- <li>
- <s:url id="url" action="HelloWorld">
- <s:param name="request_locale">en</s:param>
- </s:url>
- <s:a href="%{url}">English</s:a>
- </li>
- <li>
- <s:url id="url" action="HelloWorld">
- <s:param name="request_locale">es</s:param>
- </s:url>
- <s:a href="%{url}">Espanol</s:a>
- </li>
-</ul>
-
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Login.jsp
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Login.jsp b/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Login.jsp
deleted file mode 100644
index 6438080..0000000
--- a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Login.jsp
+++ /dev/null
@@ -1,15 +0,0 @@
-<%@ page contentType="text/html; charset=UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<html>
-<head>
- <title>Sign On</title>
-</head>
-
-<body>
-<s:form action="Login">
- <s:textfield key="username"/>
- <s:password key="password" />
- <s:submit/>
-</s:form>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Menu.jsp
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Menu.jsp b/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Menu.jsp
deleted file mode 100644
index a74bd2c..0000000
--- a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Menu.jsp
+++ /dev/null
@@ -1,3 +0,0 @@
-<%@ page contentType="text/html; charset=UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<s:include value="Missing.jsp"/>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Missing.jsp
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Missing.jsp b/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Missing.jsp
deleted file mode 100644
index 7c01ac9..0000000
--- a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Missing.jsp
+++ /dev/null
@@ -1,11 +0,0 @@
-<%@ page contentType="text/html; charset=UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<html>
-<head><title>Missing Feature</title></head>
-
-<body>
-<p>
- <s:text name="Missing.message"/>
-</p>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Register.jsp
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Register.jsp b/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Register.jsp
deleted file mode 100644
index a74bd2c..0000000
--- a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Register.jsp
+++ /dev/null
@@ -1,3 +0,0 @@
-<%@ page contentType="text/html; charset=UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<s:include value="Missing.jsp"/>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Welcome.jsp
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Welcome.jsp b/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Welcome.jsp
deleted file mode 100644
index 64ffe9b..0000000
--- a/jboss-blank/src/main/webapp/WEB-INF/jsp/example/Welcome.jsp
+++ /dev/null
@@ -1,18 +0,0 @@
-<%@ page contentType="text/html; charset=UTF-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-<html>
-<head>
- <title>Welcome</title>
- <link href="<s:url value="/css/examplecss"/>" rel="stylesheet"
- type="text/css"/>
-</head>
-
-<body>
-<h3>Commands</h3>
-<ul>
- <li><a href="<s:url action="Login_input"/>">Sign On</a></li>
- <li><a href="<s:url action="Register"/>">Register</a></li>
-</ul>
-
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/webapp/WEB-INF/web.xml b/jboss-blank/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 7f4ac3f..0000000
--- a/jboss-blank/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
-
- <display-name>Struts Blank</display-name>
-
- <filter>
- <filter-name>struts2</filter-name>
- <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class>
- </filter>
-
- <filter-mapping>
- <filter-name>struts2</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
-
- <welcome-file-list>
- <welcome-file>index.html</welcome-file>
- </welcome-file-list>
-
- <!-- Restricts access to pure JSP files - access available only via Struts action -->
- <security-constraint>
- <display-name>No direct JSP access</display-name>
- <web-resource-collection>
- <web-resource-name>No-JSP</web-resource-name>
- <url-pattern>*.jsp</url-pattern>
- </web-resource-collection>
- <auth-constraint>
- <role-name>no-users</role-name>
- </auth-constraint>
- </security-constraint>
-
- <security-role>
- <description>Don't assign users to this role</description>
- <role-name>no-users</role-name>
- </security-role>
-
-</web-app>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/jboss-blank/src/main/webapp/index.html b/jboss-blank/src/main/webapp/index.html
deleted file mode 100644
index 8747c24..0000000
--- a/jboss-blank/src/main/webapp/index.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
-<head>
- <META HTTP-EQUIV="Refresh" CONTENT="0;URL=example/HelloWorld.action">
-</head>
-
-<body>
-<p>Loading ...</p>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/test/java/example/ConfigTest.java
----------------------------------------------------------------------
diff --git a/jboss-blank/src/test/java/example/ConfigTest.java b/jboss-blank/src/test/java/example/ConfigTest.java
deleted file mode 100644
index 28d6df6..0000000
--- a/jboss-blank/src/test/java/example/ConfigTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * $Id: ConfigTest.java 670170 2008-06-21 09:40:34Z hermanns $
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.config.RuntimeConfiguration;
-import com.opensymphony.xwork2.config.entities.ActionConfig;
-import com.opensymphony.xwork2.config.entities.ResultConfig;
-import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
-import org.apache.struts2.StrutsTestCase;
-
-import java.util.List;
-import java.util.Map;
-
-public class ConfigTest extends StrutsTestCase {
-
- protected void assertSuccess(String result) throws Exception {
- assertTrue("Expected a success result!",
- ActionSupport.SUCCESS.equals(result));
- }
-
- protected void assertInput(String result) throws Exception {
- assertTrue("Expected an input result!",
- ActionSupport.INPUT.equals(result));
- }
-
- protected Map<String, List<String>> assertFieldErrors(ActionSupport action) throws Exception {
- assertTrue(action.hasFieldErrors());
- return action.getFieldErrors();
- }
-
- protected void assertFieldError(Map field_errors, String field_name, String error_message) {
-
- List errors = (List) field_errors.get(field_name);
- assertNotNull("Expected errors for " + field_name, errors);
- assertTrue("Expected errors for " + field_name, errors.size()>0);
- // TODO: Should be a loop
- assertEquals(error_message,errors.get(0));
-
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- XmlConfigurationProvider c = new XmlConfigurationProvider("struts.xml");
- configurationManager.addContainerProvider(c);
- configurationManager.reload();
- }
-
- protected ActionConfig assertClass(String namespace, String action_name, String class_name) {
- RuntimeConfiguration configuration = configurationManager.getConfiguration().getRuntimeConfiguration();
- ActionConfig config = configuration.getActionConfig(namespace, action_name);
- assertNotNull("Mssing action", config);
- assertTrue("Wrong class name: [" + config.getClassName() + "]",
- class_name.equals(config.getClassName()));
- return config;
- }
-
- protected ActionConfig assertClass(String action_name, String class_name) {
- return assertClass("", action_name, class_name);
- }
-
- protected void assertResult(ActionConfig config, String result_name, String result_value) {
- Map results = config.getResults();
- ResultConfig result = (ResultConfig) results.get(result_name);
- Map params = result.getParams();
- String value = (String) params.get("actionName");
- if (value == null)
- value = (String) params.get("location");
- assertTrue("Wrong result value: [" + value + "]",
- result_value.equals(value));
- }
-
- public void testConfig() throws Exception {
- assertNotNull(configurationManager);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/test/java/example/HelloWorldTest.java
----------------------------------------------------------------------
diff --git a/jboss-blank/src/test/java/example/HelloWorldTest.java b/jboss-blank/src/test/java/example/HelloWorldTest.java
deleted file mode 100644
index 4a89271..0000000
--- a/jboss-blank/src/test/java/example/HelloWorldTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * $Id: HelloWorldTest.java 577750 2007-09-20 13:54:31Z mrdon $
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-import com.opensymphony.xwork2.ActionSupport;
-import org.apache.struts2.StrutsTestCase;
-
-public class HelloWorldTest extends StrutsTestCase {
-
- public void testHelloWorld() throws Exception {
- HelloWorld hello_world = new HelloWorld();
- String result = hello_world.execute();
- assertTrue("Expected a success result!",
- ActionSupport.SUCCESS.equals(result));
- assertTrue("Expected the default message!",
- hello_world.getText(HelloWorld.MESSAGE).equals(hello_world.getMessage()));
- }
-}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/jboss-blank/src/test/java/example/LoginTest.java
----------------------------------------------------------------------
diff --git a/jboss-blank/src/test/java/example/LoginTest.java b/jboss-blank/src/test/java/example/LoginTest.java
deleted file mode 100644
index 7dfb3f6..0000000
--- a/jboss-blank/src/test/java/example/LoginTest.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * $Id: LoginTest.java 471756 2006-11-06 15:01:43Z husted $
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package example;
-
-import com.opensymphony.xwork2.ActionSupport;
-import com.opensymphony.xwork2.config.entities.ActionConfig;
-
-import java.util.Map;
-
-public class LoginTest extends ConfigTest {
-
- public void FIXME_testLoginConfig() throws Exception {
- ActionConfig config = assertClass("example", "Login_input", "example.Login");
- assertResult(config, ActionSupport.SUCCESS, "Menu");
- assertResult(config, ActionSupport.INPUT, "/example/Login.jsp");
- }
-
- public void testLoginSubmit() throws Exception {
- Login login = new Login();
- login.setUsername("username");
- login.setPassword("password");
- String result = login.execute();
- assertSuccess(result);
- }
-
- // Needs access to an envinronment that includes validators
- public void FIXME_testLoginSubmitInput() throws Exception {
- Login login = new Login();
- String result = login.execute();
- assertInput(result);
- Map errors = assertFieldErrors(login);
- assertFieldError(errors,"username","Username is required.");
- assertFieldError(errors,"password","Password is required.");
- }
-
-}
http://git-wip-us.apache.org/repos/asf/struts-examples/blob/7ce189c0/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5719847..8d03f4d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -61,7 +61,6 @@
<module>helloworld</module>
<module>http-session</module>
<module>interceptors</module>
- <module>jboss-blank</module>
<module>mailreader</module>
<module>message-resource</module>
<module>preparable-interface</module>