Compare commits

..

19 Commits

Author SHA1 Message Date
Lukasz Lenart 183be6b298 [maven-release-plugin] copy for tag STRUTS_2_3_3
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3@1326478 13f79535-47bb-0310-9956-ffa450edef68
2012-04-16 04:34:27 +00:00
Lukasz Lenart 6411771bb0 [maven-release-plugin] prepare release STRUTS_2_3_3
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1326477 13f79535-47bb-0310-9956-ffa450edef68
2012-04-16 04:34:13 +00:00
Lukasz Lenart f45597252f WW-3798 changes params for wget to download just WW spaces
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1326396 13f79535-47bb-0310-9956-ffa450edef68
2012-04-15 18:49:00 +00:00
Lukasz Lenart 6a4240bdf0 WW-3791 prepares test build
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1326342 13f79535-47bb-0310-9956-ffa450edef68
2012-04-15 14:02:27 +00:00
Lukasz Lenart e9a12de7ee Reverst site link to dev one
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1326062 13f79535-47bb-0310-9956-ffa450edef68
2012-04-14 07:07:49 +00:00
Lukasz Lenart abd628ea09 WW-3442 adds additional initialisation of HttpSession
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1324893 13f79535-47bb-0310-9956-ffa450edef68
2012-04-11 17:49:35 +00:00
Lukasz Lenart 78ee4b8ba2 WW-3796 Changes logic to set encoding on HttpServletRequest if differs from configured
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1324888 13f79535-47bb-0310-9956-ffa450edef68
2012-04-11 17:41:06 +00:00
Lukasz Lenart 4f07559dc1 WW-3431 Solves problem with array initialization
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1324871 13f79535-47bb-0310-9956-ffa450edef68
2012-04-11 17:13:42 +00:00
Lukasz Lenart f064937984 WW-3059 Changes logic to set encoding for XMLHttpRequest type
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1324870 13f79535-47bb-0310-9956-ffa450edef68
2012-04-11 17:12:35 +00:00
Maurizio Cucchiara a99dadfebf Update commons lang3 reference
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1324674 13f79535-47bb-0310-9956-ffa450edef68
2012-04-11 09:42:13 +00:00
Lukasz Lenart 5c15306366 WW-3442 adds Session initialisation method to solve problem with missing session and allow to initialise session on its own in test cases
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1311951 13f79535-47bb-0310-9956-ffa450edef68
2012-04-10 19:33:51 +00:00
Lukasz Lenart ecc0e56440 WW-3432 pushes messages variables to allow customize validation messages
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1311945 13f79535-47bb-0310-9956-ffa450edef68
2012-04-10 19:29:09 +00:00
Lukasz Lenart b90fe0996f WW-3418 solves problem with excludePackages
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1311931 13f79535-47bb-0310-9956-ffa450edef68
2012-04-10 19:04:57 +00:00
Lukasz Lenart 2dacf99394 Removes strange file
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1311908 13f79535-47bb-0310-9956-ffa450edef68
2012-04-10 18:28:32 +00:00
Lukasz Lenart c8850cb558 WW-3413 removes unneeded dependencies
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1311903 13f79535-47bb-0310-9956-ffa450edef68
2012-04-10 18:22:01 +00:00
Lukasz Lenart a377ce5c40 WW-3173 adds additional test case to proof that there is no error
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1311902 13f79535-47bb-0310-9956-ffa450edef68
2012-04-10 18:20:25 +00:00
Lukasz Lenart 7146f389c7 WW-3795 allows specify location as a relative for result type plainText and add possibility to extend class by overriding protected methods
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1311895 13f79535-47bb-0310-9956-ffa450edef68
2012-04-10 18:07:16 +00:00
Lukasz Lenart 73da07e6af WW-3793 corrects name of PlainText Result in documentation to be plainText and not plaintext
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1311872 13f79535-47bb-0310-9956-ffa450edef68
2012-04-10 17:15:38 +00:00
Lukasz Lenart cbb55e9793 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1310831 13f79535-47bb-0310-9956-ffa450edef68
2012-04-07 19:28:23 +00:00
66 changed files with 522 additions and 302 deletions
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/apps/blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/apps/jboss-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/apps/mailreader</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/apps</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/apps/portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>2.3.2</version>
<version>2.3.3</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.2</version>
<version>2.3.3</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_2/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/apps/showcase</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/apps/showcase</url>
</scm>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-blank</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-blank</url>
</scm>
<properties>
@@ -46,20 +46,6 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>2.0.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.5.RELEASE</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.2</version>
<version>2.3.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-convention</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-convention</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-convention</url>
</scm>
<properties>
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.2</version>
<version>2.3.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-dbportlet</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-dbportlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-plugin</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-portlet</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-starter</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/archetypes/struts2-archetype-starter</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/archetypes/struts2-archetype-starter</url>
</scm>
<properties>
+6 -4
View File
@@ -11,13 +11,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.2</version>
<version>2.3.3</version>
</parent>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/assembly</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/assembly</url>
</scm>
<profiles>
@@ -276,6 +276,8 @@
<arg value="-nv" />
<arg value="-E" />
<arg value="-L" />
<arg value="-l 0" />
<arg value="-np" />
<arg value="--directory-prefix=${project.build.directory}/cwiki" />
<arg value="--no-check-certificate" />
<arg value="-r" />
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/bundles/admin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/bundles/demo</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/bundles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/core</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/core</url>
</scm>
<properties>
@@ -679,6 +679,10 @@ public class Dispatcher {
if (defaultEncoding != null) {
encoding = defaultEncoding;
}
// check for Ajax request to use UTF-8 encoding strictly http://www.w3.org/TR/XMLHttpRequest/#the-send-method
if ("XMLHttpRequest".equals(request.getHeader("X-Requested-With"))) {
encoding = "utf-8";
}
Locale locale = null;
if (defaultLocale != null) {
@@ -686,11 +690,7 @@ public class Dispatcher {
}
if (encoding != null) {
try {
request.setCharacterEncoding(encoding);
} catch (Exception e) {
LOG.error("Error setting character encoding to '" + encoding + "' - ignoring.", e);
}
applyEncoding(request, encoding);
}
if (locale != null) {
@@ -702,6 +702,18 @@ public class Dispatcher {
}
}
private void applyEncoding(HttpServletRequest request, String encoding) {
try {
if (!encoding.equals(request.getCharacterEncoding())) {
// if the encoding is already correctly set and the parameters have been already read
// do not try to set encoding because it is useless and will cause an error
request.setCharacterEncoding(encoding);
}
} catch (Exception e) {
LOG.error("Error setting character encoding to '" + encoding + "' - ignoring.", e);
}
}
/**
* Wrap and return the given request or return the original request object.
* </p>
@@ -27,6 +27,7 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
@@ -35,7 +36,7 @@ import java.nio.charset.Charset;
/**
* <!-- START SNIPPET: description -->
*
* A result that send the content out as plain text. Usefull typically when needed
* A result that send the content out as plain text. Useful typically when needed
* to display the raw content of a JSP or Html file for example.
*
* <!-- END SNIPPET: description -->
@@ -57,12 +58,12 @@ import java.nio.charset.Charset;
* <!-- START SNIPPET: example -->
*
* &lt;action name="displayJspRawContent" &gt;
* &lt;result type="plaintext"&gt;/myJspFile.jsp&lt;/result&gt;
* &lt;result type="plainText"&gt;/myJspFile.jsp&lt;/result&gt;
* &lt;/action&gt;
*
*
* &lt;action name="displayJspRawContent" &gt;
* &lt;result type="plaintext"&gt;
* &lt;result type="plainText"&gt;
* &lt;param name="location"&gt;/myJspFile.jsp&lt;/param&gt;
* &lt;param name="charSet"&gt;UTF-8&lt;/param&gt;
* &lt;/result&gt;
@@ -112,53 +113,27 @@ public class PlainTextResult extends StrutsResultSupport {
* @see org.apache.struts2.dispatcher.StrutsResultSupport#doExecute(java.lang.String, com.opensymphony.xwork2.ActionInvocation)
*/
protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
// verify charset
Charset charset = null;
if (charSet != null) {
if (Charset.isSupported(charSet)) {
charset = Charset.forName(charSet);
}
else {
if (LOG.isWarnEnabled()) {
LOG.warn("charset ["+charSet+"] is not recognized ");
}
charset = null;
}
}
Charset charset = readCharset();
HttpServletResponse response = (HttpServletResponse) invocation.getInvocationContext().get(HTTP_RESPONSE);
ServletContext servletContext = (ServletContext) invocation.getInvocationContext().get(SERVLET_CONTEXT);
if (charset != null) {
response.setContentType("text/plain; charset="+charSet);
}
else {
response.setContentType("text/plain");
}
response.setHeader("Content-Disposition", "inline");
applyCharset(charset, response);
applyAdditionalHeaders(response);
String location = adjustLocation(finalLocation);
PrintWriter writer = response.getWriter();
InputStreamReader reader = null;
try {
InputStream resourceAsStream = servletContext.getResourceAsStream(finalLocation);
InputStream resourceAsStream = readStream(invocation, location);
logWrongStream(finalLocation, resourceAsStream);
if (charset != null) {
reader = new InputStreamReader(resourceAsStream, charset);
} else {
reader = new InputStreamReader(resourceAsStream);
}
if (resourceAsStream == null) {
if (LOG.isWarnEnabled()) {
LOG.warn("resource at location ["+finalLocation+"] cannot be obtained (return null) from ServletContext !!! ");
}
} else {
char[] buffer = new char[BUFFER_SIZE];
int charRead;
while((charRead = reader.read(buffer)) != -1) {
writer.write(buffer, 0, charRead);
}
if (resourceAsStream != null) {
sendStream(writer, reader);
}
} finally {
if (reader != null)
@@ -169,4 +144,60 @@ public class PlainTextResult extends StrutsResultSupport {
}
}
}
protected InputStream readStream(ActionInvocation invocation, String location) {
ServletContext servletContext = (ServletContext) invocation.getInvocationContext().get(SERVLET_CONTEXT);
return servletContext.getResourceAsStream(location);
}
protected void logWrongStream(String finalLocation, InputStream resourceAsStream) {
if (resourceAsStream == null) {
if (LOG.isWarnEnabled()) {
LOG.warn("Resource at location [" + finalLocation + "] cannot be obtained (return null) from ServletContext !!! ");
}
}
}
protected void sendStream(PrintWriter writer, InputStreamReader reader) throws IOException {
char[] buffer = new char[BUFFER_SIZE];
int charRead;
while((charRead = reader.read(buffer)) != -1) {
writer.write(buffer, 0, charRead);
}
}
protected String adjustLocation(String location) {
if (location.charAt(0) != '/') {
return "/" + location;
}
return location;
}
protected void applyAdditionalHeaders(HttpServletResponse response) {
response.setHeader("Content-Disposition", "inline");
}
protected void applyCharset(Charset charset, HttpServletResponse response) {
if (charset != null) {
response.setContentType("text/plain; charset=" + charSet);
} else {
response.setContentType("text/plain");
}
}
protected Charset readCharset() {
Charset charset = null;
if (charSet != null) {
if (Charset.isSupported(charSet)) {
charset = Charset.forName(charSet);
} else {
if (LOG.isWarnEnabled()) {
LOG.warn("charset [" + charSet + "] is not recognized ");
}
charset = null;
}
}
return charset;
}
}
@@ -25,7 +25,7 @@ import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsStatics;
@@ -21,28 +21,8 @@
package org.apache.struts2.dispatcher;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.dispatcher.FilterDispatcherTest.InnerActionMapper;
import org.apache.struts2.dispatcher.FilterDispatcherTest.InnerDestroyableObjectFactory;
import org.apache.struts2.dispatcher.FilterDispatcherTest.InnerDispatcher;
import org.springframework.mock.web.MockFilterConfig;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;
import com.mockobjects.dynamic.C;
import com.mockobjects.dynamic.Mock;
import com.mockobjects.servlet.MockFilterChain;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationManager;
@@ -50,11 +30,20 @@ import com.opensymphony.xwork2.config.entities.InterceptorMapping;
import com.opensymphony.xwork2.config.entities.InterceptorStackConfig;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.inject.Context;
import com.opensymphony.xwork2.inject.Factory;
import com.opensymphony.xwork2.interceptor.Interceptor;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.dispatcher.FilterDispatcherTest.InnerDestroyableObjectFactory;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* Test case for Dispatcher.
@@ -81,7 +70,7 @@ public class DispatcherTest extends StrutsTestCase {
HttpServletRequest req = new MockHttpServletRequest();
HttpServletResponse res = new MockHttpServletResponse();
Dispatcher du = initDispatcher(new HashMap() {{
Dispatcher du = initDispatcher(new HashMap<String, String>() {{
put(StrutsConstants.STRUTS_I18N_ENCODING, "utf-8");
}});
du.prepare(req, res);
@@ -89,12 +78,54 @@ public class DispatcherTest extends StrutsTestCase {
assertEquals(req.getCharacterEncoding(), "utf-8");
}
public void testEncodingForXMLHttpRequest() throws Exception {
// given
MockHttpServletRequest req = new MockHttpServletRequest();
req.addHeader("X-Requested-With", "XMLHttpRequest");
req.setCharacterEncoding("utf-8");
HttpServletResponse res = new MockHttpServletResponse();
Dispatcher du = initDispatcher(new HashMap<String, String>() {{
put(StrutsConstants.STRUTS_I18N_ENCODING, "latin-2");
}});
// when
du.prepare(req, res);
// then
assertEquals(req.getCharacterEncoding(), "utf-8");
}
public void testSetEncodingIfDiffer() throws Exception {
// given
Mock mock = new Mock(HttpServletRequest.class);
mock.expectAndReturn("getCharacterEncoding", "utf-8");
mock.expectAndReturn("getHeader", "X-Requested-With", "");
mock.expectAndReturn("getLocale", Locale.getDefault());
mock.expectAndReturn("getCharacterEncoding", "utf-8");
HttpServletRequest req = (HttpServletRequest) mock.proxy();
HttpServletResponse res = new MockHttpServletResponse();
Dispatcher du = initDispatcher(new HashMap<String, String>() {{
put(StrutsConstants.STRUTS_I18N_ENCODING, "utf-8");
}});
// when
du.prepare(req, res);
// then
assertEquals(req.getCharacterEncoding(), "utf-8");
mock.verify();
}
public void testPrepareSetEncodingPropertyWithMultipartRequest() throws Exception {
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
req.setContentType("multipart/form-data");
Dispatcher du = initDispatcher(new HashMap() {{
Dispatcher du = initDispatcher(new HashMap<String, String>() {{
put(StrutsConstants.STRUTS_I18N_ENCODING, "utf-8");
}});
du.prepare(req, res);
@@ -130,7 +161,7 @@ public class DispatcherTest extends StrutsTestCase {
public void testConfigurationManager() {
Dispatcher du = null;
Dispatcher du;
InternalConfigurationManager configurationManager = new InternalConfigurationManager();
try {
du = new Dispatcher(new MockServletContext(), new HashMap<String, String>());
@@ -148,7 +179,7 @@ public class DispatcherTest extends StrutsTestCase {
}
finally {
du.setInstance(null);
Dispatcher.setInstance(null);
}
}
@@ -21,23 +21,19 @@
package org.apache.struts2.dispatcher;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import junit.framework.TestCase;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.views.jsp.AbstractUITagTest;
import org.apache.struts2.views.jsp.StrutsMockHttpServletResponse;
import org.apache.struts2.views.jsp.StrutsMockServletContext;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.ValueStackFactory;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
/**
* Test case for PlainTextResult.
@@ -80,6 +76,29 @@ public class PlainTextResultTest extends StrutsTestCase {
}
}
public void testPlainTextWithoutSlash() throws Exception {
PlainTextResult result = new PlainTextResult();
result.setLocation("someJspFile.jsp");
response.setExpectedContentType("text/plain");
response.setExpectedHeader("Content-Disposition", "inline");
InputStream jspResourceInputStream =
ClassLoaderUtil.getResourceAsStream("org/apache/struts2/dispatcher/someJspFile.jsp", PlainTextResultTest.class);
try {
servletContext.setResourceAsStream(jspResourceInputStream);
result.execute(invocation);
String r = AbstractUITagTest.normalize(stringWriter.getBuffer().toString(), true);
String e = AbstractUITagTest.normalize(readAsString("org/apache/struts2/dispatcher/someJspFile.jsp"), true);
assertEquals(r, e);
}
finally {
jspResourceInputStream.close();
}
}
public void testPlainTextWithEncoding() throws Exception {
PlainTextResult result = new PlainTextResult();
result.setLocation("/someJspFile.jsp");
@@ -219,6 +219,48 @@ public class FreeMarkerResultTest extends StrutsTestCase {
assertEquals(expected, stringWriter.toString());
}
public void testManualListInTemplate() throws Exception {
FreemarkerManager freemarkerManager = container.getInstance(FreemarkerManager.class);
Configuration freemarkerConfig = freemarkerManager.getConfiguration(ServletActionContext.getServletContext());
freemarkerConfig.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
ServletContext servletContext = EasyMock.createNiceMock(ServletContext.class);
File file = new File(FreeMarkerResultTest.class.getResource("manual-list.ftl").toURI());
EasyMock.expect(servletContext.getRealPath("/tutorial/org/apache/struts2/views/freemarker/manual-list.ftl")).andReturn(file.getAbsolutePath());
file = new File(ClassLoaderUtil.getResource("template/simple/radiomap.ftl", getClass()).toURI());
EasyMock.expect(servletContext.getRealPath("/template/simple/radiomap.ftl")).andReturn(file.getAbsolutePath());
file = new File(ClassLoaderUtil.getResource("template/simple/css.ftl", getClass()).toURI());
EasyMock.expect(servletContext.getRealPath("/template/simple/css.ftl")).andReturn(file.getAbsolutePath());
file = new File(ClassLoaderUtil.getResource("template/simple/scripting-events.ftl", getClass()).toURI());
EasyMock.expect(servletContext.getRealPath("/template/simple/scripting-events.ftl")).andReturn(file.getAbsolutePath());
file = new File(ClassLoaderUtil.getResource("template/simple/common-attributes.ftl", getClass()).toURI());
EasyMock.expect(servletContext.getRealPath("/template/simple/common-attributes.ftl")).andReturn(file.getAbsolutePath());
file = new File(ClassLoaderUtil.getResource("template/simple/dynamic-attributes.ftl", getClass()).toURI());
EasyMock.expect(servletContext.getRealPath("/template/simple/dynamic-attributes.ftl")).andReturn(file.getAbsolutePath());
EasyMock.expect(servletContext.getAttribute(FreemarkerManager.CONFIG_SERVLET_CONTEXT_KEY)).andReturn(freemarkerConfig).anyTimes();
EasyMock.replay(servletContext);
freemarkerConfig.setServletContextForTemplateLoading(servletContext, null);
ServletActionContext.setServletContext(servletContext);
request.setRequestURI("/tutorial/test7.action");
Dispatcher dispatcher = Dispatcher.getInstance();
ActionMapping mapping = dispatcher.getContainer().getInstance(ActionMapper.class).getMapping(request, dispatcher.getConfigurationManager());
dispatcher.serviceAction(request, response, servletContext, mapping);
String expected =
"<input type=\"radio\" name=\"client\" id=\"client_foo\" value=\"foo\"/><label for=\"client_foo\">foo</label>\n" +
"<input type=\"radio\" name=\"client\" id=\"client_bar\" value=\"bar\"/><label for=\"client_bar\">bar</label>\n";
assertEquals(expected, stringWriter.toString());
}
protected void setUp() throws Exception {
super.setUp();
mgr = new FreemarkerManager();
@@ -0,0 +1,23 @@
<#--
/*
* $Id: someFreeMarkerFile.ftl 590812 2007-10-31 20:32:54Z apetrelli $
*
* 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.
*/
-->
<@s.radio name="client" id="client_" list='{"foo", "bar"}' />
+6
View File
@@ -69,6 +69,12 @@
</result>
</action>
<action name="test7" class="com.opensymphony.xwork2.ActionSupport">
<result type="freemarker">
<param name="location">org/apache/struts2/views/freemarker/manual-list.ftl</param>
</result>
</action>
</package>
<package name="sitegraph" namespace="/tutorial/sitegraph" extends="struts-default">
+1 -1
View File
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.2</version>
<version>2.3.3</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.2</version>
<version>2.3.3</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_2/plugins/codebehind</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/codebehind</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/codebehind</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/codebehind</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/codebehind</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/config-browser</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/config-browser</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/config-browser</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/config-browser</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/config-browser</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/trunk/struts2-convention-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_2/trunk/struts2-convention-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_2/trunk/struts2-convention-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_3/trunk/struts2-convention-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_3/trunk/struts2-convention-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_3/trunk/struts2-convention-plugin</url>
</scm>
<build>
@@ -33,6 +33,7 @@ import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.FileManager;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.WildcardHelper;
import com.opensymphony.xwork2.util.classloader.ReloadingClassLoader;
import com.opensymphony.xwork2.util.finder.ClassFinder;
import com.opensymphony.xwork2.util.finder.ClassFinder.ClassInfo;
@@ -486,6 +487,20 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
String classPackageName = StringUtils.substringBeforeLast(className, ".");
if(excludePackages != null && excludePackages.length > 0) {
WildcardHelper wildcardHelper = new WildcardHelper();
//we really don't care about the results, just the boolean
Map<String, String> matchMap = new HashMap<String, String>();
for(String packageExclude : excludePackages) {
int[] packagePattern = wildcardHelper.compilePattern(packageExclude);
if(wildcardHelper.match(matchMap, classPackageName, packagePattern)) {
return false;
}
}
}
if (actionPackages != null) {
for (String packageName : actionPackages) {
String strictPackageName = packageName + ".";
@@ -82,6 +82,7 @@ import org.apache.struts2.convention.actions.resultpath.PackageLevelResultPathAc
import org.apache.struts2.convention.actions.skip.Index;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.dontfind.DontFindMeAction;
import org.apache.struts2.dispatcher.ServletDispatcherResult;
import org.easymock.EasyMock;
@@ -115,6 +116,10 @@ public class PackageBasedActionConfigBuilderTest extends TestCase {
run(null, "actions,dontfind", null);
}
public void testExcludedPackages() throws MalformedURLException {
run(null, "actions", "dontfind");
}
private void run(String actionPackages, String packageLocators, String excludePackages) throws MalformedURLException {
//setup interceptors
List<InterceptorConfig> defaultInterceptors = new ArrayList<InterceptorConfig>();
@@ -337,6 +342,7 @@ public class PackageBasedActionConfigBuilderTest extends TestCase {
assertEquals(14, pkgConfig.getActionConfigs().size());
verifyActionConfig(pkgConfig, "action1", ActionNameAction.class, "run1", pkgConfig.getName());
verifyActionConfig(pkgConfig, "action2", ActionNameAction.class, "run2", pkgConfig.getName());
verifyMissingActionConfig(pkgConfig, "foo", DontFindMeAction.class, "foo", pkgConfig.getName());
verifyActionConfig(pkgConfig, "action3", "someClassName", "run1", pkgConfig.getName());
verifyActionConfig(pkgConfig, "actions1", ActionNamesAction.class, "run", pkgConfig.getName());
verifyActionConfig(pkgConfig, "actions2", ActionNamesAction.class, "run", pkgConfig.getName());
@@ -350,6 +356,7 @@ public class PackageBasedActionConfigBuilderTest extends TestCase {
verifyActionConfig(pkgConfig, "class4", ClassLevelAnnotationsDefaultMethodAction.class, "execute", pkgConfig.getName());
verifyActionConfig(pkgConfig, "class5", ClassLevelAnnotationAction.class, null, pkgConfig.getName());
verifyActionConfig(pkgConfig, "class6", ClassLevelAnnotationDefaultMethodAction.class, "execute", pkgConfig.getName());
verifyActionConfig(pkgConfig, "class6", ClassLevelAnnotationDefaultMethodAction.class, "execute", pkgConfig.getName());
/* org.apache.struts2.convention.actions.namespace3 */
//action on namespace1 (action level)
@@ -571,6 +578,12 @@ public class PackageBasedActionConfigBuilderTest extends TestCase {
assertEquals(packageName, ac.getPackageName());
}
private void verifyMissingActionConfig(PackageConfig pkgConfig, String actionName, Class<?> actionClass,
String methodName, String packageName) {
ActionConfig ac = pkgConfig.getAllActionConfigs().get(actionName);
assertNull(ac);
}
private void verifyActionConfig(PackageConfig pkgConfig, String actionName, String actionClass, String methodName, String packageName) {
ActionConfig ac = pkgConfig.getAllActionConfigs().get(actionName);
assertNotNull(ac);
+4 -4
View File
@@ -25,7 +25,7 @@
<parent>
<artifactId>struts2-plugins</artifactId>
<groupId>org.apache.struts</groupId>
<version>2.3.2</version>
<version>2.3.3</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_2/plugins/dojo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/dojo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/dojo</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/dojo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/dojo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/dwr</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/dwr</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/dwr</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/dwr</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/dwr</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/embeddedjsp</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/embeddedjsp</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/embeddedjsp</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/embeddedjsp</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/embeddedjsp</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/plugins/embeddedjsp</url>
</scm>
<dependencies>
+4 -4
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/trunk/struts2-gxp-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_2/trunk/struts2-gxp-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_2/trunk/struts2-gxp-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_3/trunk/struts2-gxp-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_3/trunk/struts2-gxp-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/jasperreports</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/jasperreports</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/jasperreports</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/jasperreports</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/jasperreports</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/javatemplates</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/javatemplates</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/javatemplates</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/javatemplates</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/javatemplates</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/plugins/javatemplates</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/plugins/jfreechart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/jfreechart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/jfreechart</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/jfreechart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/jfreechart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/jsf</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/jsf</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/jsf</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/jsf</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/jsf</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/plugins/jsf</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/plugins/json</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/json</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/json</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/json</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/json</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/plugins/json</url>
</scm>
<build>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/plugins/junit</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/junit</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/junit</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/junit</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/junit</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/plugins/junit</url>
</scm>
<dependencies>
@@ -36,6 +36,7 @@ import org.apache.struts2.util.StrutsTestCaseHelper;
import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.mock.web.MockPageContext;
import org.springframework.mock.web.MockServletContext;
@@ -149,17 +150,23 @@ public abstract class StrutsTestCase extends XWorkTestCase {
return proxy;
}
private void initActionContext(ActionContext actionContext) {
actionContext.setParameters(new HashMap(request.getParameterMap()));
initMockPortletContext(actionContext);
protected void initActionContext(ActionContext actionContext) {
actionContext.setParameters(new HashMap<String, Object>(request.getParameterMap()));
initSession(actionContext);
initPortletContext(actionContext);
applyAdditionalParams(actionContext);
// set the action context to the one used by the proxy
ActionContext.setContext(actionContext);
}
private void initMockPortletContext(ActionContext actionContext) {
protected void initSession(ActionContext actionContext) {
if (actionContext.getSession() == null) {
actionContext.setSession(new HashMap<String, Object>());
request.setSession(new MockHttpSession(servletContext));
}
}
protected void initPortletContext(ActionContext actionContext) {
try {
ClassLoaderUtil.loadClass("javax.portlet.PortletContext", getClass());
Class mockClazz = ClassLoaderUtil.loadClass("org.springframework.mock.web.portlet.MockPortletContext", getClass());
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/plugins/osgi</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/osgi</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/osgi</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/osgi</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/osgi</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/oval</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/oval</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/oval</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/oval</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/oval</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/plugins/oval</url>
</scm>
<dependencies>
@@ -170,7 +170,7 @@ public class OValValidationInterceptor extends MethodFilterInterceptor {
//perform validation
List<ConstraintViolation> violations = validator.validate(action);
addValidationErrors(violations.toArray(new ConstraintViolation[0]), action, valueStack, null);
addValidationErrors(violations.toArray(new ConstraintViolation[violations.size()]), action, valueStack, null);
}
private void addValidationErrors(ConstraintViolation[] violations, Object action, ValueStack valueStack, String parentFieldname) {
@@ -180,13 +180,16 @@ public class OValValidationInterceptor extends MethodFilterInterceptor {
//translate message
String key = violation.getMessage();
String message = key;
// push context variable into stack, to allow use ${max}, ${min} etc in error messages
valueStack.push(violation.getMessageVariables());
//push the validator into the stack
valueStack.push(violation.getContext());
String message = key;
try {
message = validatorContext.getText(key);
} finally {
valueStack.pop();
valueStack.pop();
}
if (isActionError(violation)) {
@@ -24,14 +24,12 @@ import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.ValidationAware;
import com.opensymphony.xwork2.XWorkTestCase;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import net.sf.oval.configuration.Configurer;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Locale;
import net.sf.oval.configuration.Configurer;
import org.apache.struts2.oval.interceptor.OValValidationManager;
import java.util.Map;
public class OValValidationInterceptorTest extends XWorkTestCase {
public void testSimpleFieldsXML() throws Exception {
@@ -126,6 +124,20 @@ public class OValValidationInterceptorTest extends XWorkTestCase {
assertEquals(0, fieldErrors.size());
}
public void testSimpleFieldTooLong() throws Exception {
ActionProxy baseActionProxy = actionProxyFactory.createActionProxy("oval", "simpleFieldTooLong", null, null);
SimpleField action = (SimpleField) baseActionProxy.getAction();
action.setName("12367");
baseActionProxy.execute();
Map<String, List<String>> fieldErrors = action.getFieldErrors();
assertNotNull(fieldErrors);
assertEquals(1, fieldErrors.size());
assertValue(fieldErrors, "name", Arrays.asList("name is not between 0 and 3 characters long"));
assertValue(fieldErrors, "name", Arrays.asList("name is not between 0 and 3 characters long"));
}
public void testSimpleFieldMultipleValidators() throws Exception {
ActionProxy baseActionProxy = actionProxyFactory.createActionProxy("oval", "simpleField", null, null);
SimpleField action = (SimpleField) baseActionProxy.getAction();
@@ -195,6 +207,19 @@ public class OValValidationInterceptorTest extends XWorkTestCase {
assertValue(fieldErrors, "name", Arrays.asList("name cannot be null"));
}
public void testSimpleFieldI18n2() throws Exception {
ActionProxy baseActionProxy = actionProxyFactory.createActionProxy("oval", "simpleFieldI18n", null, null);
SimpleFieldI18n action = (SimpleFieldI18n) baseActionProxy.getAction();
action.setName("123123");
baseActionProxy.execute();
Map<String, List<String>> fieldErrors = action.getFieldErrors();
assertNotNull(fieldErrors);
assertEquals(1, fieldErrors.size());
assertValue(fieldErrors, "name", Arrays.asList("name value is too long, allowed length is 3"));
}
public void testSimpleFieldI18nDefaultKey() throws Exception {
ActionProxy baseActionProxy = actionProxyFactory.createActionProxy("oval", "simpleFieldI18nDefaultKey", null, null);
SimpleFieldI18nDefaultKey action = (SimpleFieldI18nDefaultKey) baseActionProxy.getAction();
@@ -21,12 +21,12 @@
package org.apache.struts2.oval.interceptor;
import com.opensymphony.xwork2.ActionSupport;
import net.sf.oval.constraint.NotNull;
import net.sf.oval.constraint.NotEmpty;
import net.sf.oval.constraint.Length;
import net.sf.oval.constraint.NotNull;
public class SimpleFieldI18n extends ActionSupport {
@NotNull(message = "notnull.field")
@Length(max = 3, message = "field.too.long")
private String name;
public String getName() {
@@ -1 +1,2 @@
notnull.field=${field.name} cannot be null
notnull.field=${field.name} cannot be null
field.too.long=${field.name} value is too long, allowed length is ${max}
@@ -46,6 +46,10 @@
<interceptor-ref name="ovalValidation"/>
<result type="void"></result>
</action>
<action name="simpleFieldTooLong" class="org.apache.struts2.oval.interceptor.SimpleField">
<interceptor-ref name="ovalValidation"/>
<result type="void"></result>
</action>
<action name="simpleMethod" class="org.apache.struts2.oval.interceptor.SimpleMethod">
<interceptor-ref name="ovalValidation"/>
<result type="void"></result>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/plugins/pell-multipart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/pell-multipart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/pell-multipart</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/pell-multipart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/pell-multipart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/plexus</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/plexus</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/plexus</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/plexus</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/plexus</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins</url>
</scm>
<modules>
+4 -4
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/plugins/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-plugin</artifactId>
<version>2.3.2</version>
<version>2.3.3</version>
<name>Struts 2 REST Plugin</name>
<properties>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/plugins/sitegraph</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/sitegraph</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/sitegraph</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/sitegraph</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/sitegraph</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/sitemesh</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/sitemesh</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/sitemesh</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/sitemesh</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/sitemesh</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/spring</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/spring</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/spring</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/spring</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/spring</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/struts1</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/struts1</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/struts1</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/struts1</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/struts1</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/testng</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/testng</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/testng</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/testng</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/testng</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/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.2</version>
<version>2.3.3</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_2/plugins/tiles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/plugins/tiles</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2/plugins/tiles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/tiles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/plugins/tiles</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3/plugins/tiles</url>
</scm>
<dependencies>
+5 -5
View File
@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.2</version>
<version>2.3.3</version>
<packaging>pom</packaging>
<name>Struts 2</name>
<url>http://struts.apache.org/2.x/</url>
@@ -29,9 +29,9 @@
-->
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_2</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_3</url>
</scm>
<issueManagement>
@@ -55,7 +55,7 @@
<distributionManagement>
<site>
<id>apache-site</id>
<url>scp://people.apache.org/www/struts.apache.org/2.3.2/</url>
<url>scp://people.apache.org/www/struts.apache.org/2.3.3/</url>
</site>
</distributionManagement>
+4 -4
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.2</version>
<version>2.3.3</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_2/xwork-core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/xwork-core</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_2/xwork-core</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/xwork-core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/xwork-core</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_3/xwork-core</url>
</scm>
<properties>