Compare commits

..

1 Commits

Author SHA1 Message Date
Lukasz Lenart f15f28a176 [maven-release-plugin] copy for tag STRUTS_2_3_12
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12@1453278 13f79535-47bb-0310-9956-ffa450edef68
2013-03-06 10:44:26 +00:00
133 changed files with 701 additions and 2390 deletions
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
@@ -34,9 +34,9 @@
<name>Blank Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/apps/blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps/blank</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jboss-blank</artifactId>
@@ -34,9 +34,9 @@
<name>JBoss Blank Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/apps/jboss-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps/jboss-blank</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -34,9 +34,9 @@
<name>Mail Reader Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/apps/mailreader</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps/mailreader</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
@@ -42,9 +42,9 @@
</modules>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/apps</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps</url>
</scm>
<profiles>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
@@ -34,9 +34,9 @@
<name>Portlet Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/apps/portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps/portlet</url>
</scm>
<profiles>
+2 -2
View File
@@ -26,13 +26,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>2.3.13</version>
<version>2.3.12</version>
<name>Struts 2 Rest Showcase Example</name>
<description>Struts 2 Rest Showcase Example</description>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
@@ -34,9 +34,9 @@
<name>Showcase Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/apps/showcase</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps/showcase</url>
</scm>
@@ -58,7 +58,7 @@
</field>
<field name="regexValidatorField">
<field-validator type="regex">
<param name="regex">.*\.txt</param>
<param name="expression">.*\.txt</param>
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
</field-validator>
</field>
@@ -52,7 +52,7 @@
</field>
<field name="regexValidatorField">
<field-validator type="regex">
<param name="regex"><![CDATA[ [^<>]+ ]]></param>
<param name="expression">.*\.txt</param>
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
</field-validator>
</field>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Maven Archetypes</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes</url>
</scm>
<modules>
+5 -5
View File
@@ -3,19 +3,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-blank</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Blank</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-blank</url>
</scm>
<properties>
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-convention</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Blank Convention</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-convention</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-convention</url>
</scm>
<properties>
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-dbportlet</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Database Portlet</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-dbportlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-dbportlet</url>
</scm>
<properties>
+5 -5
View File
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-plugin</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-plugin</url>
</scm>
<properties>
+5 -5
View File
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-portlet</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Portlet</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-portlet</url>
</scm>
<properties>
+5 -5
View File
@@ -4,19 +4,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-starter</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Starter</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/archetypes/struts2-archetype-starter</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-starter</url>
</scm>
<properties>
+4 -4
View File
@@ -11,13 +11,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/assembly</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/assembly</url>
</scm>
<profiles>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-admin-bundle</artifactId>
@@ -12,9 +12,9 @@
<name>Struts 2 OSGi Admin Bundle</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/bundles/admin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/bundles/admin</url>
</scm>
<dependencies>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-demo-bundle</artifactId>
@@ -12,9 +12,9 @@
<name>Struts 2 OSGi Demo Bundle</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/bundles/demo</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/bundles/demo</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
@@ -34,9 +34,9 @@
<name>Struts OSGi Bundles</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/bundles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles</url>
</scm>
<modules>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Core</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/core</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/core</url>
</scm>
<properties>
@@ -247,6 +247,4 @@ public final class StrutsConstants {
public static final String STRUTS_CONVERTER_CREATOR = "struts.converter.creator";
public static final String STRUTS_CONVERTER_HOLDER = "struts..converter.holder";
public static final String STRUTS_EXPRESSION_PARSER = "struts.expression.parser";
}
@@ -49,7 +49,10 @@ import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.inject.Context;
import com.opensymphony.xwork2.inject.Factory;
import com.opensymphony.xwork2.inject.Scope;
import com.opensymphony.xwork2.util.*;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.PatternMatcher;
import com.opensymphony.xwork2.util.ValueStackFactory;
import com.opensymphony.xwork2.util.location.LocatableProperties;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
@@ -273,13 +276,6 @@ import java.util.StringTokenizer;
* <td>singleton</td>
* <td>Holds user converters' instances</td>
* </tr>
* <tr>
* <td>com.opensymphony.xwork2.util.TextParser</td>
* <td>struts.expression.parser</td>
* <td>singleton</td>
* <td>Used to parse expressions like ${foo.bar} or %{bar.foo} but it is up tp the TextParser's
* implementation what kind of opening char to use (#, $, %, etc)</td>
* </tr>
* </table>
*
* <!-- END SNIPPET: extensionPoints -->
@@ -359,8 +355,6 @@ public class BeanSelectionProvider implements ConfigurationProvider {
alias(UnknownHandlerManager.class, StrutsConstants.STRUTS_UNKNOWN_HANDLER_MANAGER, builder, props);
alias(UrlHelper.class, StrutsConstants.STRUTS_URL_HELPER, builder, props);
alias(TextParser.class, StrutsConstants.STRUTS_EXPRESSION_PARSER, builder, props);
if ("true".equalsIgnoreCase(props.getProperty(StrutsConstants.STRUTS_DEVMODE))) {
props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD, "true");
props.setProperty(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, "true");
@@ -82,11 +82,6 @@ public class HttpHeaderResult implements Result {
private static final long serialVersionUID = 195648957144219214L;
private static final Logger LOG = LoggerFactory.getLogger(HttpHeaderResult.class);
/**
* This result type doesn't have a default param, null is ok to reduce noice in logs
*/
public static final String DEFAULT_PARAM = null;
private boolean parse = true;
private Map<String, String> headers;
private int status = -1;
@@ -198,9 +198,8 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
if (resultConfig != null) {
Map<String, String> resultConfigParams = resultConfig.getParams();
List<String> prohibitedResultParams = getProhibitedResultParams();
for (Map.Entry<String, String> e : resultConfigParams.entrySet()) {
if (!prohibitedResultParams.contains(e.getKey())) {
if (!getProhibitedResultParams().contains(e.getKey())) {
String potentialValue = e.getValue() == null ? "" : conditionalParse(e.getValue(), invocation);
if (!suppressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0))) {
requestParameters.put(e.getKey(), potentialValue);
@@ -228,18 +227,7 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
}
protected List<String> getProhibitedResultParams() {
return Arrays.asList(
DEFAULT_PARAM,
"namespace",
"method",
"encode",
"parse",
"location",
"prependServletContext",
"suppressEmptyParameters",
"anchor",
"statusCode"
);
return Arrays.asList(DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location", "prependServletContext", "suppressEmptyParameters", "anchor");
}
/**
@@ -197,13 +197,13 @@ public abstract class StrutsResultSupport implements Result, StrutsStatics {
if (parse && param != null && invocation != null) {
return TextParseUtil.translateVariables(param, invocation.getStack(),
new TextParseUtil.ParsedValueEvaluator() {
public Object evaluate(String parsedValue) {
public Object evaluate(Object parsedValue) {
if (encode) {
if (parsedValue != null) {
try {
// use UTF-8 as this is the recommended encoding by W3C to
// avoid incompatibilities.
return URLEncoder.encode(parsedValue, "UTF-8");
return URLEncoder.encode(parsedValue.toString(), "UTF-8");
}
catch(UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
@@ -21,16 +21,18 @@
package org.apache.struts2.dispatcher.mapper;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.StrutsConstants;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
* <!-- START SNIPPET: description -->
@@ -86,11 +88,12 @@ public class CompositeActionMapper implements ActionMapper {
protected Container container;
protected List<ActionMapper> actionMappers = new ArrayList<ActionMapper>();
public CompositeActionMapper(@Inject Container container) {
@Inject
public void setContainer(Container container) {
this.container = container;
}
@Inject(StrutsConstants.STRUTS_MAPPER_COMPOSITE)
public void setActionMappers(String list) {
if (list != null) {
@@ -295,7 +295,8 @@ public class DefaultActionMapper implements ActionMapper {
*
* @see org.apache.struts2.dispatcher.mapper.ActionMapper#getMapping(javax.servlet.http.HttpServletRequest)
*/
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
public ActionMapping getMapping(HttpServletRequest request,
ConfigurationManager configManager) {
ActionMapping mapping = new ActionMapping();
String uri = getUri(request);
@@ -308,13 +309,22 @@ public class DefaultActionMapper implements ActionMapper {
}
parseNameAndNamespace(uri, mapping, configManager);
handleSpecialParameters(request, mapping);
return parseActionName(mapping);
// if Action name is empty it can be a request to static resource, return null to handle that case
if (StringUtils.isEmpty(mapping.getName())) {
return null;
}
parseActionName(mapping);
return mapping;
}
protected ActionMapping parseActionName(ActionMapping mapping) {
if (mapping.getName() == null) {
return null;
return mapping;
}
if (allowDynamicMethodCalls) {
// handle "name!method" convention.
@@ -336,7 +346,8 @@ public class DefaultActionMapper implements ActionMapper {
* @param request The request
* @param mapping The action mapping
*/
public void handleSpecialParameters(HttpServletRequest request, ActionMapping mapping) {
public void handleSpecialParameters(HttpServletRequest request,
ActionMapping mapping) {
// handle special parameter prefixes.
Set<String> uniqueParameters = new HashSet<String>();
Map parameterMap = request.getParameterMap();
@@ -366,7 +377,8 @@ public class DefaultActionMapper implements ActionMapper {
* @param uri The uri
* @param mapping The action mapping to populate
*/
protected void parseNameAndNamespace(String uri, ActionMapping mapping, ConfigurationManager configManager) {
protected void parseNameAndNamespace(String uri, ActionMapping mapping,
ConfigurationManager configManager) {
String namespace, name;
int lastSlash = uri.lastIndexOf("/");
if (lastSlash == -1) {
@@ -409,7 +421,7 @@ public class DefaultActionMapper implements ActionMapper {
}
}
if (!allowSlashesInActionNames) {
if (!allowSlashesInActionNames && name != null) {
int pos = name.lastIndexOf('/');
if (pos > -1 && pos < name.length() - 1) {
name = name.substring(pos + 1);
@@ -100,8 +100,6 @@
<bean class="com.opensymphony.xwork2.ognl.OgnlUtil" />
<bean type="com.opensymphony.xwork2.util.TextParser" name="struts" class="com.opensymphony.xwork2.util.OgnlTextParser" scope="singleton"/>
<bean type="ognl.PropertyAccessor" name="com.opensymphony.xwork2.util.CompoundRoot" class="com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor" />
<bean type="ognl.PropertyAccessor" name="java.lang.Object" class="com.opensymphony.xwork2.ognl.accessor.ObjectAccessor" />
<bean type="ognl.PropertyAccessor" name="java.util.Iterator" class="com.opensymphony.xwork2.ognl.accessor.XWorkIteratorPropertyAccessor" />
@@ -183,7 +183,6 @@ public class ServletRedirectResultTest extends StrutsTestCase implements StrutsS
.addParam("location", "someLocation")
.addParam("prependServletContext", "true")
.addParam("method", "someMethod")
.addParam("statusCode", "333")
.addParam("param1", "value 1")
.addParam("param2", "value 2")
.addParam("param3", "value 3")
@@ -222,6 +221,7 @@ public class ServletRedirectResultTest extends StrutsTestCase implements StrutsS
result.setActionMapper(container.getInstance(ActionMapper.class));
result.execute(mockInvocation);
assertEquals("/myNamespace/myAction.action?param1=value+1&param2=value+2&param3=value+3#fragment", res.getRedirectedUrl());
control.verify();
}
@@ -21,14 +21,23 @@
package org.apache.struts2.dispatcher.mapper;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.StrutsConstants;
import org.springframework.mock.web.MockHttpServletRequest;
import com.mockobjects.dynamic.C;
import com.mockobjects.dynamic.Mock;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.inject.Container;
import junit.framework.TestCase;
import org.springframework.mock.web.MockHttpServletRequest;
import com.opensymphony.xwork2.inject.Scope.Strategy;
import javax.servlet.http.HttpServletRequest;
import junit.framework.TestCase;
/**
*
@@ -40,8 +49,9 @@ public class CompositeActionMapperTest extends TestCase {
Mock mockContainer;
public void setUp() throws Exception {
compositeActionMapper = new CompositeActionMapper();
mockContainer = new Mock(Container.class);
compositeActionMapper = new CompositeActionMapper((Container)mockContainer.proxy());
compositeActionMapper.setContainer((Container)mockContainer.proxy());
}
@@ -21,6 +21,17 @@
package org.apache.struts2.dispatcher.mapper;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.dispatcher.ServletRedirectResult;
import org.apache.struts2.dispatcher.StrutsResultSupport;
import org.apache.struts2.views.jsp.StrutsMockHttpServletRequest;
import org.apache.struts2.views.jsp.StrutsMockHttpServletResponse;
import com.mockobjects.dynamic.Mock;
import com.mockobjects.servlet.MockHttpServletRequest;
import com.opensymphony.xwork2.ActionContext;
@@ -30,16 +41,6 @@ import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.dispatcher.ServletRedirectResult;
import org.apache.struts2.dispatcher.StrutsResultSupport;
import org.apache.struts2.views.jsp.StrutsMockHttpServletRequest;
import org.apache.struts2.views.jsp.StrutsMockHttpServletResponse;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
/**
* DefaultActionMapper test case.
@@ -256,7 +257,8 @@ public class DefaultActionMapperTest extends StrutsTestCase {
public void testGetMappingWithActionName_null() throws Exception {
DefaultActionMapper mapper = new DefaultActionMapper();
ActionMapping mapping = mapper.getMappingFromActionName(null);
assertNull(mapping);
assertEquals(null, mapping.getName());
assertEquals(null, mapping.getMethod());
}
public void testGetUri() throws Exception {
+1 -1
View File
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-codebehind-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Codebehind Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/codebehind</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/codebehind</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/codebehind</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/codebehind</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/codebehind</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/codebehind</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Configuration Browser Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/config-browser</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/config-browser</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/config-browser</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/config-browser</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/config-browser</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/config-browser</url>
</scm>
</project>
+4 -4
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
@@ -11,9 +11,9 @@
<name>Struts 2 Convention Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_13/trunk/struts2-convention-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_13/trunk/struts2-convention-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_13/trunk/struts2-convention-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_12/trunk/struts2-convention-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_12/trunk/struts2-convention-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_12/trunk/struts2-convention-plugin</url>
</scm>
<build>
@@ -757,7 +757,7 @@ public class PackageBasedActionConfigBuilderTest extends TestCase {
((ObjectFactory)obj).setReflectionProvider(new OgnlReflectionProvider() {
@Override
public void setProperties(Map<String, ?> properties, Object o) {
public void setProperties(Map<String, String> properties, Object o) {
}
public void setProperties(Map<String, String> properties, Object o, Map<String, Object> context, boolean throwPropertyExceptions) throws ReflectionException {
+4 -4
View File
@@ -25,7 +25,7 @@
<parent>
<artifactId>struts2-plugins</artifactId>
<groupId>org.apache.struts</groupId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.struts</groupId>
@@ -33,9 +33,9 @@
<name>Struts 2 Dojo Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/dojo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/dojo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/dojo</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/dojo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/dojo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/dojo</url>
</scm>
<profiles>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dwr-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 DWR Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/dwr</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/dwr</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/dwr</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/dwr</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/dwr</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/dwr</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
@@ -35,9 +35,9 @@
<name>Struts 2 Embedded JSP Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/embeddedjsp</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/embeddedjsp</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/embeddedjsp</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/embeddedjsp</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/embeddedjsp</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/embeddedjsp</url>
</scm>
<dependencies>
@@ -25,8 +25,6 @@ import com.opensymphony.xwork2.FileManager;
import com.opensymphony.xwork2.FileManagerFactory;
import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.util.TextParser;
import com.opensymphony.xwork2.util.OgnlTextParser;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.finder.ClassLoaderInterface;
import com.opensymphony.xwork2.util.finder.ClassLoaderInterfaceDelegate;
@@ -277,8 +275,6 @@ public class EmbeddedJSPResultTest extends TestCase {
//mock container
Container container = EasyMock.createNiceMock(Container.class);
EasyMock.expect(container.getInstance(XWorkConverter.class)).andReturn(converter).anyTimes();
TextParser parser = new OgnlTextParser();
EasyMock.expect(container.getInstance(TextParser.class)).andReturn(parser).anyTimes();
EasyMock.expect(container.getInstanceNames(FileManager.class)).andReturn(new HashSet<String>()).anyTimes();
EasyMock.expect(container.getInstance(FileManager.class)).andReturn(fileManager).anyTimes();
+4 -4
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
@@ -13,9 +13,9 @@
<url>http://struts.apache.org</url>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_13/trunk/struts2-gxp-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_13/trunk/struts2-gxp-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_13/trunk/struts2-gxp-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_12/trunk/struts2-gxp-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_12/trunk/struts2-gxp-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_12/trunk/struts2-gxp-plugin</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jasperreports-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Jasper Reports Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/jasperreports</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/jasperreports</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/jasperreports</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/jasperreports</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/jasperreports</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/jasperreports</url>
</scm>
<dependencies>
+4 -4
View File
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-javatemplates-plugin</artifactId>
@@ -33,9 +33,9 @@
<name>Struts 2 Java Templates Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/javatemplates</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/javatemplates</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/javatemplates</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/javatemplates</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/javatemplates</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/javatemplates</url>
</scm>
<dependencies>
@@ -24,12 +24,10 @@ package org.apache.struts2.views.java.simple;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.util.TextParser;
import com.opensymphony.xwork2.util.OgnlTextParser;
import com.opensymphony.xwork2.util.ValueStack;
import junit.framework.TestCase;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.components.Component;
import org.apache.struts2.components.UIBean;
import org.apache.struts2.components.template.Template;
@@ -109,8 +107,6 @@ public abstract class AbstractTest extends TestCase {
XWorkConverter converter = new ConverterEx();
EasyMock.expect(container.getInstance(String.class, StrutsConstants.STRUTS_TAG_ALTSYNTAX)).andReturn("true").anyTimes();
EasyMock.expect(container.getInstance(XWorkConverter.class)).andReturn(converter).anyTimes();
TextParser parser = new OgnlTextParser();
EasyMock.expect(container.getInstance(TextParser.class)).andReturn(parser).anyTimes();
stackContext.put(ActionContext.CONTAINER, container);
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jfreechart-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 JFreeChart Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/jfreechart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/jfreechart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/jfreechart</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/jfreechart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/jfreechart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/jfreechart</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jsf-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 JSF Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/jsf</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/jsf</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/jsf</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/jsf</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/jsf</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/jsf</url>
</scm>
<dependencies>
@@ -21,13 +21,14 @@
package org.apache.struts2.jsf;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import java.util.Map;
import javax.faces.application.NavigationHandler;
import javax.faces.context.FacesContext;
import java.util.Map;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.config.entities.ResultConfig;
/**
* Overrides the JFS navigation by delegating the result to handling by the core
@@ -59,7 +60,7 @@ public class StrutsNavigationHandler extends NavigationHandler {
public void handleNavigation(FacesContext facesContext, String fromAction, String outcome) {
ActionContext ctx = ActionContext.getContext();
if (outcome != null) {
if (ctx == null || ctx.getActionInvocation() == null) {
if (ctx == null && ctx.getActionInvocation() == null) {
delegateToParentNavigation(facesContext, fromAction, outcome);
} else {
ActionConfig config = ctx.getActionInvocation().getProxy().getConfig();
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-json-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 JSON Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/json</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/json</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/json</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/json</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/json</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/json</url>
</scm>
<build>
+4 -13
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 JUnit Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/junit</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/junit</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/junit</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/junit</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/junit</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/junit</url>
</scm>
<dependencies>
@@ -66,15 +66,6 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<!-- Convention Plugin tests -->
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<!-- Portlet -->
<dependency>
<groupId>javax.portlet</groupId>
@@ -21,11 +21,7 @@
package org.apache.struts2;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.ActionProxyFactory;
import com.opensymphony.xwork2.ValidationAware;
import com.opensymphony.xwork2.XWorkJUnit4TestCase;
import com.opensymphony.xwork2.*;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.interceptor.annotations.After;
import com.opensymphony.xwork2.interceptor.annotations.Before;
@@ -45,18 +41,12 @@ import org.springframework.mock.web.MockServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.UnsupportedEncodingException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.ConsoleHandler;
import java.util.logging.Formatter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import java.util.logging.*;
import static org.junit.Assert.assertNotNull;
@@ -209,23 +199,6 @@ public abstract class StrutsJUnit4TestCase<T> extends XWorkJUnit4TestCase {
pageContext = new MockPageContext(servletContext, request, response);
}
public void finishExecution() {
HttpSession session = this.request.getSession();
Enumeration attributeNames = session.getAttributeNames();
MockHttpServletRequest nextRequest = new MockHttpServletRequest();
while (attributeNames.hasMoreElements()) {
String key = (String) attributeNames.nextElement();
Object attribute = session.getAttribute(key);
nextRequest.getSession().setAttribute(key, attribute);
}
this.response = new MockHttpServletResponse();
this.request = nextRequest;
this.pageContext = new MockPageContext(servletContext, request, response);
}
/**
* Sets up the configuration settings, XWork configuration, and
* message resources
@@ -1,42 +0,0 @@
/*
* $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 actions;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
/**
* Example action, which is called by the convention plugin test case
*/
public class ViewAction extends ActionSupport {
private String message;
public String getMessage() {
return message;
}
public String execute() {
message = "Hello World";
return SUCCESS;
}
}
@@ -1,46 +0,0 @@
/*
* $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.convention;
import actions.ViewAction;
import org.apache.struts2.StrutsJUnit4TestCase;
import org.junit.Assert;
import org.junit.Test;
/**
* Uses the convention plugin to execute actions
*/
public class StrutsJUnit4ConventionTestCaseTest extends StrutsJUnit4TestCase<ViewAction>{
@Test
public void testConventionUrl() throws Exception {
// TODO: Currently output is empty
String output = executeAction("/view.action");
ViewAction action = this.getAction();
Assert.assertEquals("Hello World", action.getMessage());
}
@Override
protected String getConfigPath() {
return "struts-convention-configuration.xml";
}
}
@@ -1,35 +0,0 @@
/*
* $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.session;
import com.opensymphony.xwork2.ActionSupport;
/**
* An action which reads a value from the session.
* The value is previously set by SessionSetAction.
*/
public class SessionGetAction extends ActionSupport {
private static final long serialVersionUID = 8366502863472148631L;
public String execute() {
return ActionSupport.SUCCESS;
}
}
@@ -1,39 +0,0 @@
/*
* $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.session;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
/**
* An action which sets a value into the session
*/
public class SessionSetAction extends ActionSupport {
private static final long serialVersionUID = -3097127804272607687L;
public String SESSION_KEY = "sessionKey";
public String SESSION_VALUE = "sessionValue";
public String execute() {
ActionContext.getContext().getSession().put(SESSION_KEY, SESSION_VALUE);
return ActionSupport.SUCCESS;
}
}
@@ -1,53 +0,0 @@
/*
* $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.session;
import org.apache.struts2.JUnitTestAction;
import org.apache.struts2.StrutsJUnit4TestCase;
import org.junit.Assert;
import org.junit.Test;
/**
* Calls SessionSet which sets a value into the session and afterwards calls SessionGet, which
* should return this session value.
*
* In prior versions only one executeAction() call could happen in a single test case, because
* either the session values were deleted or the wrong result would be returned (always the result of
* the first action execution).
*/
public class StrutsJUnit4SessionTestCaseTest extends StrutsJUnit4TestCase<JUnitTestAction>{
@Test
public void testPersistingSessionValues() throws Exception {
String output = executeAction("/sessiontest/sessionSet.action");
Assert.assertEquals("sessionValue", output);
this.finishExecution();
String output2 = executeAction("/sessiontest/sessionGet.action");
Assert.assertEquals("sessionValue", output2);
}
@Override
protected String getConfigPath() {
return "struts-session-values-test.xml";
}
}
@@ -1,73 +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.
*/
-->
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
<bean type="com.opensymphony.xwork2.UnknownHandler" name="convention" class="org.apache.struts2.convention.ConventionUnknownHandler"/>
<bean type="org.apache.struts2.convention.ActionConfigBuilder" name="convention" class="org.apache.struts2.convention.PackageBasedActionConfigBuilder"/>
<bean type="org.apache.struts2.convention.ActionNameBuilder" name="convention" class="org.apache.struts2.convention.SEOActionNameBuilder"/>
<bean type="org.apache.struts2.convention.ResultMapBuilder" name="convention" class="org.apache.struts2.convention.DefaultResultMapBuilder"/>
<bean type="org.apache.struts2.convention.InterceptorMapBuilder" name="convention" class="org.apache.struts2.convention.DefaultInterceptorMapBuilder"/>
<bean type="org.apache.struts2.convention.ConventionsService" name="convention" class="org.apache.struts2.convention.ConventionsServiceImpl"/>
<bean type="com.opensymphony.xwork2.config.PackageProvider" name="convention.packageProvider" class="org.apache.struts2.convention.ClasspathPackageProvider"/>
<bean type="com.opensymphony.xwork2.config.PackageProvider" name="convention.containerProvider" class="org.apache.struts2.convention.ClasspathConfigurationProvider"/>
<constant name="struts.convention.actionConfigBuilder" value="convention"/>
<constant name="struts.convention.actionNameBuilder" value="convention"/>
<constant name="struts.convention.resultMapBuilder" value="convention"/>
<constant name="struts.convention.interceptorMapBuilder" value="convention"/>
<constant name="struts.convention.conventionsService" value="convention"/>
<constant name="struts.convention.result.path" value="/"/>
<constant name="struts.convention.result.flatLayout" value="true"/>
<constant name="struts.convention.action.suffix" value="Action"/>
<constant name="struts.convention.action.disableScanning" value="false"/>
<constant name="struts.convention.action.mapAllMatches" value="false"/>
<constant name="struts.convention.action.checkImplementsAction" value="true"/>
<constant name="struts.convention.default.parent.package" value="convention-default"/>
<constant name="struts.convention.action.name.lowercase" value="true"/>
<constant name="struts.convention.action.name.separator" value="-"/>
<constant name="struts.convention.package.locators" value="action,actions,struts,struts2"/>
<constant name="struts.convention.package.locators.disable" value="false"/>
<constant name="struts.convention.package.locators.basePackage" value=""/>
<constant name="struts.convention.exclude.packages" value="org.apache.struts.*,org.apache.struts2.*,org.springframework.web.struts.*,org.springframework.web.struts2.*,org.hibernate.*"/>
<constant name="struts.convention.relative.result.types" value="dispatcher,velocity,freemarker"/>
<constant name="struts.convention.redirect.to.slash" value="true"/>
<constant name="struts.convention.action.alwaysMapExecute" value="true"/>
<constant name="struts.mapper.alwaysSelectFullNamespace" value="true"/>
<!-- <constant name="struts.convention.action.includeJars" /> -->
<constant name="struts.convention.action.fileProtocols" value="jar" />
<constant name="struts.convention.classes.reload" value="false" />
<constant name="struts.convention.exclude.parentClassLoader" value="true" />
<package name="convention-default" extends="struts-default">
</package>
</struts>
@@ -1,37 +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.
-->
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="test" namespace="/sessiontest" extends="struts-default">
<action name="sessionSet" class="org.apache.struts2.session.SessionSetAction">
<result type="freemarker">/template-session.ftl</result>
</action>
<action name="sessionGet" class="org.apache.struts2.session.SessionGetAction">
<result type="freemarker">/template-session.ftl</result>
</action>
</package>
</struts>
@@ -1,21 +0,0 @@
<#--
~ $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.
-->
${Session.sessionKey}
@@ -1,25 +0,0 @@
<%--
~ $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.
--%>
<html>
<body>
This is the view
</body>
</html>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-plugin</artifactId>
@@ -12,9 +12,9 @@
<name>Struts 2 OSGi Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/osgi</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/osgi</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/osgi</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/osgi</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/osgi</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/osgi</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-oval-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 OVal Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/oval</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/oval</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/oval</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/oval</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/oval</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/oval</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-pell-multipart-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Pell Multipart Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/pell-multipart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/pell-multipart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/pell-multipart</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/pell-multipart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/pell-multipart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/pell-multipart</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plexus-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Plexus Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/plexus</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/plexus</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/plexus</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/plexus</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/plexus</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/plexus</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
@@ -34,9 +34,9 @@
<name>Struts Plugins</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins</url>
</scm>
<modules>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet-tiles-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Portlet Tiles Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/portlet-tiles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/portlet-tiles</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/portlet-tiles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/portlet-tiles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/portlet-tiles</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/portlet-tiles</url>
</scm>
<dependencies>
+4 -4
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet-plugin</artifactId>
@@ -11,9 +11,9 @@
<name>Struts 2 Portlet Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/portlet</url>
</scm>
<dependencies>
+2 -2
View File
@@ -26,11 +26,11 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-plugin</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<name>Struts 2 REST Plugin</name>
<properties>
@@ -78,28 +78,24 @@ public class DefaultContentTypeHandlerManager implements ContentTypeHandlerManag
}
}
}
/**
* Gets the handler for the request by looking at the request content type and extension
* @param request The request
* @param req The request
* @return The appropriate handler
*/
public ContentTypeHandler getHandlerForRequest(HttpServletRequest request) {
public ContentTypeHandler getHandlerForRequest(HttpServletRequest req) {
ContentTypeHandler handler = null;
String contentType = request.getContentType();
String contentType = req.getContentType();
if (contentType != null) {
int index = contentType.indexOf(';');
if( index != -1)
contentType = contentType.substring(0,index).trim();
handler = handlersByContentType.get(contentType);
if (handler == null) {
// strip off encoding and search again (e.g., application/json;charset=ISO-8859-1)
int index = contentType.indexOf(';');
if (index != -1) {
contentType = contentType.substring(0, index).trim();
}
handler = handlersByContentType.get(contentType);
}
}
if (handler == null) {
String extension = findExtension(request.getRequestURI());
String extension = findExtension(req.getRequestURI());
handler = handlersByExtension.get(extension);
}
return handler;
@@ -1,126 +0,0 @@
package org.apache.struts2.rest;
import com.opensymphony.xwork2.XWorkTestCase;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Scope;
import org.apache.struts2.rest.handler.ContentTypeHandler;
import org.springframework.mock.web.MockHttpServletRequest;
import java.io.IOException;
import java.io.Reader;
import java.io.Writer;
import java.util.HashSet;
import java.util.Set;
public class DefaultContentTypeHandlerManagerTest extends XWorkTestCase {
public void testObtainingHandlerForRequestWithEncoding() throws Exception {
// given
DefaultContentTypeHandlerManager handlerManager = new DefaultContentTypeHandlerManager();
handlerManager.setContainer(new DummyContainer("application/json;charset=UTF-8", null));
MockHttpServletRequest request = new MockHttpServletRequest();
request.setContentType("application/json;charset=UTF-8");
// when
ContentTypeHandler handler = handlerManager.getHandlerForRequest(request);
// then
assertNotNull(handler);
assertEquals("application/json;charset=UTF-8", handler.getContentType());
}
public void testObtainingHandlerForRequestWithoutEncoding() throws Exception {
// given
DefaultContentTypeHandlerManager handlerManager = new DefaultContentTypeHandlerManager();
handlerManager.setContainer(new DummyContainer("application/json", null));
MockHttpServletRequest request = new MockHttpServletRequest();
request.setContentType("application/json;charset=UTF-8");
// when
ContentTypeHandler handler = handlerManager.getHandlerForRequest(request);
// then
assertNotNull(handler);
assertEquals("application/json", handler.getContentType());
}
public void testObtainingHandlerForRequestByExtension() throws Exception {
// given
DefaultContentTypeHandlerManager handlerManager = new DefaultContentTypeHandlerManager();
handlerManager.setContainer(new DummyContainer("text/html", "json"));
MockHttpServletRequest request = new MockHttpServletRequest();
request.setContentType("application/json;charset=UTF-8");
request.setRequestURI("/index.json");
// when
ContentTypeHandler handler = handlerManager.getHandlerForRequest(request);
// then
assertNotNull(handler);
assertEquals("text/html", handler.getContentType());
assertEquals("json", handler.getExtension());
}
}
class DummyContainer implements Container {
private ContentTypeHandler handler;
DummyContainer(final String contentType, final String extension) {
handler = new ContentTypeHandler() {
public void toObject(Reader in, Object target) throws IOException {
}
public String fromObject(Object obj, String resultCode, Writer stream) throws IOException {
return null;
}
public String getContentType() {
return contentType;
}
public String getExtension() {
return extension;
}
};
}
public void inject(Object o) {
}
public <T> T inject(Class<T> implementation) {
return null;
}
public <T> T getInstance(Class<T> type, String name) {
if (name.startsWith(DefaultContentTypeHandlerManager.STRUTS_REST_HANDLER_OVERRIDE_PREFIX)) {
return null;
}
return (T) handler;
}
public <T> T getInstance(Class<T> type) {
return null;
}
public Set<String> getInstanceNames(Class<?> type) {
Set<String> handlers = new HashSet<String>();
handlers.add("handler");
return handlers;
}
public void setScopeStrategy(Scope.Strategy scopeStrategy) {
}
public void removeScopeStrategy() {
}
}
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitegraph-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Sitegraph Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/sitegraph</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/sitegraph</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/sitegraph</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/sitegraph</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/sitegraph</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/sitegraph</url>
</scm>
<build>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Sitemesh Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/sitemesh</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/sitemesh</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/sitemesh</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/sitemesh</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/sitemesh</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/sitemesh</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Spring Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/spring</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/spring</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/spring</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/spring</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/spring</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/spring</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Struts 1 Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/struts1</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/struts1</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/struts1</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/struts1</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/struts1</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/struts1</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-testng-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 TestNG Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/testng</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/testng</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/testng</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/testng</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/testng</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/testng</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Tiles Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/tiles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/tiles</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/tiles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/tiles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/tiles</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/tiles</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<artifactId>struts2-tiles3-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Tiles 3 Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/tiles3</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/plugins/tiles3</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13/plugins/tiles3</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/tiles3</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/plugins/tiles3</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/plugins/tiles3</url>
</scm>
<dependencies>
+4 -4
View File
@@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-parent</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<packaging>pom</packaging>
<name>Struts 2</name>
<url>http://struts.apache.org/2.x/</url>
@@ -28,9 +28,9 @@
-->
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_13</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12</url>
</scm>
<issueManagement>
+6 -6
View File
@@ -7,42 +7,42 @@
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-blank</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Blank</description>
</archetype>
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-convention</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Blank Convention</description>
</archetype>
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-dbportlet</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Database Portlet</description>
</archetype>
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-plugin</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Plugin</description>
</archetype>
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-portlet</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Portlet</description>
</archetype>
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-starter</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Starter</description>
</archetype>
+4 -4
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.13</version>
<version>2.3.12</version>
</parent>
<groupId>org.apache.struts.xwork</groupId>
@@ -15,9 +15,9 @@
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/xwork-core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/xwork-core</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_13/xwork-core</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/xwork-core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/xwork-core</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/xwork-core</url>
</scm>
<properties>
@@ -250,7 +250,7 @@ public class ObjectFactory implements Serializable {
* @param params property name -> value Map to set onto the Validator instance
* @param extraContext a Map of extra context which uses the same keys as the {@link com.opensymphony.xwork2.ActionContext}
*/
public Validator buildValidator(String className, Map<String, Object> params, Map<String, Object> extraContext) throws Exception {
public Validator buildValidator(String className, Map<String, String> params, Map<String, Object> extraContext) throws Exception {
Validator validator = (Validator) buildBean(className, null);
reflectionProvider.setProperties(params, validator);
@@ -15,5 +15,4 @@ public final class XWorkConstants {
public static final String ENABLE_OGNL_EXPRESSION_CACHE = "enableOGNLExpressionCache";
public static final String RELOAD_XML_CONFIGURATION = "reloadXmlConfiguration";
public static final String ALLOW_STATIC_METHOD_ACCESS = "allowStaticMethodAccess";
public static final String XWORK_LOGGER_FACTORY = "xwork.loggerFactory";
}
@@ -1,18 +1,3 @@
/*
* Copyright 2002-2006,2009 The Apache Software Foundation.
*
* Licensed 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 com.opensymphony.xwork2;
import com.opensymphony.xwork2.config.Configuration;
@@ -52,7 +52,10 @@ import com.opensymphony.xwork2.ognl.accessor.XWorkIteratorPropertyAccessor;
import com.opensymphony.xwork2.ognl.accessor.XWorkListPropertyAccessor;
import com.opensymphony.xwork2.ognl.accessor.XWorkMapPropertyAccessor;
import com.opensymphony.xwork2.ognl.accessor.XWorkMethodAccessor;
import com.opensymphony.xwork2.util.*;
import com.opensymphony.xwork2.util.CompoundRoot;
import com.opensymphony.xwork2.util.PatternMatcher;
import com.opensymphony.xwork2.util.ValueStackFactory;
import com.opensymphony.xwork2.util.WildcardHelper;
import com.opensymphony.xwork2.util.fs.DefaultFileManager;
import com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory;
import com.opensymphony.xwork2.util.location.LocatableProperties;
@@ -134,8 +137,6 @@ public class XWorkConfigurationProvider implements ConfigurationProvider {
.factory(MethodAccessor.class, Object.class.getName(), XWorkMethodAccessor.class, Scope.SINGLETON)
.factory(MethodAccessor.class, CompoundRoot.class.getName(), CompoundRootAccessor.class, Scope.SINGLETON)
.factory(TextParser.class, OgnlTextParser.class, Scope.SINGLETON)
.factory(NullHandler.class, Object.class.getName(), InstantiatingNullHandler.class, Scope.SINGLETON)
.factory(ActionValidatorManager.class, AnnotationActionValidatorManager.class, Scope.SINGLETON)
.factory(ActionValidatorManager.class, "no-annotations", DefaultActionValidatorManager.class, Scope.SINGLETON)
@@ -567,9 +567,10 @@ public class XmlConfigurationProvider implements ConfigurationProvider {
String paramName = null;
try {
paramName = (String) clazz.getField("DEFAULT_PARAM").get(null);
} catch (Throwable t) {
}
catch (Throwable t) {
if (LOG.isDebugEnabled()) {
LOG.debug("The result type [#0] doesn't have a default param [DEFAULT_PARAM] defined!", t, className);
LOG.debug("The result type #0 doesn't have a default param [DEFAULT_PARAM] defined", t, className);
}
}
ResultTypeConfig.Builder resultType = new ResultTypeConfig.Builder(name, className).defaultResultParam(paramName)
@@ -394,13 +394,6 @@ public class XWorkConverter extends DefaultTypeConverter {
* @return a TypeConverter to handle the specified class or null if none can be found
*/
public TypeConverter lookup(Class clazz) {
if (clazz.isPrimitive()) {
/**
* if it is primitive use default converter which allows to define different converters per type
* @see XWorkBasicConverter
*/
return defaultTypeConverter;
}
return lookup(clazz.getName());
}
@@ -332,7 +332,7 @@ public class ParametersInterceptor extends MethodFilterInterceptor {
String developerNotification = LocalizedTextUtil.findText(ParametersInterceptor.class, "devmode.notification", ActionContext.getContext().getLocale(), "Developer Notification:\n{0}", new Object[]{
"Unexpected Exception caught setting '" + name + "' on '" + action.getClass() + ": " + e.getMessage()
});
LOG.error(developerNotification, e);
LOG.error(developerNotification);
if (action instanceof ValidationAware) {
((ValidationAware) action).addActionMessage(developerNotification);
}
@@ -55,7 +55,7 @@ public class OgnlReflectionProvider implements ReflectionProvider {
}
public void setProperties(Map<String, ?> properties, Object o) {
public void setProperties(Map<String, String> properties, Object o) {
ognlUtil.setProperties(properties, o);
}
@@ -1,84 +0,0 @@
package com.opensymphony.xwork2.util;
import org.apache.commons.lang3.StringUtils;
/**
* OGNL implementation of {@link TextParser}
*/
public class OgnlTextParser implements TextParser {
public Object evaluate(char[] openChars, String expression, TextParseUtil.ParsedValueEvaluator evaluator, int maxLoopCount) {
// deal with the "pure" expressions first!
//expression = expression.trim();
Object result = expression;
for (char open : openChars) {
int loopCount = 1;
int pos = 0;
//this creates an implicit StringBuffer and shouldn't be used in the inner loop
final String lookupChars = open + "{";
while (true) {
int start = expression.indexOf(lookupChars, pos);
if (start == -1) {
pos = 0;
loopCount++;
start = expression.indexOf(lookupChars);
}
if (loopCount > maxLoopCount) {
// translateVariables prevent infinite loop / expression recursive evaluation
break;
}
int length = expression.length();
int x = start + 2;
int end;
char c;
int count = 1;
while (start != -1 && x < length && count != 0) {
c = expression.charAt(x++);
if (c == '{') {
count++;
} else if (c == '}') {
count--;
}
}
end = x - 1;
if ((start != -1) && (end != -1) && (count == 0)) {
String var = expression.substring(start + 2, end);
Object o = evaluator.evaluate(var);
String left = expression.substring(0, start);
String right = expression.substring(end + 1);
String middle = null;
if (o != null) {
middle = o.toString();
if (StringUtils.isEmpty(left)) {
result = o;
} else {
result = left.concat(middle);
}
if (StringUtils.isNotEmpty(right)) {
result = result.toString().concat(right);
}
expression = left.concat(middle).concat(right);
} else {
// the variable doesn't exist, so don't display anything
expression = left.concat(right);
result = expression;
}
pos = (left != null && left.length() > 0 ? left.length() - 1: 0) +
(middle != null && middle.length() > 0 ? middle.length() - 1: 0) +
1;
pos = Math.max(pos, 1);
} else {
break;
}
}
}
return result;
}
}
@@ -22,6 +22,8 @@ import com.opensymphony.xwork2.inject.Container;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
/**
* Utility class for text parsing.
@@ -151,26 +153,84 @@ public class TextParseUtil {
* @param evaluator
* @return Converted object from variable translation.
*/
public static Object translateVariables(char[] openChars, String expression, final ValueStack stack, final Class asType, final ParsedValueEvaluator evaluator, int maxLoopCount) {
public static Object translateVariables(char[] openChars, String expression, ValueStack stack, Class asType, ParsedValueEvaluator evaluator, int maxLoopCount) {
// deal with the "pure" expressions first!
//expression = expression.trim();
Object result = expression;
for (char open : openChars) {
int loopCount = 1;
int pos = 0;
//this creates an implicit StringBuffer and shouldn't be used in the inner loop
final String lookupChars = open + "{";
ParsedValueEvaluator ognlEval = new ParsedValueEvaluator() {
public Object evaluate(String parsedValue) {
Object o = stack.findValue(parsedValue, asType);
if (evaluator != null) {
o = evaluator.evaluate(o.toString());
while (true) {
int start = expression.indexOf(lookupChars, pos);
if (start == -1) {
pos = 0;
loopCount++;
start = expression.indexOf(lookupChars);
}
if (loopCount > maxLoopCount) {
// translateVariables prevent infinite loop / expression recursive evaluation
break;
}
int length = expression.length();
int x = start + 2;
int end;
char c;
int count = 1;
while (start != -1 && x < length && count != 0) {
c = expression.charAt(x++);
if (c == '{') {
count++;
} else if (c == '}') {
count--;
}
}
end = x - 1;
if ((start != -1) && (end != -1) && (count == 0)) {
String var = expression.substring(start + 2, end);
Object o = stack.findValue(var, asType);
if (evaluator != null) {
o = evaluator.evaluate(o);
}
String left = expression.substring(0, start);
String right = expression.substring(end + 1);
String middle = null;
if (o != null) {
middle = o.toString();
if (StringUtils.isEmpty(left)) {
result = o;
} else {
result = left.concat(middle);
}
if (StringUtils.isNotEmpty(right)) {
result = result.toString().concat(right);
}
expression = left.concat(middle).concat(right);
} else {
// the variable doesn't exist, so don't display anything
expression = left.concat(right);
result = expression;
}
pos = (left != null && left.length() > 0 ? left.length() - 1: 0) +
(middle != null && middle.length() > 0 ? middle.length() - 1: 0) +
1;
pos = Math.max(pos, 1);
} else {
break;
}
return o;
}
};
TextParser parser = ((Container)stack.getContext().get(ActionContext.CONTAINER)).getInstance(TextParser.class);
}
XWorkConverter conv = ((Container)stack.getContext().get(ActionContext.CONTAINER)).getInstance(XWorkConverter.class);
Object result = parser.evaluate(openChars, expression, ognlEval, maxLoopCount);
return conv.convertValue(stack.getContext(), result, asType);
}
@@ -219,6 +279,6 @@ public class TextParseUtil {
* @param parsedValue - value parsed by ognl value stack
* @return return the evaluted value.
*/
Object evaluate(String parsedValue);
Object evaluate(Object parsedValue);
}
}
@@ -1,11 +0,0 @@
package com.opensymphony.xwork2.util;
/**
* Used to parse expressions like ${foo.bar} or %{bar.foo} but it is up tp the TextParser's
* implementation what kind of opening char to use (#, $, %, etc)
*/
public interface TextParser {
Object evaluate(char[] openChars, String expression, TextParseUtil.ParsedValueEvaluator evaluator, int maxLoopCount);
}
@@ -41,8 +41,6 @@ public interface Logger {
void warn(String msg, String... args);
void warn(String msg, Object... args);
void warn(String msg, Throwable ex, String... args);
boolean isWarnEnabled();
@@ -15,8 +15,6 @@
*/
package com.opensymphony.xwork2.util.logging;
import com.opensymphony.xwork2.XWorkConstants;
import com.opensymphony.xwork2.XWorkException;
import com.opensymphony.xwork2.util.logging.jdk.JdkLoggerFactory;
import com.opensymphony.xwork2.util.logging.slf4j.Slf4jLoggerFactory;
@@ -27,7 +25,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
* Creates loggers. Static accessor will lazily try to decide on the best factory if none specified.
*/
public abstract class LoggerFactory {
private static final ReadWriteLock lock = new ReentrantReadWriteLock();
private static LoggerFactory factory;
@@ -61,26 +59,16 @@ public abstract class LoggerFactory {
lock.writeLock().lock();
try {
if (factory == null) {
String userLoggerFactory = System.getProperty(XWorkConstants.XWORK_LOGGER_FACTORY);
if (userLoggerFactory != null) {
try {
Class clazz = Class.forName(userLoggerFactory);
factory = (LoggerFactory) clazz.newInstance();
} catch (Exception e) {
throw new XWorkException("System property [" + XWorkConstants.XWORK_LOGGER_FACTORY +
"] was defined as [" + userLoggerFactory + "] but there is a problem to use that LoggerFactory!", e);
}
}
try {
Class.forName("org.apache.commons.logging.LogFactory");
factory = new com.opensymphony.xwork2.util.logging.commons.CommonsLoggerFactory();
Class.forName("org.slf4j.LoggerFactory");
factory = new Slf4jLoggerFactory();
} catch (ClassNotFoundException ex) {
//commons-logging not found try slf4j LogFactory
//slf4j not found try commons LogFactory
try {
Class.forName("org.slf4j.LoggerFactory");
factory = new Slf4jLoggerFactory();
Class.forName("org.apache.commons.logging.LogFactory");
factory = new com.opensymphony.xwork2.util.logging.commons.CommonsLoggerFactory();
} catch (ClassNotFoundException cnfex) {
// slf4j not found, falling back to jdk logging
// commons logging not found, falling back to jdk logging
factory = new JdkLoggerFactory();
}
}
@@ -56,10 +56,6 @@ public class CommonsLogger implements Logger {
log.warn(LoggerUtils.format(msg, args));
}
public void warn(String msg, Object... args) {
log.warn(LoggerUtils.format(msg, args));
}
public void warn(String msg, Throwable ex, String... args) {
log.warn(LoggerUtils.format(msg, args), ex);
}
@@ -63,10 +63,6 @@ public class JdkLogger implements Logger {
log.log(Level.WARNING, LoggerUtils.format(msg, args));
}
public void warn(String msg, Object... args) {
log.log(Level.WARNING, LoggerUtils.format(msg, args));
}
public void warn(String msg, Throwable ex, String... args) {
log.log(Level.WARNING, LoggerUtils.format(msg, args), ex);
}
@@ -53,10 +53,6 @@ public class Slf4jLogger implements Logger {
log.warn(LoggerUtils.format(msg, args));
}
public void warn(String msg, Object... args) {
log.warn(LoggerUtils.format(msg, args));
}
public void warn(String msg, Throwable ex, String... args) {
log.warn(LoggerUtils.format(msg, args), ex);
}
@@ -43,7 +43,7 @@ public interface ReflectionProvider {
* @param properties
* @param o
*/
void setProperties(Map<String, ?> properties, Object o);
void setProperties(Map<String, String> properties, Object o);
/**
* This method returns a PropertyDescriptor for the given class and property name using
@@ -15,38 +15,14 @@
*/
package com.opensymphony.xwork2.validator;
import com.opensymphony.xwork2.validator.annotations.ConditionalVisitorFieldValidator;
import com.opensymphony.xwork2.validator.annotations.ConversionErrorFieldValidator;
import com.opensymphony.xwork2.validator.annotations.CustomValidator;
import com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator;
import com.opensymphony.xwork2.validator.annotations.DoubleRangeFieldValidator;
import com.opensymphony.xwork2.validator.annotations.EmailValidator;
import com.opensymphony.xwork2.validator.annotations.ExpressionValidator;
import com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator;
import com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator;
import com.opensymphony.xwork2.validator.annotations.RegexFieldValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
import com.opensymphony.xwork2.validator.annotations.ShortRangeFieldValidator;
import com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator;
import com.opensymphony.xwork2.validator.annotations.UrlValidator;
import com.opensymphony.xwork2.validator.annotations.Validation;
import com.opensymphony.xwork2.validator.annotations.ValidationParameter;
import com.opensymphony.xwork2.validator.annotations.Validations;
import com.opensymphony.xwork2.validator.annotations.VisitorFieldValidator;
import org.apache.commons.lang3.StringUtils;
import com.opensymphony.xwork2.validator.annotations.*;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -102,11 +78,12 @@ public class AnnotationValidationConfigurationBuilder {
// Process single custom validator
if (a instanceof Validation) {
Validation v = (Validation) a;
if (v.validations() != null) {
for (Validations val : v.validations()) {
processValidationAnnotation(val, fieldName, methodName, result);
if ( v.validations() != null ) {
for ( Validations val: v.validations()) {
processValidationAnnotation(val , fieldName, methodName, result);
}
}
}
// Process single custom validator
else if (a instanceof ExpressionValidator) {
@@ -115,6 +92,7 @@ public class AnnotationValidationConfigurationBuilder {
if (temp != null) {
result.add(temp);
}
}
// Process single custom validator
else if (a instanceof CustomValidator) {
@@ -123,121 +101,133 @@ public class AnnotationValidationConfigurationBuilder {
if (temp != null) {
result.add(temp);
}
}
// Process ConversionErrorFieldValidator
else if (a instanceof ConversionErrorFieldValidator) {
else if ( a instanceof ConversionErrorFieldValidator) {
ConversionErrorFieldValidator v = (ConversionErrorFieldValidator) a;
ValidatorConfig temp = processConversionErrorFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process DateRangeFieldValidator
else if (a instanceof DateRangeFieldValidator) {
else if ( a instanceof DateRangeFieldValidator) {
DateRangeFieldValidator v = (DateRangeFieldValidator) a;
ValidatorConfig temp = processDateRangeFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process EmailValidator
else if (a instanceof EmailValidator) {
else if ( a instanceof EmailValidator) {
EmailValidator v = (EmailValidator) a;
ValidatorConfig temp = processEmailValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process FieldExpressionValidator
else if (a instanceof FieldExpressionValidator) {
else if ( a instanceof FieldExpressionValidator) {
FieldExpressionValidator v = (FieldExpressionValidator) a;
ValidatorConfig temp = processFieldExpressionValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process IntRangeFieldValidator
else if (a instanceof IntRangeFieldValidator) {
else if ( a instanceof IntRangeFieldValidator) {
IntRangeFieldValidator v = (IntRangeFieldValidator) a;
ValidatorConfig temp = processIntRangeFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process ShortRangeFieldValidator
else if (a instanceof ShortRangeFieldValidator) {
else if ( a instanceof ShortRangeFieldValidator) {
ShortRangeFieldValidator v = (ShortRangeFieldValidator) a;
ValidatorConfig temp = processShortRangeFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process DoubleRangeFieldValidator
else if (a instanceof DoubleRangeFieldValidator) {
else if ( a instanceof DoubleRangeFieldValidator) {
DoubleRangeFieldValidator v = (DoubleRangeFieldValidator) a;
ValidatorConfig temp = processDoubleRangeFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process RequiredFieldValidator
else if (a instanceof RequiredFieldValidator) {
else if ( a instanceof RequiredFieldValidator) {
RequiredFieldValidator v = (RequiredFieldValidator) a;
ValidatorConfig temp = processRequiredFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process RequiredStringValidator
else if (a instanceof RequiredStringValidator) {
else if ( a instanceof RequiredStringValidator) {
RequiredStringValidator v = (RequiredStringValidator) a;
ValidatorConfig temp = processRequiredStringValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process StringLengthFieldValidator
else if (a instanceof StringLengthFieldValidator) {
else if ( a instanceof StringLengthFieldValidator) {
StringLengthFieldValidator v = (StringLengthFieldValidator) a;
ValidatorConfig temp = processStringLengthFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process UrlValidator
else if (a instanceof UrlValidator) {
else if ( a instanceof UrlValidator) {
UrlValidator v = (UrlValidator) a;
ValidatorConfig temp = processUrlValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process ConditionalVisitorFieldValidator
else if (a instanceof ConditionalVisitorFieldValidator) {
else if ( a instanceof ConditionalVisitorFieldValidator) {
ConditionalVisitorFieldValidator v = (ConditionalVisitorFieldValidator) a;
ValidatorConfig temp = processConditionalVisitorFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process VisitorFieldValidator
else if (a instanceof VisitorFieldValidator) {
else if ( a instanceof VisitorFieldValidator) {
VisitorFieldValidator v = (VisitorFieldValidator) a;
ValidatorConfig temp = processVisitorFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
// Process RegexFieldValidator
else if (a instanceof RegexFieldValidator) {
else if ( a instanceof RegexFieldValidator) {
RegexFieldValidator v = (RegexFieldValidator) a;
ValidatorConfig temp = processRegexFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
if ( temp != null) {
result.add(temp);
}
}
}
}
@@ -247,7 +237,7 @@ public class AnnotationValidationConfigurationBuilder {
private void processValidationAnnotation(Annotation a, String fieldName, String methodName, List<ValidatorConfig> result) {
Validations validations = (Validations) a;
CustomValidator[] cv = validations.customValidators();
if (cv != null) {
if ( cv != null ) {
for (CustomValidator v : cv) {
ValidatorConfig temp = processCustomValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -256,7 +246,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
ExpressionValidator[] ev = validations.expressions();
if (ev != null) {
if ( ev != null ) {
for (ExpressionValidator v : ev) {
ValidatorConfig temp = processExpressionValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -265,7 +255,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
ConversionErrorFieldValidator[] cef = validations.conversionErrorFields();
if (cef != null) {
if ( cef != null ) {
for (ConversionErrorFieldValidator v : cef) {
ValidatorConfig temp = processConversionErrorFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -274,7 +264,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
DateRangeFieldValidator[] drfv = validations.dateRangeFields();
if (drfv != null) {
if ( drfv != null ) {
for (DateRangeFieldValidator v : drfv) {
ValidatorConfig temp = processDateRangeFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -283,7 +273,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
EmailValidator[] emv = validations.emails();
if (emv != null) {
if ( emv != null ) {
for (EmailValidator v : emv) {
ValidatorConfig temp = processEmailValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -292,7 +282,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
FieldExpressionValidator[] fev = validations.fieldExpressions();
if (fev != null) {
if ( fev != null ) {
for (FieldExpressionValidator v : fev) {
ValidatorConfig temp = processFieldExpressionValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -301,7 +291,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
IntRangeFieldValidator[] irfv = validations.intRangeFields();
if (irfv != null) {
if ( irfv != null ) {
for (IntRangeFieldValidator v : irfv) {
ValidatorConfig temp = processIntRangeFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -310,7 +300,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
RegexFieldValidator[] rfv = validations.regexFields();
if (rfv != null) {
if ( rfv != null ) {
for (RegexFieldValidator v : rfv) {
ValidatorConfig temp = processRegexFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -319,7 +309,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
RequiredFieldValidator[] rv = validations.requiredFields();
if (rv != null) {
if ( rv != null ) {
for (RequiredFieldValidator v : rv) {
ValidatorConfig temp = processRequiredFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -328,7 +318,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
RequiredStringValidator[] rsv = validations.requiredStrings();
if (rsv != null) {
if ( rsv != null ) {
for (RequiredStringValidator v : rsv) {
ValidatorConfig temp = processRequiredStringValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -337,7 +327,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
StringLengthFieldValidator[] slfv = validations.stringLengthFields();
if (slfv != null) {
if ( slfv != null ) {
for (StringLengthFieldValidator v : slfv) {
ValidatorConfig temp = processStringLengthFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -346,7 +336,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
UrlValidator[] uv = validations.urls();
if (uv != null) {
if ( uv != null ) {
for (UrlValidator v : uv) {
ValidatorConfig temp = processUrlValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -355,7 +345,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
ConditionalVisitorFieldValidator[] cvfv = validations.conditionalVisitorFields();
if (cvfv != null) {
if ( cvfv != null ) {
for (ConditionalVisitorFieldValidator v : cvfv) {
ValidatorConfig temp = processConditionalVisitorFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -364,7 +354,7 @@ public class AnnotationValidationConfigurationBuilder {
}
}
VisitorFieldValidator[] vfv = validations.visitorFields();
if (vfv != null) {
if ( vfv != null ) {
for (VisitorFieldValidator v : vfv) {
ValidatorConfig temp = processVisitorFieldValidatorAnnotation(v, fieldName, methodName);
if (temp != null) {
@@ -377,7 +367,7 @@ public class AnnotationValidationConfigurationBuilder {
private ValidatorConfig processExpressionValidatorAnnotation(ExpressionValidator v, String fieldName, String methodName) {
String validatorType = "expression";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
@@ -387,22 +377,22 @@ public class AnnotationValidationConfigurationBuilder {
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processCustomValidatorAnnotation(CustomValidator v, String fieldName, String methodName) {
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
@@ -413,7 +403,7 @@ public class AnnotationValidationConfigurationBuilder {
Annotation[] recursedAnnotations = v.parameters();
if (recursedAnnotations != null) {
if ( recursedAnnotations != null ) {
for (Annotation a2 : recursedAnnotations) {
if (a2 instanceof ValidationParameter) {
@@ -428,52 +418,45 @@ public class AnnotationValidationConfigurationBuilder {
}
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processRegexFieldValidatorAnnotation(RegexFieldValidator v, String fieldName, String methodName) {
String validatorType = "regex";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
params.put("regex", v.regex());
params.put("regexExpression", v.regexExpression());
params.put("expression", v.expression());
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.addParam("trim", v.trim())
.addParam("trimExpression", v.trimExpression())
.addParam("caseSensitive", v.caseSensitive())
.addParam("caseSensitiveExpression", v.caseSensitiveExpression())
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processConditionalVisitorFieldValidatorAnnotation(ConditionalVisitorFieldValidator v, String fieldName, String methodName) {
String validatorType = "conditionalvisitor";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
@@ -483,24 +466,25 @@ public class AnnotationValidationConfigurationBuilder {
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processVisitorFieldValidatorAnnotation(VisitorFieldValidator v, String fieldName, String methodName) {
String validatorType = "visitor";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
@@ -509,86 +493,70 @@ public class AnnotationValidationConfigurationBuilder {
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processUrlValidatorAnnotation(UrlValidator v, String fieldName, String methodName) {
String validatorType = "url";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processStringLengthFieldValidatorAnnotation(StringLengthFieldValidator v, String fieldName, String methodName) {
String validatorType = "stringlength";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (StringUtils.isNotEmpty(v.fieldName())) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
if (StringUtils.isNotEmpty(v.maxLength())) {
if ( v.maxLength() != null && v.maxLength().length() > 0) {
params.put("maxLength", v.maxLength());
}
if (StringUtils.isNotEmpty(v.minLength())) {
if ( v.minLength() != null && v.minLength().length() > 0) {
params.put("minLength", v.minLength());
}
if (StringUtils.isNotEmpty(v.maxLengthExpression())) {
params.put("maxLengthExpression", v.maxLengthExpression());
}
if (StringUtils.isNotEmpty(v.minLengthExpression())) {
params.put("minLengthExpression", v.minLengthExpression());
}
if (StringUtils.isNotEmpty(v.trimExpression())){
params.put("trimExpression", v.trimExpression());
} else {
params.put("trim", String.valueOf(v.trim()));
}
params.put("trim", String.valueOf(v.trim()));
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private Date parseDateString(String value, String format) {
private Date parseDateString(String value) {
SimpleDateFormat d0 = null;
if (StringUtils.isNotEmpty(format)) {
d0 = new SimpleDateFormat(format);
}
SimpleDateFormat d1 = (SimpleDateFormat) DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.LONG, Locale.getDefault());
SimpleDateFormat d2 = (SimpleDateFormat) DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, Locale.getDefault());
SimpleDateFormat d3 = (SimpleDateFormat) DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.getDefault());
SimpleDateFormat[] dfs = (d0 != null ? new SimpleDateFormat[]{d0, d1, d2, d3} : new SimpleDateFormat[]{d1, d2, d3});
SimpleDateFormat d2 = (SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM, Locale.getDefault());
SimpleDateFormat d3 = (SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.getDefault());
SimpleDateFormat[] dfs = {d1, d2, d3};
for (SimpleDateFormat df : dfs)
try {
Date check = df.parse(value);
@@ -598,16 +566,17 @@ public class AnnotationValidationConfigurationBuilder {
} catch (ParseException ignore) {
}
return null;
}
private ValidatorConfig processRequiredStringValidatorAnnotation(RequiredStringValidator v, String fieldName, String methodName) {
String validatorType = "requiredstring";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
@@ -615,165 +584,134 @@ public class AnnotationValidationConfigurationBuilder {
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageParams(v.messageParams())
.messageKey(v.key())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processRequiredFieldValidatorAnnotation(RequiredFieldValidator v, String fieldName, String methodName) {
String validatorType = "required";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processIntRangeFieldValidatorAnnotation(IntRangeFieldValidator v, String fieldName, String methodName) {
String validatorType = "int";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
if (v.min() != null && v.min().length() > 0) {
if ( v.min() != null && v.min().length() > 0) {
params.put("min", v.min());
}
if (v.max() != null && v.max().length() > 0) {
if ( v.max() != null && v.max().length() > 0) {
params.put("max", v.max());
}
if (StringUtils.isNotEmpty(v.maxExpression())) {
params.put("maxExpression", v.maxExpression());
}
if (StringUtils.isNotEmpty(v.minExpression())) {
params.put("minExpression", v.minExpression());
}
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processShortRangeFieldValidatorAnnotation(ShortRangeFieldValidator v, String fieldName, String methodName) {
String validatorType = "short";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
if (StringUtils.isNotEmpty(v.min())) {
if ( v.min() != null && v.min().length() > 0) {
params.put("min", v.min());
}
if (StringUtils.isNotEmpty(v.max())) {
if ( v.max() != null && v.max().length() > 0) {
params.put("max", v.max());
}
if (StringUtils.isNotEmpty(v.maxExpression())) {
params.put("maxExpression", v.maxExpression());
}
if (StringUtils.isNotEmpty(v.minExpression())) {
params.put("minExpression", v.minExpression());
}
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processDoubleRangeFieldValidatorAnnotation(DoubleRangeFieldValidator v, String fieldName, String methodName) {
String validatorType = "double";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
if (v.minInclusive() != null && v.minInclusive().length() > 0) {
if ( v.minInclusive() != null && v.minInclusive().length() > 0) {
params.put("minInclusive", v.minInclusive());
}
if (v.maxInclusive() != null && v.maxInclusive().length() > 0) {
if ( v.maxInclusive() != null && v.maxInclusive().length() > 0) {
params.put("maxInclusive", v.maxInclusive());
}
if (v.minExclusive() != null && v.minExclusive().length() > 0) {
if ( v.minExclusive() != null && v.minExclusive().length() > 0) {
params.put("minExclusive", v.minExclusive());
}
if (v.maxExclusive() != null && v.maxExclusive().length() > 0) {
if ( v.maxExclusive() != null && v.maxExclusive().length() > 0) {
params.put("maxExclusive", v.maxExclusive());
}
if (StringUtils.isNotEmpty(v.minInclusiveExpression())) {
params.put("minInclusiveExpression", v.minInclusiveExpression());
}
if (StringUtils.isNotEmpty(v.maxInclusiveExpression())) {
params.put("maxInclusiveExpression", v.maxInclusiveExpression());
}
if (StringUtils.isNotEmpty(v.minExclusiveExpression())) {
params.put("minExclusiveExpression", v.minExclusiveExpression());
}
if (StringUtils.isNotEmpty(v.maxExclusiveExpression())) {
params.put("maxExclusiveExpression", v.maxExclusiveExpression());
}
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processFieldExpressionValidatorAnnotation(FieldExpressionValidator v, String fieldName, String methodName) {
String validatorType = "fieldexpression";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
@@ -781,95 +719,83 @@ public class AnnotationValidationConfigurationBuilder {
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processEmailValidatorAnnotation(EmailValidator v, String fieldName, String methodName) {
String validatorType = "email";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processDateRangeFieldValidatorAnnotation(DateRangeFieldValidator v, String fieldName, String methodName) {
String validatorType = "date";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
if (v.min() != null && v.min().length() > 0) {
final Date minDate = parseDateString(v.min(), v.dateFormat());
params.put("min", minDate == null ? v.min() : minDate);
if ( v.min() != null && v.min().length() > 0) {
final Date minDate = parseDateString(v.min());
params.put("min", String.valueOf(minDate == null ? v.min() : minDate));
}
if (v.max() != null && v.max().length() > 0) {
final Date maxDate = parseDateString(v.max(), v.dateFormat());
params.put("max", maxDate == null ? v.max() : maxDate);
}
if (StringUtils.isNotEmpty(v.minExpression())) {
params.put("minExpression", v.minExpression());
}
if (StringUtils.isNotEmpty(v.maxExpression())) {
params.put("maxExpression", v.maxExpression());
if ( v.max() != null && v.max().length() > 0) {
final Date maxDate = parseDateString(v.max());
params.put("max", String.valueOf(maxDate == null ? v.max() : maxDate));
}
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
private ValidatorConfig processConversionErrorFieldValidatorAnnotation(ConversionErrorFieldValidator v, String fieldName, String methodName) {
String validatorType = "conversion";
Map<String, Object> params = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
if (fieldName != null) {
params.put("fieldName", fieldName);
} else if (v.fieldName() != null && v.fieldName().length() > 0) {
} else if (v.fieldName() != null && v.fieldName().length() > 0 ) {
params.put("fieldName", v.fieldName());
}
validatorFactory.lookupRegisteredValidatorType(validatorType);
return new ValidatorConfig.Builder(validatorType)
.addParams(params)
.addParam("methodName", methodName)
.addParam("repopulateField", v.repopulateField())
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.messageParams(v.messageParams())
.build();
.addParams(params)
.addParam("methodName", methodName)
.shortCircuit(v.shortCircuit())
.defaultMessage(v.message())
.messageKey(v.key())
.build();
}
public List<ValidatorConfig> buildAnnotationClassValidatorConfigs(Class aClass) {
@@ -883,7 +809,7 @@ public class AnnotationValidationConfigurationBuilder {
Method[] methods = aClass.getDeclaredMethods();
if (methods != null) {
if ( methods != null ) {
for (Method method : methods) {
temp = processAnnotations(method);
if (temp != null) {
@@ -88,13 +88,13 @@ public class DefaultValidatorFileParser implements ValidatorFileParser {
// it will not cause field-level validator to be kicked off.
{
NodeList validatorNodes = doc.getElementsByTagName("validator");
addValidatorConfigs(validatorFactory, validatorNodes, new HashMap<String, Object>(), validatorCfgs);
addValidatorConfigs(validatorFactory, validatorNodes, new HashMap<String, String>(), validatorCfgs);
}
for (int i = 0; i < fieldNodes.getLength(); i++) {
Element fieldElement = (Element) fieldNodes.item(i);
String fieldName = fieldElement.getAttribute("name");
Map<String, Object> extraParams = new HashMap<String, Object>();
Map<String, String> extraParams = new HashMap<String, String>();
extraParams.put("fieldName", fieldName);
NodeList validatorNodes = fieldElement.getElementsByTagName("field-validator");
@@ -127,7 +127,7 @@ public class DefaultValidatorFileParser implements ValidatorFileParser {
try {
// catch any problems here
objectFactory.buildValidator(className, new HashMap<String, Object>(), null);
objectFactory.buildValidator(className, new HashMap<String, String>(), null);
validators.put(name, className);
} catch (Exception e) {
throw new ConfigurationException("Unable to load validator class " + className, e, validatorElement);
@@ -166,11 +166,11 @@ public class DefaultValidatorFileParser implements ValidatorFileParser {
return value.toString().trim();
}
private void addValidatorConfigs(ValidatorFactory factory, NodeList validatorNodes, Map<String, Object> extraParams, List<ValidatorConfig> validatorCfgs) {
private void addValidatorConfigs(ValidatorFactory factory, NodeList validatorNodes, Map<String, String> extraParams, List<ValidatorConfig> validatorCfgs) {
for (int j = 0; j < validatorNodes.getLength(); j++) {
Element validatorElement = (Element) validatorNodes.item(j);
String validatorType = validatorElement.getAttribute("type");
Map<String, Object> params = new HashMap<String, Object>(extraParams);
Map<String, String> params = new HashMap<String, String>(extraParams);
params.putAll(XmlHelper.getParams(validatorElement));
@@ -34,7 +34,7 @@ import java.util.Map;
public class ValidatorConfig extends Located {
private String type;
private Map<String, Object> params;
private Map<String,String> params;
private String defaultMessage;
private String messageKey;
private boolean shortCircuit;
@@ -45,12 +45,12 @@ public class ValidatorConfig extends Located {
*/
protected ValidatorConfig(String validatorType) {
this.type = validatorType;
params = new LinkedHashMap<String, Object>();
params = new LinkedHashMap<String, String>();
}
protected ValidatorConfig(ValidatorConfig orig) {
this.type = orig.type;
this.params = new LinkedHashMap<String,Object>(orig.params);
this.params = new LinkedHashMap<String,String>(orig.params);
this.defaultMessage = orig.defaultMessage;
this.messageKey = orig.messageKey;
this.shortCircuit = orig.shortCircuit;
@@ -82,7 +82,7 @@ public class ValidatorConfig extends Located {
/**
* @return Returns the configured params to set on the validator.
*/
public Map<String, Object> getParams() {
public Map<String, String> getParams() {
return params;
}
@@ -138,14 +138,14 @@ public class ValidatorConfig extends Located {
return this;
}
public Builder addParam(String name, Object value) {
public Builder addParam(String name, String value) {
if (value != null && name != null) {
target.params.put(name, value);
}
return this;
}
public Builder addParams(Map<String,Object> params) {
public Builder addParams(Map<String,String> params) {
target.params.putAll(params);
return this;
}

Some files were not shown because too many files have changed in this diff Show More