mirror of
https://github.com/apache/struts.git
synced 2026-08-09 16:46:55 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f706c2fb2f |
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/apps/blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps/blank</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/apps/jboss-blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/jboss-blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps/jboss-blank</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/apps/mailreader</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/mailreader</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps/mailreader</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/apps</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/apps/portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/portlet</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps/portlet</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-rest-showcase</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</version>
|
||||
<name>Struts 2 Rest Showcase Example</name>
|
||||
<description>Struts 2 Rest Showcase Example</description>
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/apps/showcase</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/apps/showcase</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/apps/showcase</url>
|
||||
</scm>
|
||||
|
||||
|
||||
|
||||
@@ -44,19 +44,19 @@ public class Skill implements IdEntity {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(name));
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
this.name = StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(name));
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(description));
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
this.description = StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(description));
|
||||
}
|
||||
|
||||
public Serializable getId() {
|
||||
|
||||
+1
-1
@@ -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>
|
||||
|
||||
+1
-1
@@ -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
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/archetypes</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes</url>
|
||||
</scm>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-blank</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/archetypes/struts2-archetype-blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-blank</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/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.10</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-convention</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/archetypes/struts2-archetype-convention</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-convention</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/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.10</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-dbportlet</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/archetypes/struts2-archetype-dbportlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-dbportlet</developerConnection>
|
||||
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-dbportlet</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.10</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-plugin</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/archetypes/struts2-archetype-plugin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-plugin</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-plugin</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.10</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-portlet</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/archetypes/struts2-archetype-portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-portlet</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-portlet</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-starter</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/archetypes/struts2-archetype-starter</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-starter</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/archetypes/struts2-archetype-starter</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
|
||||
+4
-4
@@ -11,13 +11,13 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/assembly</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/assembly</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/assembly</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/bundles/admin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/bundles/admin</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/bundles/admin</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/bundles/demo</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/bundles/demo</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/bundles/demo</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/bundles</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/bundles</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/bundles</url>
|
||||
</scm>
|
||||
|
||||
<modules>
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/core</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/core</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/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";
|
||||
|
||||
}
|
||||
|
||||
@@ -881,7 +881,7 @@ public abstract class UIBean extends Component {
|
||||
if (name != null) {
|
||||
return name.replaceAll("[\\/\\.\\[\\]]", "_");
|
||||
} else {
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -895,7 +895,7 @@ public abstract class UIBean extends Component {
|
||||
if (val != null) {
|
||||
return val.replaceAll("\"", """);
|
||||
} else {
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -139,9 +139,9 @@ public class Dispatcher {
|
||||
private String multipartSaveDir;
|
||||
|
||||
/**
|
||||
* Stores the value of StrutsConstants.STRUTS_MULTIPART_HANDLER setting
|
||||
* Stores reference to instance of {@link MultiPartRequest} implementation defined by {@link StrutsConstants#STRUTS_MULTIPART_PARSER}
|
||||
*/
|
||||
private String multipartHandlerName;
|
||||
private MultiPartRequest multipartHandler;
|
||||
|
||||
/**
|
||||
* Provide list of default configuration files.
|
||||
@@ -252,9 +252,9 @@ public class Dispatcher {
|
||||
multipartSaveDir = val;
|
||||
}
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_MULTIPART_PARSER)
|
||||
public void setMultipartHandler(String val) {
|
||||
multipartHandlerName = val;
|
||||
@Inject
|
||||
public void setMultipartHandler(MultiPartRequest multiPartRequest) {
|
||||
this.multipartHandler = multiPartRequest;
|
||||
}
|
||||
|
||||
@Inject
|
||||
@@ -774,9 +774,8 @@ public class Dispatcher {
|
||||
|
||||
String content_type = request.getContentType();
|
||||
if (content_type != null && content_type.contains("multipart/form-data")) {
|
||||
MultiPartRequest mpr = getMultiPartRequest();
|
||||
LocaleProvider provider = getContainer().getInstance(LocaleProvider.class);
|
||||
request = new MultiPartRequestWrapper(mpr, request, getSaveDir(servletContext), provider);
|
||||
request = new MultiPartRequestWrapper(multipartHandler, request, getSaveDir(servletContext), provider);
|
||||
} else {
|
||||
request = new StrutsRequestWrapper(request);
|
||||
}
|
||||
@@ -784,27 +783,6 @@ public class Dispatcher {
|
||||
return request;
|
||||
}
|
||||
|
||||
/**
|
||||
* On each request it must return a new instance as implementation could be not thread safe
|
||||
* and thus ensure of resource clean up
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected MultiPartRequest getMultiPartRequest() {
|
||||
MultiPartRequest mpr = null;
|
||||
//check for alternate implementations of MultiPartRequest
|
||||
Set<String> multiNames = getContainer().getInstanceNames(MultiPartRequest.class);
|
||||
for (String multiName : multiNames) {
|
||||
if (multiName.equals(multipartHandlerName)) {
|
||||
mpr = getContainer().getInstance(MultiPartRequest.class, multiName);
|
||||
}
|
||||
}
|
||||
if (mpr == null ) {
|
||||
mpr = getContainer().getInstance(MultiPartRequest.class);
|
||||
}
|
||||
return mpr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all the files created by MultiPartRequestWrapper.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -2,14 +2,12 @@ package org.apache.struts2.util.fs;
|
||||
|
||||
import com.opensymphony.xwork2.util.fs.DefaultFileManager;
|
||||
import com.opensymphony.xwork2.util.fs.FileRevision;
|
||||
import com.opensymphony.xwork2.util.fs.JarEntryRevision;
|
||||
import com.opensymphony.xwork2.util.fs.Revision;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
@@ -47,7 +45,7 @@ public class JBossFileManager extends DefaultFileManager {
|
||||
return true;
|
||||
} catch (ClassNotFoundException e) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Cannot load [#0] class, not a JBoss 5!", VFS_JBOSS5);
|
||||
LOG.debug("Cannot load [#0] class, not a JBoss 5!", VFS_JBOSS7);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -72,18 +70,7 @@ public class JBossFileManager extends DefaultFileManager {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Creating revision for URL: " + fileName);
|
||||
}
|
||||
URL normalizedUrl = normalizeToFileProtocol(fileUrl);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Normalized URL for [#0] is [#1]", fileName, normalizedUrl.toString());
|
||||
}
|
||||
Revision revision;
|
||||
if ("file".equals(normalizedUrl.getProtocol())) {
|
||||
revision = FileRevision.build(normalizedUrl);
|
||||
} else if ("jar".equals(normalizedUrl.getProtocol())) {
|
||||
revision = JarEntryRevision.build(normalizedUrl);
|
||||
} else {
|
||||
revision = Revision.build(normalizedUrl);
|
||||
}
|
||||
Revision revision = FileRevision.build(normalizeToFileProtocol(fileUrl));
|
||||
files.put(fileName, revision);
|
||||
} else {
|
||||
super.monitorFile(fileUrl);
|
||||
@@ -135,71 +122,43 @@ public class JBossFileManager extends DefaultFileManager {
|
||||
*/
|
||||
protected URL getJBossPhysicalUrl(URL url) throws IOException {
|
||||
Object content = url.openConnection().getContent();
|
||||
String classContent = content.getClass().toString();
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Reading physical URL for [#0]", url.toString());
|
||||
}
|
||||
if (classContent.startsWith("class org.jboss.vfs.VirtualFile")) { // JBoss 7 and probably 6
|
||||
File physicalFile = readJBossPhysicalFile(content);
|
||||
return physicalFile.toURI().toURL();
|
||||
} else if (classContent.startsWith("class org.jboss.virtual.VirtualFile")) { // JBoss 5
|
||||
return readJBoss5Url(content);
|
||||
try {
|
||||
String s = content.getClass().toString();
|
||||
if (s.startsWith("class org.jboss.vfs.VirtualFile")) { // JBoss 7 and probably 6
|
||||
File physicalFile = readJBossPhysicalFile(content);
|
||||
return physicalFile.toURI().toURL();
|
||||
} else if (s.startsWith("class org.jboss.virtual.VirtualFile")) { // JBoss 5
|
||||
String fileName = url.toExternalForm();
|
||||
return new URL("file", null, fileName.substring(fileName.indexOf(":") + 1));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Error calling getPhysicalFile() on JBoss VirtualFile.", e);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
private File readJBossPhysicalFile(Object content) throws Exception {
|
||||
Method method = content.getClass().getDeclaredMethod("getPhysicalFile");
|
||||
return (File) method.invoke(content);
|
||||
}
|
||||
|
||||
private List<URL> getAllJBossPhysicalUrls(URL url) throws IOException {
|
||||
List<URL> urls = new ArrayList<URL>();
|
||||
Object content = url.openConnection().getContent();
|
||||
String classContent = content.getClass().toString();
|
||||
if (classContent.startsWith("class org.jboss.vfs.VirtualFile")) {
|
||||
File physicalFile = readJBossPhysicalFile(content);
|
||||
if (physicalFile != null) {
|
||||
try {
|
||||
if (content.getClass().toString().startsWith("class org.jboss.vfs.VirtualFile")) {
|
||||
File physicalFile = readJBossPhysicalFile(content);
|
||||
readFile(urls, physicalFile);
|
||||
readFile(urls, physicalFile.getParentFile());
|
||||
} else {
|
||||
urls.add(url);
|
||||
}
|
||||
} else if (classContent.startsWith("class org.jboss.virtual.VirtualFile")) {
|
||||
URL physicalUrl = readJBoss5Url(content);
|
||||
if (physicalUrl != null) {
|
||||
urls.add(physicalUrl);
|
||||
}
|
||||
} else {
|
||||
urls.add(url);
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Error calling getPhysicalFile() on JBoss VirtualFile!", e);
|
||||
}
|
||||
return urls;
|
||||
}
|
||||
|
||||
private File readJBossPhysicalFile(Object content) {
|
||||
try {
|
||||
Method method = content.getClass().getDeclaredMethod("getPhysicalFile");
|
||||
return (File) method.invoke(content);
|
||||
} catch (NoSuchMethodException e) {
|
||||
LOG.error("Provided class content [#0] is not a JBoss VirtualFile, getPhysicalFile() method not found!", e, content.getClass().getSimpleName());
|
||||
} catch (InvocationTargetException e) {
|
||||
LOG.error("Cannot invoke getPhysicalFile() method!", e);
|
||||
} catch (IllegalAccessException e) {
|
||||
LOG.error("Cannot access getPhysicalFile() method!", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private URL readJBoss5Url(Object content) {
|
||||
try {
|
||||
Method method = content.getClass().getDeclaredMethod("getHandler");
|
||||
method.setAccessible(true);
|
||||
Object handler = method.invoke(content);
|
||||
method = handler.getClass().getMethod("getRealURL");
|
||||
return (URL) method.invoke(handler);
|
||||
} catch (NoSuchMethodException e) {
|
||||
LOG.error("Provided class content [#0] is not a JBoss VirtualFile, getHandler() or getRealURL() method not found!", e, content.getClass().getSimpleName());
|
||||
} catch (InvocationTargetException e) {
|
||||
LOG.error("Cannot invoke getHandler() or getRealURL() method!", e);
|
||||
} catch (IllegalAccessException e) {
|
||||
LOG.error("Cannot access getHandler() or getRealURL() method!", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void readFile(List<URL> urls, File physicalFile) throws MalformedURLException {
|
||||
File[] files = physicalFile.listFiles();
|
||||
if (physicalFile.isDirectory() && files != null) {
|
||||
|
||||
@@ -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¶m2=value+2¶m3=value+3#fragment", res.getRedirectedUrl());
|
||||
|
||||
control.verify();
|
||||
}
|
||||
|
||||
|
||||
+14
-4
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
+13
-11
@@ -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
@@ -25,7 +25,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.struts</groupId>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/codebehind</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/codebehind</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/codebehind</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/config-browser</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/config-browser</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/config-browser</url>
|
||||
</scm>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/trunk/struts2-convention-plugin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_10/trunk/struts2-convention-plugin</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_10/trunk/struts2-convention-plugin</url>
|
||||
</scm>
|
||||
|
||||
<build>
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<parent>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/dojo</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/dojo</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/dojo</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/dwr</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/dwr</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/dwr</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/embeddedjsp</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/embeddedjsp</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/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
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/trunk/struts2-gxp-plugin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_10/trunk/struts2-gxp-plugin</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_10/trunk/struts2-gxp-plugin</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/jasperreports</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/jasperreports</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/jasperreports</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/javatemplates</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/javatemplates</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/javatemplates</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
+1
-5
@@ -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);
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/jfreechart</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/jfreechart</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/jfreechart</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/jsf</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/jsf</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/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();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/json</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/json</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/json</url>
|
||||
</scm>
|
||||
|
||||
<build>
|
||||
|
||||
+4
-13
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/junit</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/junit</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/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;
|
||||
}
|
||||
}
|
||||
-46
@@ -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;
|
||||
}
|
||||
}
|
||||
-53
@@ -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,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/osgi</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/osgi</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/osgi</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/oval</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/oval</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/oval</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/pell-multipart</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/pell-multipart</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/pell-multipart</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/plexus</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/plexus</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/plexus</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins</url>
|
||||
</scm>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/portlet-tiles</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/portlet-tiles</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/portlet-tiles</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/portlet</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/portlet</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-rest-plugin</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</version>
|
||||
<name>Struts 2 REST Plugin</name>
|
||||
|
||||
<properties>
|
||||
|
||||
+9
-13
@@ -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;
|
||||
|
||||
-126
@@ -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() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/sitegraph</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/sitegraph</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/sitegraph</url>
|
||||
</scm>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/sitemesh</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/sitemesh</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/sitemesh</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/spring</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/spring</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/spring</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/struts1</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/struts1</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/struts1</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/testng</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/testng</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/testng</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/tiles</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/tiles</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/tiles</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/plugins/tiles3</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/plugins/tiles3</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10/plugins/tiles3</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_10</url>
|
||||
</scm>
|
||||
|
||||
<issueManagement>
|
||||
@@ -89,7 +89,7 @@
|
||||
<tiles.version>2.0.6</tiles.version>
|
||||
|
||||
<!-- SCM Site Configuration -->
|
||||
<site.mainDirectory>${project.build.directory}/site</site.mainDirectory>
|
||||
<site.mainDirectory>${user.home}/struts2-site</site.mainDirectory>
|
||||
<siteContent.path>${site.mainDirectory}/staging</siteContent.path>
|
||||
<scmCheckout.path>${site.mainDirectory}/scm</scmCheckout.path>
|
||||
<siteDeploy.url>file://${siteContent.path}</siteDeploy.url>
|
||||
@@ -315,7 +315,6 @@
|
||||
<version>3.1</version>
|
||||
<configuration>
|
||||
<stagingSiteURL>${siteDeploy.url}</stagingSiteURL>
|
||||
<relativizeDecorationLinks>false</relativizeDecorationLinks>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
@@ -7,42 +7,42 @@
|
||||
<archetype>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetype-blank</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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.10</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.10</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.10</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.10</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.10</version>
|
||||
<repository>http://repo1.maven.org/maven2/</repository>
|
||||
<description>Struts 2 Archetypes - Starter</description>
|
||||
</archetype>
|
||||
|
||||
+4
-7
@@ -30,14 +30,14 @@
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>images/struts2.png</src>
|
||||
<href>2.x/index.html</href>
|
||||
<href>http://struts.apache.org/2.x/index.html</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/"/>
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
<menu name="Struts 2">
|
||||
<item name="Welcome"
|
||||
@@ -50,10 +50,7 @@
|
||||
href="http://apache.org/foundation/sponsorship.html"/>
|
||||
</menu>
|
||||
|
||||
<menu name="Parent project">
|
||||
<item name="Apache Struts"
|
||||
href="http://struts.apache.org/"/>
|
||||
</menu>
|
||||
<menu ref="parent" inherit="bottom" />
|
||||
|
||||
<menu name="Documentation">
|
||||
<item name="Getting Started"
|
||||
@@ -137,7 +134,7 @@
|
||||
|
||||
<menu name="Development">
|
||||
<item name="Struts 2.x Draft Docs"
|
||||
href="index.html"/>
|
||||
href="http://struts.apache.org/2.x/index.html"/>
|
||||
<item name="How to Help FAQ"
|
||||
href="http://struts.apache.org/helping.html"/>
|
||||
<item name="Development Lists"
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
<subsection>
|
||||
<p>
|
||||
To download the framework, visit
|
||||
<a href="http://struts.apache.org/download.cgi#struts${aname}">
|
||||
<a href="http://struts.apache.org/download.cgi#struts210">
|
||||
Apache Struts Distributions.
|
||||
</a>
|
||||
For more about Apache Struts 2, visit
|
||||
|
||||
+4
-4
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.10</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_10/xwork-core</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/xwork-core</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_10/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;
|
||||
|
||||
+4
-3
@@ -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)
|
||||
|
||||
+3
-2
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
}
|
||||
@@ -123,17 +123,12 @@ public class DefaultFileManager implements FileManager {
|
||||
if (jarMatcher.matches()) {
|
||||
String path = jarMatcher.group(JAR_FILE_PATH);
|
||||
return new URL("file", "", path);
|
||||
} else if ("file".equals(url.getProtocol())) {
|
||||
return url; // it's already a file
|
||||
} else {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("Could not normalize URL [#0] to file protocol!", url.toString());
|
||||
}
|
||||
return null;
|
||||
return null; //it is not a jar or zip file
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("Error normalizing URL [#0] to file protocol!", e, url.toString());
|
||||
LOG.warn("Error opening url [#0]", e, url.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,14 @@ public class FileRevision extends Revision {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setLastModified(long lastModified) {
|
||||
this.lastModified = lastModified;
|
||||
}
|
||||
|
||||
public long getLastModified() {
|
||||
return lastModified;
|
||||
}
|
||||
|
||||
public boolean needsReloading() {
|
||||
return this.lastModified < this.file.lastModified();
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.zip.ZipEntry;
|
||||
/**
|
||||
* Represents jar resource revision, used for jar://* resource
|
||||
*/
|
||||
public class JarEntryRevision extends Revision {
|
||||
class JarEntryRevision extends Revision {
|
||||
|
||||
private static Logger LOG = LoggerFactory.getLogger(JarEntryRevision.class);
|
||||
|
||||
@@ -24,6 +24,27 @@ public class JarEntryRevision extends Revision {
|
||||
private String fileNameInJar;
|
||||
private long lastModified;
|
||||
|
||||
public JarEntryRevision(String jarFileName, String fileNameInJar, long lastModified) {
|
||||
if ((jarFileName == null) || (fileNameInJar == null)) {
|
||||
throw new IllegalArgumentException("JarFileName and FileNameInJar cannot be null");
|
||||
}
|
||||
this.jarFileName = jarFileName;
|
||||
this.fileNameInJar = fileNameInJar;
|
||||
this.lastModified = lastModified;
|
||||
}
|
||||
|
||||
public boolean needsReloading() {
|
||||
ZipEntry entry;
|
||||
try {
|
||||
JarFile jarFile = new JarFile(this.jarFileName);
|
||||
entry = jarFile.getEntry(this.fileNameInJar);
|
||||
} catch (IOException e) {
|
||||
entry = null;
|
||||
}
|
||||
|
||||
return entry != null && (lastModified < entry.getTime());
|
||||
}
|
||||
|
||||
public static Revision build(URL fileUrl, FileManager fileManager) {
|
||||
// File within a Jar
|
||||
// Find separator index of jar filename and filename within jar
|
||||
@@ -49,37 +70,15 @@ public class JarEntryRevision extends Revision {
|
||||
if (url != null) {
|
||||
JarFile jarFile = new JarFile(FileUtils.toFile(url));
|
||||
ZipEntry entry = jarFile.getEntry(fileNameInJar);
|
||||
return new JarEntryRevision(jarFileName, fileNameInJar, entry.getTime());
|
||||
return new JarEntryRevision(jarFileName.toString(), fileNameInJar, entry.getTime());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("Could not create JarEntryRevision for [#0]!", e, jarFileName);
|
||||
LOG.warn("Could not create JarEntryRevision for [" + jarFileName + "]!", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private JarEntryRevision(String jarFileName, String fileNameInJar, long lastModified) {
|
||||
if ((jarFileName == null) || (fileNameInJar == null)) {
|
||||
throw new IllegalArgumentException("JarFileName and FileNameInJar cannot be null");
|
||||
}
|
||||
this.jarFileName = jarFileName;
|
||||
this.fileNameInJar = fileNameInJar;
|
||||
this.lastModified = lastModified;
|
||||
}
|
||||
|
||||
public boolean needsReloading() {
|
||||
ZipEntry entry;
|
||||
try {
|
||||
JarFile jarFile = new JarFile(this.jarFileName);
|
||||
entry = jarFile.getEntry(this.fileNameInJar);
|
||||
} catch (IOException e) {
|
||||
entry = null;
|
||||
}
|
||||
|
||||
return entry != null && (lastModified < entry.getTime());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user