Author: musachy
Date: Thu Nov 5 03:30:06 2009
New Revision: 832986
URL: http://svn.apache.org/viewvc?rev=832986&view=rev
Log:
add support for add operator and ognl #
Added:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/survey/
- copied from r832476,
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/example/
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/globalMessages.properties
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/log4j.properties
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/survey/
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/survey/SurveyAction-save-validation.xml
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/index.jsp
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/
- copied from r832476,
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/example/
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/survey-results.jsp
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/uel-expressions.jsp
Removed:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/example/
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/example/
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/index.html
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/surveyResults.jsp
Modified:
struts/sandbox/trunk/struts2-uel-plugin-example/pom.xml
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/survey/SurveyAction.java
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/survey/SurveyBean.java
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/struts.xml
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/WEB-INF/web.xml
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/survey.jsp
Modified: struts/sandbox/trunk/struts2-uel-plugin-example/pom.xml
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/pom.xml?rev=832986&r1=832985&r2=832986&view=diff
==============================================================================
--- struts/sandbox/trunk/struts2-uel-plugin-example/pom.xml (original)
+++ struts/sandbox/trunk/struts2-uel-plugin-example/pom.xml Thu Nov 5 03:30:06
2009
@@ -1,5 +1,4 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<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>
<groupId>org.apache.struts2.uelplugin</groupId>
@@ -27,8 +26,11 @@
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
- <version>7.0.0pre3</version>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <version>6.1.10</version>
+ <configuration>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ </configuration>
</plugin>
</plugins>
</build>
Modified:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/survey/SurveyAction.java
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/survey/SurveyAction.java?rev=832986&r1=832476&r2=832986&view=diff
==============================================================================
---
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/survey/SurveyAction.java
(original)
+++
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/survey/SurveyAction.java
Thu Nov 5 03:30:06 2009
@@ -1,4 +1,4 @@
-package example;
+package survey;
import java.util.Date;
import com.opensymphony.xwork2.ActionSupport;
@@ -12,6 +12,7 @@
public String edit() {
surveyBean.setAge(22);
surveyBean.setFirstName("Lex");
+ surveyBean.setLastName("Luthor");
surveyBean.setBirthdate(new Date());
return SUCCESS;
}
Modified:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/survey/SurveyBean.java
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/survey/SurveyBean.java?rev=832986&r1=832476&r2=832986&view=diff
==============================================================================
---
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/survey/SurveyBean.java
(original)
+++
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/java/survey/SurveyBean.java
Thu Nov 5 03:30:06 2009
@@ -1,4 +1,4 @@
-package example;
+package survey;
import java.util.Date;
Added:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/globalMessages.properties
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/globalMessages.properties?rev=832986&view=auto
==============================================================================
---
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/globalMessages.properties
(added)
+++
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/globalMessages.properties
Thu Nov 5 03:30:06 2009
@@ -0,0 +1,3 @@
+requiredstring = Field ${getText(fieldName)} is required
+surveyBean.firstName = First Name
+surveyBean.lastName = Last Name
\ No newline at end of file
Added:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/log4j.properties
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/log4j.properties?rev=832986&view=auto
==============================================================================
---
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/log4j.properties
(added)
+++
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/log4j.properties
Thu Nov 5 03:30:06 2009
@@ -0,0 +1,9 @@
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=ERROR, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
Modified:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/struts.xml
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/struts.xml?rev=832986&r1=832985&r2=832986&view=diff
==============================================================================
---
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/struts.xml
(original)
+++
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/struts.xml
Thu Nov 5 03:30:06 2009
@@ -3,15 +3,30 @@
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
- <package name="example" namespace="/example" extends="uel-default">
+ <constant name="struts.custom.i18n.resources" value="globalMessages"/>
+ <constant name="struts.enableSimpleParametersBinder" value="true"/>
- <action name="SurveyEdit" class="example.SurveyAction" method="edit">
- <result name="success">/example/survey.jsp</result>
+ <package name="survey" namespace="/survey" extends="uel-default">
+
+ <action name="edit" class="survey.SurveyAction" method="edit">
+ <result>/survey/survey.jsp</result>
+ </action>
+
+ <action name="save" class="survey.SurveyAction" method="save">
+ <result>/survey/survey-results.jsp</result>
+ <result name="input">/survey/survey.jsp</result>
</action>
+ </package>
+
+ <package name="root" namespace="/" extends="struts-default">
+ <default-action-ref name="index"/>
- <action name="SurveySave" class="example.SurveyAction" method="save">
- <result name="success">/example/surveyResults.jsp</result>
+ <action name="index">
+ <result>/index.jsp</result>
</action>
+ <action name="uel-expressions">
+ <result>/uel-expressions.jsp</result>
+ </action>
</package>
</struts>
Added:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/survey/SurveyAction-save-validation.xml
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/survey/SurveyAction-save-validation.xml?rev=832986&view=auto
==============================================================================
---
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/survey/SurveyAction-save-validation.xml
(added)
+++
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/resources/survey/SurveyAction-save-validation.xml
Thu Nov 5 03:30:06 2009
@@ -0,0 +1,15 @@
+<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN"
+ "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd">
+
+<validators>
+ <field name="surveyBean.firstName">
+ <field-validator type="requiredstring">
+ <message key="requiredstring"/>
+ </field-validator>
+ </field>
+ <field name="surveyBean.lastName">
+ <field-validator type="requiredstring">
+ <message key="requiredstring"/>
+ </field-validator>
+ </field>
+</validators>
Modified:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/WEB-INF/web.xml
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/WEB-INF/web.xml?rev=832986&r1=832985&r2=832986&view=diff
==============================================================================
---
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/WEB-INF/web.xml
(original)
+++
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/WEB-INF/web.xml
Thu Nov 5 03:30:06 2009
@@ -20,7 +20,7 @@
<listener>
<listener-class>
-
org.apache.struts2.uelplugin.contextlistener.UelServletContextListener
+ org.apache.struts2.uelplugin.UelServletContextListener
</listener-class>
</listener>
Added: struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/index.jsp
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/index.jsp?rev=832986&view=auto
==============================================================================
--- struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/index.jsp
(added)
+++ struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/index.jsp
Thu Nov 5 03:30:06 2009
@@ -0,0 +1,12 @@
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<html>
+ <head><title>UEL Showcase</title></head>
+ <body>
+ <ul>
+ <li><s:a namespace="/survey" action="edit">Survey</s:a></li>
+ <li><s:a namespace="/" action="uel-expressions">UEL
Expressions</s:a></li>
+ </ul>
+ </body>
+</html>
\ No newline at end of file
Added:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/survey-results.jsp
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/survey-results.jsp?rev=832986&view=auto
==============================================================================
---
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/survey-results.jsp
(added)
+++
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/survey-results.jsp
Thu Nov 5 03:30:06 2009
@@ -0,0 +1,16 @@
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<html>
+<head>
+ <title>Survey</title>
+</head>
+
+<body>
+<h3>Results</h3>
+First Name: <s:property value="surveyBean.firstName"/><br/>
+Last Name: <s:property value="surveyBean.lastName"/><br/>
+Age: <s:property value="surveyBean.age"/><br/>
+Birthday: <s:property value="surveyBean.birthdate"/><br/>
+</body>
+</html>
Modified:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/survey.jsp
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/survey.jsp?rev=832986&r1=832476&r2=832986&view=diff
==============================================================================
---
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/survey.jsp
(original)
+++
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/survey/survey.jsp
Thu Nov 5 03:30:06 2009
@@ -7,14 +7,16 @@
</head>
<body>
-<h3>Please fill out Survey</h3>
+<h3>Please fill our Survey</h3>
+
+<s:fielderror />
<p>
- <s:form action="SurveySave" method="get">
- <s:textfield label="First Name"
name="#{surveyBean.firstName}"></s:textfield>
- <s:textfield label="Last Name"
name="#{surveyBean.lastName}"></s:textfield>
- <s:textfield label="Age" name="#{surveyBean.age}"></s:textfield>
- <s:textfield label="Birthday"
name="#{surveyBean.birthdate}"></s:textfield>
+ <s:form action="save" method="post">
+ <s:textfield label="First Name" name="#{surveyBean.firstName}" />
+ <s:textfield label="Last Name" name="#{surveyBean.lastName}" />
+ <s:textfield label="Age" name="#{surveyBean.age}" />
+ <s:textfield label="Birthday" name="#{surveyBean.birthdate}" />
<s:submit value="Submit"/>
</s:form>
</p>
Added:
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/uel-expressions.jsp
URL:
http://svn.apache.org/viewvc/struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/uel-expressions.jsp?rev=832986&view=auto
==============================================================================
---
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/uel-expressions.jsp
(added)
+++
struts/sandbox/trunk/struts2-uel-plugin-example/src/main/webapp/uel-expressions.jsp
Thu Nov 5 03:30:06 2009
@@ -0,0 +1,10 @@
+<%@ page contentType="text/html; charset=UTF-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+<html>
+ <head><title>UEL Expression</title></head>
+ <body>
+ <s:iterator begin="2" end="9" step="1" var="val">
+ <s:property value="%{#val}"/>
+ </s:iterator>
+ </body>
+</html>
\ No newline at end of file