mirror of
https://github.com/apache/struts.git
synced 2026-08-09 00:27:04 +00:00
Compare commits
85 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3f3776e7dc | |||
| f127bc7286 | |||
| 961009cd39 | |||
| c6fb6d144f | |||
| f7dba7b853 | |||
| 6f47a77d72 | |||
| 184ded056d | |||
| 27f9f37eb7 | |||
| 9277a16673 | |||
| f01991d171 | |||
| 96768e036d | |||
| f19092287a | |||
| a36bb71940 | |||
| 6fb02f2f1b | |||
| 9bc7147442 | |||
| 50f4589980 | |||
| ebdbc16d59 | |||
| 16cf4d70e9 | |||
| f36a3a6d42 | |||
| 5a758b8e8b | |||
| 3a4abdf91d | |||
| 1994d0549d | |||
| d95d3cb354 | |||
| d404748283 | |||
| 6f40619bd2 | |||
| e4700527af | |||
| d4f360efda | |||
| 46293f9ce8 | |||
| 730abcdfb9 | |||
| cc423fc301 | |||
| 8325875695 | |||
| 81b7a53826 | |||
| 0bf060b69c | |||
| c9d10a6b05 | |||
| ca8f4918ff | |||
| bebf30f3d1 | |||
| 00e0774c53 | |||
| c1217a062a | |||
| d3e8df9120 | |||
| cafd919f15 | |||
| 46ba2d10c5 | |||
| 7a8c0fee0c | |||
| 5fdcb87b42 | |||
| e0e2c4fbb8 | |||
| 31fde5a067 | |||
| af7ba45753 | |||
| c09ec96da2 | |||
| ebe522c6e9 | |||
| e957eedb95 | |||
| 9f6c296d42 | |||
| 353c2f2033 | |||
| 19b1bbba27 | |||
| d04a467f58 | |||
| 60fdb065c5 | |||
| 2f7177ce8f | |||
| 7e0ad932de | |||
| d89c7186a1 | |||
| a5d0e408c6 | |||
| 81fee36664 | |||
| 976863cfb7 | |||
| 51a68818dc | |||
| c1c5c44897 | |||
| 9159be55cd | |||
| 4593090a00 | |||
| a6f1e0d755 | |||
| 17ea15b208 | |||
| b92fae8200 | |||
| fe7a12574b | |||
| 0fd40525cd | |||
| 4eb9f31c67 | |||
| 125522566e | |||
| 49e5110dd4 | |||
| 577840562a | |||
| 6539d0dd80 | |||
| b2cf05e87a | |||
| 3959fe30f4 | |||
| 22949c709d | |||
| 5448b55542 | |||
| 350acd8bc9 | |||
| 813ea065ad | |||
| ccbc28feee | |||
| a94d6c0dca | |||
| eca561c674 | |||
| eae2fc668a | |||
| 3e33a7b70c |
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</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_1_7/apps/blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/blank</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/apps/blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/apps/blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_8/apps/blank</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-mailreader</artifactId>
|
||||
@@ -34,9 +34,9 @@
|
||||
<name>Starter Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/mailreader</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/mailreader</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/mailreader</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/apps/mailreader</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/apps/mailreader</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_8/apps/mailreader</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
@@ -41,9 +41,9 @@
|
||||
</modules>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/apps</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/apps</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_8/apps</url>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</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_1_7/apps/portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/portlet</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/portlet</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/apps/portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/apps/portlet</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_8/apps/portlet</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-rest-showcase</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</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.1.7</version>
|
||||
<version>2.1.8</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_1_7/apps/showcase</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/apps/showcase</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/apps/showcase</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/apps/showcase</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/apps/showcase</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_8/apps/showcase</url>
|
||||
</scm>
|
||||
|
||||
|
||||
|
||||
+36
-11
@@ -11,13 +11,13 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</version>
|
||||
</parent>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/assembly</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/assembly</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/assembly</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/assembly</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/assembly</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_8/assembly</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
@@ -72,7 +72,7 @@
|
||||
<dependency>
|
||||
<groupId>com.opensymphony</groupId>
|
||||
<artifactId>xwork-core</artifactId>
|
||||
<version>2.1.4</version>
|
||||
<version>2.1.6</version>
|
||||
<type>jar</type>
|
||||
<classifier>jdk14</classifier>
|
||||
<scope>runtime</scope>
|
||||
@@ -175,6 +175,20 @@
|
||||
<version>${version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-json-plugin</artifactId>
|
||||
<version>${version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-embeddedjsp-plugin</artifactId>
|
||||
<version>${version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
@@ -245,7 +259,7 @@
|
||||
<groupId>com.opensymphony</groupId>
|
||||
<artifactId>xwork-core</artifactId>
|
||||
<classifier>javadoc</classifier>
|
||||
<version>2.1.4</version>
|
||||
<version>2.1.6</version>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
<outputDirectory>${project.build.directory}/xwork-apidocs</outputDirectory>
|
||||
@@ -267,19 +281,17 @@
|
||||
<arg line="${username}@people.apache.org /www/struts.apache.org/2.x/docs-zip2.sh" />
|
||||
</exec>
|
||||
<unzip src="${project.build.directory}/docs.zip" dest="${project.build.directory}/cwiki" />
|
||||
-->
|
||||
<exec executable="wget">
|
||||
<arg value="-erobots=off" />
|
||||
<arg value="-nH" />
|
||||
<arg value="-nv" />
|
||||
<arg value="-E" />
|
||||
<arg value="-L" />
|
||||
<arg value="--directory-prefix=${project.build.directory}/cwiki" />
|
||||
<arg value="-r" />
|
||||
<arg value="http://struts.apache.org/2.x/docs/" />
|
||||
<arg value="http://cwiki.apache.org/WW/" />
|
||||
</exec>
|
||||
-->
|
||||
<copy todir="${project.build.directory}/cwiki">
|
||||
<fileset dir="${docsDir}" />
|
||||
</copy>
|
||||
</tasks>
|
||||
</configuration>
|
||||
<goals>
|
||||
@@ -443,6 +455,18 @@
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-json-plugin</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-embeddedjsp-plugin</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-plugin</artifactId>
|
||||
@@ -460,6 +484,7 @@
|
||||
<artifactId>struts2-osgi-demo-bundle</artifactId>
|
||||
<version>${version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -219,6 +219,14 @@
|
||||
<directory>../plugins/osgi/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-osgi-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../plugins/json/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-json-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../plugins/embeddedjsp/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-embeddedjsp-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
<!-- bundles -->
|
||||
<fileSet>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
<!-- Include the Confluence docs in the assembly -->
|
||||
<fileSet>
|
||||
<directory>target/cwiki</directory>
|
||||
<directory>target/cwiki/WW</directory>
|
||||
<outputDirectory>docs</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
@@ -135,6 +135,14 @@
|
||||
<directory>../plugins/osgi/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-osgi-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../plugins/json/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-json-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>../plugins/embeddedjsp/target/site</directory>
|
||||
<outputDirectory>docs/struts2-plugins/struts2-embeddedjsp-plugin</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
</fileSets>
|
||||
</assembly>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</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_1_7/bundles/admin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles/admin</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/bundles/admin</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/bundles/admin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/bundles/admin</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_8/bundles/admin</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</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_1_7/bundles/demo</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles/demo</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/bundles/demo</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/bundles/demo</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/bundles/demo</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_8/bundles/demo</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</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_1_7/bundles</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/bundles</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/bundles</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/bundles</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/bundles</url>
|
||||
</scm>
|
||||
|
||||
<modules>
|
||||
|
||||
+15
-9
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</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_1_7/core</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/core</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/core</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/core</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/core</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_8/core</url>
|
||||
</scm>
|
||||
|
||||
<build>
|
||||
@@ -56,7 +56,7 @@
|
||||
<artifactItem>
|
||||
<groupId>com.opensymphony</groupId>
|
||||
<artifactId>xwork-core</artifactId>
|
||||
<version>2.1.4</version>
|
||||
<version>2.1.6</version>
|
||||
<classifier>sources</classifier>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
@@ -229,7 +229,7 @@
|
||||
<dependency>
|
||||
<groupId>com.opensymphony</groupId>
|
||||
<artifactId>xwork-core</artifactId>
|
||||
<version>2.1.4</version>
|
||||
<version>2.1.6</version>
|
||||
</dependency>
|
||||
|
||||
<!--<dependency>-->
|
||||
@@ -241,7 +241,7 @@
|
||||
<dependency>
|
||||
<groupId>org.freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
<version>2.3.13</version>
|
||||
<version>2.3.15</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -259,9 +259,15 @@
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>opensymphony</groupId>
|
||||
<groupId>ognl</groupId>
|
||||
<artifactId>ognl</artifactId>
|
||||
<version>2.6.11</version>
|
||||
<version>2.7.3</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>jboss</groupId>
|
||||
<artifactId>javassist</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- Velocity -->
|
||||
|
||||
@@ -209,4 +209,7 @@ public final class StrutsConstants {
|
||||
|
||||
/** Logs properties that are not found (very verbose) **/
|
||||
public static final String STRUTS_LOG_MISSING_PROPERTIES = "struts.ognl.logMissingProperties";
|
||||
|
||||
/** Enables caching of parsed OGNL expressions **/
|
||||
public static final String STRUTS_ENABLE_OGNL_EXPRESSION_CACHE = "struts.ognl.enableExpressionCache";
|
||||
}
|
||||
|
||||
@@ -133,6 +133,7 @@ public class ActionComponent extends ContextBean {
|
||||
protected boolean executeResult;
|
||||
protected boolean ignoreContextParams;
|
||||
protected boolean flush = true;
|
||||
protected boolean rethrowException;
|
||||
|
||||
public ActionComponent(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack);
|
||||
@@ -253,7 +254,7 @@ public class ActionComponent extends ContextBean {
|
||||
*
|
||||
* @see org.apache.struts2.views.jsp.TagUtils#buildNamespace
|
||||
*/
|
||||
private void executeAction() {
|
||||
protected void executeAction() {
|
||||
String actualName = findString(name, "name", "Action name is required. Example: updatePerson");
|
||||
|
||||
if (actualName == null) {
|
||||
@@ -290,6 +291,9 @@ public class ActionComponent extends ContextBean {
|
||||
} catch (Exception e) {
|
||||
String message = "Could not execute action: " + namespace + "/" + actualName;
|
||||
LOG.error(message, e);
|
||||
if (rethrowException) {
|
||||
throw new StrutsException(message, e);
|
||||
}
|
||||
} finally {
|
||||
// set the old stack back on the request
|
||||
req.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);
|
||||
@@ -327,4 +331,9 @@ public class ActionComponent extends ContextBean {
|
||||
public void setFlush(boolean flush) {
|
||||
this.flush = flush;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Whether an exception should be rethrown, if the target action throws an exception", type="Boolean", defaultValue="false")
|
||||
public void setRethrowException(boolean rethrowException) {
|
||||
this.rethrowException = rethrowException;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,14 +25,20 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.commons.lang.xwork.StringUtils;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
* Render action errors if they exists the specific layout of the rendering depends on
|
||||
* the theme itself.
|
||||
* the theme itself. Empty (null or blank string) errors will not be printed. The action error
|
||||
* strings will be html escaped by default.
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -54,7 +60,7 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
public class ActionError extends UIBean {
|
||||
|
||||
public static final String TEMPLATE = "actionerror";
|
||||
|
||||
private boolean escape = true;
|
||||
|
||||
public ActionError(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
@@ -64,4 +70,24 @@ public class ActionError extends UIBean {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
protected void evaluateExtraParams() {
|
||||
boolean isEmptyList = true;
|
||||
Collection<String> actionMessages = (List) findValue("actionErrors");
|
||||
if (actionMessages != null) {
|
||||
for (String message : actionMessages) {
|
||||
if (StringUtils.isNotBlank(message)) {
|
||||
isEmptyList = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addParameter("isEmptyList", isEmptyList);
|
||||
addParameter("escape", escape);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description=" Whether to escape HTML", type="Boolean", defaultValue="true")
|
||||
public void setEscape(boolean escape) {
|
||||
this.escape = escape;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,14 +25,20 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.commons.lang.xwork.StringUtils;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
* Render action messages if they exists, specific rendering layout depends on the
|
||||
* theme itself.
|
||||
* theme itself. Empty (null or blank string) messages will not be printed. The action message
|
||||
* strings will be html escaped by default.
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -52,6 +58,7 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
public class ActionMessage extends UIBean {
|
||||
|
||||
private static final String TEMPLATE = "actionmessage";
|
||||
protected boolean escape = true;
|
||||
|
||||
public ActionMessage(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
@@ -60,4 +67,25 @@ public class ActionMessage extends UIBean {
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
protected void evaluateExtraParams() {
|
||||
boolean isEmptyList = true;
|
||||
Collection<String> actionMessages = (List) findValue("actionMessages");
|
||||
if (actionMessages != null) {
|
||||
for (String message : actionMessages) {
|
||||
if (StringUtils.isNotBlank(message)) {
|
||||
isEmptyList = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addParameter("isEmptyList", isEmptyList);
|
||||
addParameter("escape", escape);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description=" Whether to escape HTML", type="Boolean", defaultValue="true")
|
||||
public void setEscape(boolean escape) {
|
||||
this.escape = escape;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import java.util.List;
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
* Render field errors if they exists. Specific layout depends on the particular theme.
|
||||
* The field error strings will be html escaped by default.
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
@@ -91,6 +92,7 @@ import java.util.List;
|
||||
public class FieldError extends UIBean implements UnnamedParametric {
|
||||
|
||||
private List<String> errorFieldNames = new ArrayList<String>();
|
||||
private boolean escape = true;
|
||||
|
||||
public FieldError(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
@@ -107,7 +109,9 @@ public class FieldError extends UIBean implements UnnamedParametric {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
if (errorFieldNames != null)
|
||||
addParameter("errorFieldNames", errorFieldNames);
|
||||
addParameter("errorFieldNames", errorFieldNames);
|
||||
|
||||
addParameter("escape", escape);
|
||||
}
|
||||
|
||||
public void addParameter(Object value) {
|
||||
@@ -124,5 +128,10 @@ public class FieldError extends UIBean implements UnnamedParametric {
|
||||
public void setFieldName(String fieldName) {
|
||||
addParameter(fieldName);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description=" Whether to escape HTML", type="Boolean", defaultValue="true")
|
||||
public void setEscape(boolean escape) {
|
||||
this.escape = escape;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
@@ -49,4 +50,6 @@ public interface UrlRenderer {
|
||||
*/
|
||||
void renderFormUrl(Form formComponent);
|
||||
|
||||
void setActionMapper(ActionMapper actionMapper);
|
||||
|
||||
}
|
||||
|
||||
+12
-4
@@ -52,11 +52,11 @@ import freemarker.core.ParseException;
|
||||
*/
|
||||
public class FreemarkerTemplateEngine extends BaseTemplateEngine {
|
||||
static Class bodyContent = null;
|
||||
private FreemarkerManager freemarkerManager;
|
||||
protected FreemarkerManager freemarkerManager;
|
||||
|
||||
private final Map<String, freemarker.template.Template> templates = new ConcurrentHashMap<String, freemarker.template.Template>();
|
||||
private final Set<String> missingTemplates = new CopyOnWriteArraySet<String>();
|
||||
private boolean freemarkerCaching = false;
|
||||
protected final Map<String, freemarker.template.Template> templates = new ConcurrentHashMap<String, freemarker.template.Template>();
|
||||
protected final Set<String> missingTemplates = new CopyOnWriteArraySet<String>();
|
||||
protected boolean freemarkerCaching = false;
|
||||
|
||||
static {
|
||||
try {
|
||||
@@ -216,4 +216,12 @@ public class FreemarkerTemplateEngine extends BaseTemplateEngine {
|
||||
public void setCacheTemplates(String cacheTemplates) {
|
||||
freemarkerCaching = "true".equals(cacheTemplates);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear the templates and missing templates cache
|
||||
*/
|
||||
public void clearTemplatesCache() {
|
||||
templates.clear();
|
||||
missingTemplates.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,6 +231,9 @@ public class BeanSelectionProvider implements ConfigurationProvider {
|
||||
if (props.containsKey(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES))
|
||||
props.setProperty("logMissingProperties", props.getProperty(StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES));
|
||||
|
||||
if (props.containsKey(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE))
|
||||
props.setProperty("enableOGNLExpressionCache", props.getProperty(StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE));
|
||||
|
||||
String val = props.getProperty(StrutsConstants.STRUTS_ALLOW_STATIC_METHOD_ACCESS);
|
||||
if (val != null) {
|
||||
props.setProperty("allowStaticMethodAccess", val);
|
||||
|
||||
@@ -63,8 +63,13 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
*
|
||||
* <li><b>allowCaching</b> if set to 'false' it will set the headers 'Pragma' and 'Cache-Control'
|
||||
* to 'no-cahce', and prevent client from caching the content. (default = <code>true</code>)
|
||||
* </ul>
|
||||
*
|
||||
* <li><b>contentCharSet</b> if set to a string, ';charset=value' will be added to the
|
||||
* content-type header, where value is the string set. If set to an expression, the result
|
||||
* of evaluating the expression will be used. If not set, then no charset will be set on
|
||||
* the header</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>These parameters can also be set by exposing a similarly named getter method on your Action. For example, you can
|
||||
* provide <code>getContentType()</code> to override that parameter for the current action.</p>
|
||||
*
|
||||
@@ -93,6 +98,7 @@ public class StreamResult extends StrutsResultSupport {
|
||||
protected String contentType = "text/plain";
|
||||
protected String contentLength;
|
||||
protected String contentDisposition = "inline";
|
||||
protected String contentCharSet ;
|
||||
protected String inputName = "inputStream";
|
||||
protected InputStream inputStream;
|
||||
protected int bufferSize = 1024;
|
||||
@@ -180,6 +186,20 @@ public class StreamResult extends StrutsResultSupport {
|
||||
this.contentDisposition = contentDisposition;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the charset specified by the user
|
||||
*/
|
||||
public String getContentCharSet() {
|
||||
return contentCharSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param contentCharSet the charset to use on the header when sending the stream
|
||||
*/
|
||||
public void setContentCharSet(String contentCharSet) {
|
||||
this.contentCharSet = contentCharSet;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the inputName.
|
||||
*/
|
||||
@@ -200,7 +220,7 @@ public class StreamResult extends StrutsResultSupport {
|
||||
protected void doExecute(String finalLocation, ActionInvocation invocation) throws Exception {
|
||||
|
||||
// Override any parameters using values on the stack
|
||||
resolveParamsFromStack(invocation.getStack());
|
||||
resolveParamsFromStack(invocation.getStack(), invocation);
|
||||
|
||||
OutputStream oOutput = null;
|
||||
|
||||
@@ -221,7 +241,12 @@ public class StreamResult extends StrutsResultSupport {
|
||||
HttpServletResponse oResponse = (HttpServletResponse) invocation.getInvocationContext().get(HTTP_RESPONSE);
|
||||
|
||||
// Set the content type
|
||||
oResponse.setContentType(conditionalParse(contentType, invocation));
|
||||
if (contentCharSet != null && ! contentCharSet.equals("")) {
|
||||
oResponse.setContentType(conditionalParse(contentType, invocation)+";charset="+contentCharSet);
|
||||
}
|
||||
else {
|
||||
oResponse.setContentType(conditionalParse(contentType, invocation));
|
||||
}
|
||||
|
||||
// Set the content length
|
||||
if (contentLength != null) {
|
||||
@@ -254,7 +279,7 @@ public class StreamResult extends StrutsResultSupport {
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Streaming result [" + inputName + "] type=[" + contentType + "] length=[" + contentLength +
|
||||
"] content-disposition=[" + contentDisposition + "]");
|
||||
"] content-disposition=[" + contentDisposition + "] charset=[" + contentCharSet + "]");
|
||||
}
|
||||
|
||||
// Copy input to output
|
||||
@@ -280,7 +305,7 @@ public class StreamResult extends StrutsResultSupport {
|
||||
*
|
||||
* @param stack The current value stack
|
||||
*/
|
||||
protected void resolveParamsFromStack(ValueStack stack) {
|
||||
protected void resolveParamsFromStack(ValueStack stack, ActionInvocation invocation) {
|
||||
String disposition = stack.findString("contentDisposition");
|
||||
if (disposition != null) {
|
||||
setContentDisposition(disposition);
|
||||
@@ -305,6 +330,13 @@ public class StreamResult extends StrutsResultSupport {
|
||||
if (bufferSize != null) {
|
||||
setBufferSize(bufferSize.intValue());
|
||||
}
|
||||
|
||||
if (contentCharSet != null ) {
|
||||
contentCharSet = conditionalParse(contentCharSet, invocation);
|
||||
}
|
||||
else {
|
||||
contentCharSet = stack.findString("contentCharSet");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
* <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts"
|
||||
* class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper" />
|
||||
* <constant name="struts.mapper.composite"
|
||||
* value="org.apache.struts2.dispatcher.mapper.DefaultActionMapper,org.apache.struts2.dispatcher.mapper.RestfulActionMapperorg.apache.struts2.dispatcher.mapper.Restful2ActionMapper" />
|
||||
* value="org.apache.struts2.dispatcher.mapper.DefaultActionMapper,org.apache.struts2.dispatcher.mapper.RestfulActionMapper,org.apache.struts2.dispatcher.mapper.Restful2ActionMapper" />
|
||||
* </pre>
|
||||
* <p/>
|
||||
* When {@link CompositeActionMapper#getMapping(HttpServletRequest, ConfigurationManager)} or
|
||||
|
||||
@@ -123,14 +123,11 @@ public class RestfulActionMapper implements ActionMapper {
|
||||
StringBuilder retVal = new StringBuilder();
|
||||
retVal.append(mapping.getNamespace());
|
||||
retVal.append(mapping.getName());
|
||||
for (Map.Entry<String, Object> entry : mapping.getParams().entrySet()) {
|
||||
String name = entry.getKey();
|
||||
if (name.equals(mapping.getName() + "Id")) {
|
||||
retVal.append("/");
|
||||
retVal.append(entry.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
Object value = mapping.getParams().get(mapping.getName() + "Id");
|
||||
if (value != null) {
|
||||
retVal.append("/");
|
||||
retVal.append(value);
|
||||
}
|
||||
|
||||
return retVal.toString();
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ import java.io.IOException;
|
||||
* been executed in the current chain.
|
||||
*/
|
||||
public class StrutsExecuteFilter implements StrutsStatics, Filter {
|
||||
private PrepareOperations prepare;
|
||||
private ExecuteOperations execute;
|
||||
protected PrepareOperations prepare;
|
||||
protected ExecuteOperations execute;
|
||||
|
||||
private FilterConfig filterConfig;
|
||||
protected FilterConfig filterConfig;
|
||||
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
this.filterConfig = filterConfig;
|
||||
@@ -74,7 +74,12 @@ public class StrutsExecuteFilter implements StrutsStatics, Filter {
|
||||
}
|
||||
|
||||
ActionMapping mapping = prepare.findActionMapping(request, response);
|
||||
if (mapping == null) {
|
||||
|
||||
//if recusrion counter is > 1, it means we are in a "forward", in that case a mapping will still be
|
||||
//in the request, if we handle it, it will lead to an infinte loop, see WW-3077
|
||||
Integer recursionCounter = (Integer) request.getAttribute(PrepareOperations.CLEANUP_RECURSION_COUNTER);
|
||||
|
||||
if (mapping == null || recursionCounter > 1) {
|
||||
boolean handled = execute.executeStaticResourceRequest(request, response);
|
||||
if (!handled) {
|
||||
chain.doFilter(request, response);
|
||||
|
||||
+11
-3
@@ -39,8 +39,8 @@ import java.util.regex.Pattern;
|
||||
* when you don't have another filter that needs access to action context information, such as Sitemesh.
|
||||
*/
|
||||
public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter {
|
||||
private PrepareOperations prepare;
|
||||
private ExecuteOperations execute;
|
||||
protected PrepareOperations prepare;
|
||||
protected ExecuteOperations execute;
|
||||
protected List<Pattern> excludedPatterns = null;
|
||||
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
@@ -54,12 +54,20 @@ public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter {
|
||||
prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
|
||||
execute = new ExecuteOperations(filterConfig.getServletContext(), dispatcher);
|
||||
this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
|
||||
|
||||
postInit(dispatcher, filterConfig);
|
||||
} finally {
|
||||
init.cleanup();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for post initialization
|
||||
*/
|
||||
protected void postInit(Dispatcher dispatcher, FilterConfig filterConfig) {
|
||||
}
|
||||
|
||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
|
||||
|
||||
HttpServletRequest request = (HttpServletRequest) req;
|
||||
@@ -69,10 +77,10 @@ public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter {
|
||||
prepare.setEncodingAndLocale(request, response);
|
||||
prepare.createActionContext(request, response);
|
||||
prepare.assignDispatcherToThread();
|
||||
request = prepare.wrapRequest(request);
|
||||
if ( excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) {
|
||||
chain.doFilter(request, response);
|
||||
} else {
|
||||
request = prepare.wrapRequest(request);
|
||||
ActionMapping mapping = prepare.findActionMapping(request, response, true);
|
||||
if (mapping == null) {
|
||||
boolean handled = execute.executeStaticResourceRequest(request, response);
|
||||
|
||||
+11
-4
@@ -39,8 +39,8 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter {
|
||||
|
||||
protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING = StrutsPrepareFilter.class.getName() + ".REQUEST_EXCLUDED_FROM_ACTION_MAPPING";
|
||||
|
||||
private PrepareOperations prepare;
|
||||
private List<Pattern> excludedPatterns = null;
|
||||
protected PrepareOperations prepare;
|
||||
protected List<Pattern> excludedPatterns = null;
|
||||
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
InitOperations init = new InitOperations();
|
||||
@@ -51,10 +51,17 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter {
|
||||
|
||||
prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
|
||||
this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
|
||||
|
||||
postInit(dispatcher, filterConfig);
|
||||
} finally {
|
||||
init.cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback for post initialization
|
||||
*/
|
||||
protected void postInit(Dispatcher dispatcher, FilterConfig filterConfig) {
|
||||
}
|
||||
|
||||
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
|
||||
@@ -66,10 +73,10 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter {
|
||||
prepare.setEncodingAndLocale(request, response);
|
||||
prepare.createActionContext(request, response);
|
||||
prepare.assignDispatcherToThread();
|
||||
request = prepare.wrapRequest(request);
|
||||
if ( excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) {
|
||||
request.setAttribute(REQUEST_EXCLUDED_FROM_ACTION_MAPPING, new Object());
|
||||
} else {
|
||||
request = prepare.wrapRequest(request);
|
||||
prepare.findActionMapping(request, response);
|
||||
}
|
||||
chain.doFilter(request, response);
|
||||
@@ -81,4 +88,4 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter {
|
||||
public void destroy() {
|
||||
prepare.cleanupDispatcher();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* $Id: BackgroundProcess.java 651946 2008-04-27 13:41:38Z apetrelli $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.interceptor;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
|
||||
|
||||
|
||||
/**
|
||||
* Just as the CheckboxInterceptor checks that if only the hidden field is present, so too does this interceptor. If
|
||||
* the "__multiselect_" request parameter is present and its visible counterpart is not, set a new request parameter to an
|
||||
* empty Sting.
|
||||
*/
|
||||
public class MultiselectInterceptor extends AbstractInterceptor {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Just as the CheckboxInterceptor checks that if only the hidden field is present, so too does this interceptor.
|
||||
* If the "__multiselect_" request parameter is present and its visible counterpart is not, set a new request parameter
|
||||
* to an empty Sting.
|
||||
*
|
||||
* @param actionInvocation ActionInvocation
|
||||
* @return the result of the action
|
||||
* @throws Exception if error
|
||||
* @see com.opensymphony.xwork2.interceptor.Interceptor#intercept(com.opensymphony.xwork2.ActionInvocation)
|
||||
*/
|
||||
public String intercept(ActionInvocation actionInvocation) throws Exception {
|
||||
Map parameters = actionInvocation.getInvocationContext().getParameters();
|
||||
Map<String, Object> newParams = new HashMap<String, Object>();
|
||||
Set<String> keys = parameters.keySet();
|
||||
|
||||
for (Iterator<String> iterator = keys.iterator(); iterator.hasNext();) {
|
||||
String key = iterator.next();
|
||||
|
||||
if (key.startsWith("__multiselect_")) {
|
||||
String name = key.substring("__multiselect_".length());
|
||||
|
||||
iterator.remove();
|
||||
|
||||
// is this multi-select box submitted?
|
||||
if (!parameters.containsKey(name)) {
|
||||
|
||||
// if not, let's be sure to default the value to an empty string array
|
||||
newParams.put(name, new String[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
parameters.putAll(newParams);
|
||||
|
||||
return actionInvocation.invoke();
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class ContainUtil {
|
||||
Object value = null;
|
||||
value = Array.get(obj1, i);
|
||||
|
||||
if (value.equals(obj2)) {
|
||||
if (obj2.equals(value)) {
|
||||
//log.debug("obj1 is an array and contains obj2");
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -37,8 +37,20 @@ public class ActionErrorTag extends AbstractUITag {
|
||||
|
||||
private static final long serialVersionUID = -3710234378022378639L;
|
||||
|
||||
private boolean escape = true;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new ActionError(stack, req, res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
ActionError error = (ActionError) component;
|
||||
error.setEscape(escape);
|
||||
}
|
||||
|
||||
public void setEscape(boolean escape) {
|
||||
this.escape = escape;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.ActionMessage;
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.components.ActionError;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
@@ -37,7 +38,20 @@ public class ActionMessageTag extends AbstractUITag {
|
||||
|
||||
private static final long serialVersionUID = 243396927554182506L;
|
||||
|
||||
private boolean escape = true;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new ActionMessage(stack, req, res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
ActionMessage message = (ActionMessage) component;
|
||||
message.setEscape(escape);
|
||||
}
|
||||
|
||||
public void setEscape(boolean escape) {
|
||||
this.escape = escape;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ public class FieldErrorTag extends AbstractUITag {
|
||||
private static final long serialVersionUID = -182532967507726323L;
|
||||
|
||||
protected String fieldName;
|
||||
protected boolean escape = true;
|
||||
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
@@ -48,10 +49,15 @@ public class FieldErrorTag extends AbstractUITag {
|
||||
|
||||
FieldError fieldError = ((FieldError) component);
|
||||
fieldError.setFieldName(this.fieldName);
|
||||
fieldError.setEscape(escape);
|
||||
}
|
||||
|
||||
public void setFieldName(String fieldName) {
|
||||
this.fieldName = fieldName;
|
||||
}
|
||||
|
||||
public void setEscape(boolean escape) {
|
||||
this.escape = escape;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+22
-3
@@ -94,15 +94,34 @@ public abstract class AbstractDirective extends Directive {
|
||||
* if the was an error in the format of the property
|
||||
*/
|
||||
protected Map createPropertyMap(InternalContextAdapter contextAdapter, Node node) throws ParseErrorException, MethodInvocationException {
|
||||
Map propertyMap = new HashMap();
|
||||
Map propertyMap;
|
||||
|
||||
int children = node.jjtGetNumChildren();
|
||||
if (getType() == BLOCK) {
|
||||
children--;
|
||||
}
|
||||
|
||||
for (int index = 0, length = children; index < length; index++) {
|
||||
this.putProperty(propertyMap, contextAdapter, node.jjtGetChild(index));
|
||||
// Velocity supports an on-the-fly Map-definition syntax that leads
|
||||
// to more readable and faster code:
|
||||
//
|
||||
// #url({'id':'url', 'action':'MyAction'})
|
||||
//
|
||||
// We support this syntax by checking for a single Map argument
|
||||
// to any directive and using that as the property map instead
|
||||
// of building one from individual name-value pair strings.
|
||||
Node firstChild = null;
|
||||
Object firstValue = null;
|
||||
if(children == 1
|
||||
&& null != (firstChild = node.jjtGetChild(0))
|
||||
&& null != (firstValue = firstChild.value(contextAdapter))
|
||||
&& firstValue instanceof Map) {
|
||||
propertyMap = (Map)firstValue;
|
||||
} else {
|
||||
propertyMap = new HashMap();
|
||||
|
||||
for (int index = 0, length = children; index < length; index++) {
|
||||
this.putProperty(propertyMap, contextAdapter, node.jjtGetChild(index));
|
||||
}
|
||||
}
|
||||
|
||||
return propertyMap;
|
||||
|
||||
@@ -229,7 +229,7 @@ public class AdapterFactory {
|
||||
* @param parent
|
||||
* @param propertyName
|
||||
*/
|
||||
public Node adaptNullValue(BeanAdapter parent, String propertyName) {
|
||||
public Node adaptNullValue(AdapterNode parent, String propertyName) {
|
||||
return new StringAdapter(this, parent, propertyName, "null");
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,12 @@ public class CollectionAdapter extends AbstractAdapterElement {
|
||||
List<Node> children = new ArrayList<Node>(values.size());
|
||||
|
||||
for (Object value : values) {
|
||||
Node childAdapter = getAdapterFactory().adaptNode(this, "item", value);
|
||||
Node childAdapter;
|
||||
if (value == null) {
|
||||
childAdapter = getAdapterFactory().adaptNullValue(this, "item");
|
||||
} else {
|
||||
childAdapter = getAdapterFactory().adaptNode(this, "item", value);
|
||||
}
|
||||
if (childAdapter != null)
|
||||
children.add(childAdapter);
|
||||
|
||||
|
||||
@@ -203,4 +203,7 @@ struts.el.throwExceptionOnFailure=false
|
||||
### Logs as Warnings properties that are not found (very verbose)
|
||||
struts.ognl.logMissingProperties=false
|
||||
|
||||
### Caches parsed OGNL expressions, but can lead to memory leaks
|
||||
### if the application generates a lot of different expressions
|
||||
struts.ognl.enableExpressionCache=true
|
||||
### END SNIPPET: complete_file
|
||||
|
||||
@@ -154,6 +154,7 @@
|
||||
<interceptor name="roles" class="org.apache.struts2.interceptor.RolesInterceptor" />
|
||||
<interceptor name="jsonValidation" class="org.apache.struts2.interceptor.validation.JSONValidationInterceptor" />
|
||||
<interceptor name="annotationWorkflow" class="com.opensymphony.xwork2.interceptor.annotations.AnnotationWorkflowInterceptor" />
|
||||
<interceptor name="multiselect" class="org.apache.struts2.interceptor.MultiselectInterceptor" />
|
||||
|
||||
<!-- Basic stack -->
|
||||
<interceptor-stack name="basicStack">
|
||||
@@ -161,6 +162,7 @@
|
||||
<interceptor-ref name="servletConfig"/>
|
||||
<interceptor-ref name="prepare"/>
|
||||
<interceptor-ref name="checkbox"/>
|
||||
<interceptor-ref name="multiselect"/>
|
||||
<interceptor-ref name="actionMappingParams"/>
|
||||
<interceptor-ref name="params">
|
||||
<param name="excludeParams">dojo\..*,^struts\..*</param>
|
||||
@@ -226,6 +228,7 @@
|
||||
<interceptor-ref name="alias"/>
|
||||
<interceptor-ref name="i18n"/>
|
||||
<interceptor-ref name="checkbox"/>
|
||||
<interceptor-ref name="multiselect"/>
|
||||
<interceptor-ref name="params">
|
||||
<param name="excludeParams">dojo\..*,^struts\..*</param>
|
||||
</interceptor-ref>
|
||||
@@ -267,11 +270,11 @@
|
||||
<interceptor-ref name="prepare"/>
|
||||
<interceptor-ref name="chain"/>
|
||||
<interceptor-ref name="debugging"/>
|
||||
<interceptor-ref name="profiling"/>
|
||||
<interceptor-ref name="scopedModelDriven"/>
|
||||
<interceptor-ref name="modelDriven"/>
|
||||
<interceptor-ref name="fileUpload"/>
|
||||
<interceptor-ref name="checkbox"/>
|
||||
<interceptor-ref name="multiselect"/>
|
||||
<interceptor-ref name="staticParams"/>
|
||||
<interceptor-ref name="actionMappingParams"/>
|
||||
<interceptor-ref name="params">
|
||||
|
||||
@@ -35,7 +35,9 @@
|
||||
</#if>
|
||||
>
|
||||
<#list actionErrors as error>
|
||||
<li><span>${error!}</span></li>
|
||||
<#if error?if_exists != "">
|
||||
<li><span><#if parameters.escape>${error!?html}<#else>${error!}</#if></span><#rt/></li><#rt/>
|
||||
</#if>
|
||||
</#list>
|
||||
</ul>
|
||||
</#if>
|
||||
@@ -20,7 +20,7 @@
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<#if (actionMessages?? && actionMessages?size > 0)>
|
||||
<#if (actionMessages?? && actionMessages?size > 0 && !parameters.isEmptyList)>
|
||||
<ul<#rt/>
|
||||
<#if parameters.id?if_exists != "">
|
||||
id="${parameters.id?html}"<#rt/>
|
||||
@@ -35,7 +35,9 @@
|
||||
</#if>
|
||||
>
|
||||
<#list actionMessages as message>
|
||||
<li><span>${message!}</span></li>
|
||||
<#if message?if_exists != "">
|
||||
<li><span><#if parameters.escape>${message!?html}<#else>${message!}</#if></span></li>
|
||||
</#if>
|
||||
</#list>
|
||||
</ul>
|
||||
</#if>
|
||||
@@ -52,4 +52,9 @@
|
||||
</@s.iterator>
|
||||
<#else>
|
||||
|
||||
</#if>
|
||||
</#if>
|
||||
<input type="hidden" id="__multiselect_${parameters.id?html}" name="__multiselect_${parameters.name?html}" value=""<#rt/>
|
||||
<#if parameters.disabled?default(false)>
|
||||
disabled="disabled"<#rt/>
|
||||
</#if>
|
||||
/>
|
||||
@@ -58,9 +58,16 @@
|
||||
</#if>
|
||||
<#if parameters.doubleMultiple?default(false)>
|
||||
multiple="multiple"<#rt/>
|
||||
</#if>
|
||||
</#if>
|
||||
>
|
||||
</select>
|
||||
<#if parameters.doubleMultiple?default(false)>
|
||||
<input type="hidden" id="__multiselect_${parameters.doubleId?html}" name="__multiselect_${parameters.doubleName?default("")?html}" value=""<#rt/>
|
||||
<#if parameters.disabled?default(false)>
|
||||
disabled="disabled"<#rt/>
|
||||
</#if>
|
||||
/>
|
||||
</#if>
|
||||
<script type="text/javascript">
|
||||
<#assign itemCount = startCount/>
|
||||
var ${parameters.id}Group = new Array(${parameters.listSize} + ${startCount});
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<#list eKeys as eKey><#t/>
|
||||
<#assign eValue = fieldErrors[eKey]><#t/>
|
||||
<#list eValue as eEachValue><#t/>
|
||||
<li><span>${eEachValue}</span></li>
|
||||
<li><span><#if parameters.escape>${eEachValue!?html}<#else>${eEachValue!}</#if></span></li>
|
||||
</#list><#t/>
|
||||
</#list><#t/>
|
||||
</ul>
|
||||
|
||||
@@ -38,11 +38,11 @@
|
||||
<#assign tmpKey=stack.findValue(optGroupInternalListUiBean.parameters.listKey) />
|
||||
<#assign tmpValue=stack.findValue(optGroupInternalListUiBean.parameters.listValue) />
|
||||
<#assign tmpKeyStr = tmpKey.toString() />
|
||||
<option value="${tmpKeyStr}"
|
||||
<option value="${tmpKeyStr?html}"
|
||||
<#if tag.contains(parameters.nameValue, tmpKeyStr) == true>
|
||||
selected="selected"
|
||||
</#if>
|
||||
>${tmpValue}
|
||||
>${tmpValue?html}
|
||||
</option>
|
||||
<#assign trash=stack.pop() />
|
||||
</#list>
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
<#if parameters.leftTitle??><#t/>
|
||||
<label for="leftTitle">${parameters.leftTitle}</label><br />
|
||||
</#if><#t/>
|
||||
<#include "/${parameters.templateDir}/simple/select.ftl" />
|
||||
<#include "/${parameters.templateDir}/simple/select.ftl" />
|
||||
<#if parameters.allowUpDownOnLeft?default(true)>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
onclick="moveOptionDown(document.getElementById('${parameters.id}'), 'key', <#if parameters.headerKey??>'${parameters.headerKey}'<#else>''</#if>);<#if parameters.upDownOnLeftOnclick?has_content>${parameters.upDownOnLeftOnclick};</#if>"
|
||||
<#if parameters.leftDownLabel??>
|
||||
value="${parameters.leftDownLabel?html}"
|
||||
@@ -51,18 +51,18 @@
|
||||
<#if parameters.allowAddToLeft?default(true)><#t/>
|
||||
<#assign addToLeftLabel = parameters.addToLeftLabel?default("<-")?html/><#t/>
|
||||
<#if parameters.doubleHeaderKey??><#t/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.buttonCssStyle??><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${addToLeftLabel}" onclick="moveSelectedOptions(document.getElementById('${parameters.doubleId?html}'), document.getElementById('${parameters.id?html}'), false, '${parameters.doubleHeaderKey}', '');<#if parameters.addToLeftOnclick?has_content>${parameters.addToLeftOnclick};</#if>" /><br /><br />
|
||||
<#else><#t/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.buttonCssStyle??><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
@@ -73,9 +73,9 @@
|
||||
<#if parameters.allowAddToRight?default(true)><#t/>
|
||||
<#assign addToRightLabel=parameters.addToRightLabel?default("->")?html /><#t/>
|
||||
<#if parameters.headerKey??><#t/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.buttonCssStyle??><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
@@ -84,7 +84,7 @@
|
||||
<#else><#t/>
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.buttonCssStyle??>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
@@ -95,7 +95,7 @@
|
||||
<#if parameters.allowAddAllToLeft?default(true)><#t/>
|
||||
<#assign addAllToLeftLabel=parameters.addAllToLeftLabel?default("<<--")?html /><#t/>
|
||||
<#if parameters.doubleHeaderKey??><#t/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass}"
|
||||
</#if><#t/>
|
||||
@@ -104,9 +104,9 @@
|
||||
</#if><#t/>
|
||||
value="${addAllToLeftLabel}" onclick="moveAllOptions(document.getElementById('${parameters.doubleId?html}'), document.getElementById('${parameters.id?html}'), false, '${parameters.doubleHeaderKey}', '');<#if parameters.addAllToLeftOnclick?has_content>${parameters.addAllToLeftOnclick};</#if>" /><br /><br />
|
||||
<#else><#t/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.buttonCssStyle??><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
@@ -117,58 +117,58 @@
|
||||
<#if parameters.allowAddAllToRight?default(true)><#t/>
|
||||
<#assign addAllToRightLabel=parameters.addAllToRightLabel?default("-->>")?html /><#t/>
|
||||
<#if parameters.headerKey??><#t/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.buttonCssStyle??><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${addAllToRightLabel}" onclick="moveAllOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '${parameters.headerKey}', '');<#if parameters.addAllToRightOnclick?has_content>${parameters.addAllToRightOnclick};</#if>" /><br /><br />
|
||||
value="${addAllToRightLabel}" onclick="moveAllOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '${parameters.headerKey}', '');<#if parameters.addAllToRightOnclick?has_content>${parameters.addAllToRightOnclick};</#if>" /><br /><br />
|
||||
<#else><#t/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.buttonCssStyle??><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${addAllToRightLabel}" onclick="moveAllOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '');<#if parameters.addAllToRightOnclick?has_content>${parameters.addAllToRightOnclick};</#if>" /><br /><br />
|
||||
value="${addAllToRightLabel}" onclick="moveAllOptions(document.getElementById('${parameters.id?html}'), document.getElementById('${parameters.doubleId?html}'), false, '');<#if parameters.addAllToRightOnclick?has_content>${parameters.addAllToRightOnclick};</#if>" /><br /><br />
|
||||
</#if><#t/>
|
||||
</#if><#t/>
|
||||
<#if parameters.allowSelectAll?default(true)><#t/>
|
||||
<#assign selectAllLabel=parameters.selectAllLabel?default("<*>")?html /><#t/>
|
||||
<#if parameters.headerKey?? && parameters.doubleHeaderKey??><#t/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.buttonCssStyle??><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${selectAllLabel}" onclick="selectAllOptionsExceptSome(document.getElementById('${parameters.id?html}'), 'key', '${parameters.headerKey}');selectAllOptionsExceptSome(document.getElementById('${parameters.doubleId?html}'), 'key', '${parameters.doubleHeaderKey}');<#if parameters.selectAllOnclick?has_content>${parameters.selectAllOnclick};</#if>" /><br /><br />
|
||||
<#elseif parameters.headerKey??><#t/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.buttonCssStyle??><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${selectAllLabel}" onclick="selectAllOptionsExceptSome(document.getElementById('${parameters.id?html}'), 'key', '${parameters.headerKey}');selectAllOptions(document.getElementById('${parameters.doubleId?html}'));<#if parameters.selectAllOnclick?has_content>${parameters.selectAllOnclick};</#if>" /><br /><br />
|
||||
<#elseif parameters.doubleHeaderKey??><#t/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.buttonCssStyle??><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
</#if><#t/>
|
||||
value="${selectAllLabel}" onclick="selectAllOptions(document.getElementById('${parameters.id?html}'));selectAllOptionsExceptSome(document.getElementById('${parameters.doubleId?html}'), 'key', '${parameters.doubleHeaderKey}');<#if parameters.selectAllOnclick?has_content>${parameters.selectAllOnclick};</#if>" /><br /><br />
|
||||
<#else><#t/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
<#if parameters.buttonCssClass??><#t/>
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
class="${parameters.buttonCssClass?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.buttonCssStyle??><#t/>
|
||||
style="${parameters.buttonCssStyle?html}"
|
||||
@@ -181,10 +181,10 @@
|
||||
<#if parameters.rightTitle??><#t/>
|
||||
<label for="rightTitle">${parameters.rightTitle}</label><br />
|
||||
</#if><#t/>
|
||||
<select
|
||||
<select
|
||||
name="${parameters.doubleName?default("")?html}"
|
||||
<#if parameters.get("doubleSize")??><#t/>
|
||||
size="${parameters.get("doubleSize")?html}"
|
||||
size="${parameters.get("doubleSize")?html}"
|
||||
</#if><#t/>
|
||||
<#if parameters.doubleDisabled?default(false)><#t/>
|
||||
disabled="disabled"
|
||||
@@ -272,14 +272,21 @@
|
||||
>${doubleItemValue?html}</option><#lt/>
|
||||
</@s.iterator><#t/>
|
||||
</select>
|
||||
<#if parameters.doubleMultiple?default(false)>
|
||||
<input type="hidden" id="__multiselect_${parameters.doubleId?html}" name="__multiselect_${parameters.doubleName?default("")?html}" value=""<#rt/>
|
||||
<#if parameters.doubleDisabled?default(false)>
|
||||
disabled="disabled"<#rt/>
|
||||
</#if>
|
||||
/>
|
||||
</#if>
|
||||
<#if parameters.allowUpDownOnRight?default(true)>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
onclick="moveOptionDown(document.getElementById('${parameters.doubleId}'), 'key', <#if parameters.doubleHeaderKey??>'${parameters.doubleHeaderKey}'<#else>''</#if>);<#if parameters.upDownOnRightOnclick?has_content>${parameters.upDownOnRightOnclick};</#if>"
|
||||
<#if parameters.rightDownLabel??>
|
||||
value="${parameters.rightDownLabel?html}"
|
||||
</#if>
|
||||
/>
|
||||
<input type="button"
|
||||
<input type="button"
|
||||
onclick="moveOptionUp(document.getElementById('${parameters.doubleId}'), 'key', <#if parameters.doubleHeaderKey??>'${parameters.doubleHeaderKey}'<#else>''</#if>);<#if parameters.upDownOnRightOnclick?has_content>${parameters.upDownOnRightOnclick};</#if>"
|
||||
<#if parameters.rightUpLabel??>
|
||||
value="${parameters.rightUpLabel?html}"
|
||||
|
||||
@@ -87,4 +87,11 @@
|
||||
|
||||
<#include "/${parameters.templateDir}/simple/optgroup.ftl" />
|
||||
|
||||
</select>
|
||||
</select>
|
||||
<#if parameters.multiple?default(false)>
|
||||
<input type="hidden" id="__multiselect_${parameters.id?html}" name="__multiselect_${parameters.name?html}" value=""<#rt/>
|
||||
<#if parameters.disabled?default(false)>
|
||||
disabled="disabled"<#rt/>
|
||||
</#if>
|
||||
/>
|
||||
</#if>
|
||||
@@ -81,6 +81,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Namespace for action to call</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">rethrowException</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">Boolean</td>
|
||||
<td align="left" valign="top">Whether an exception should be rethrown, if the target action throws an exception</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">var</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -81,6 +81,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set the html disabled attribute on rendered html element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">escape</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">Boolean</td>
|
||||
<td align="left" valign="top"> Whether to escape HTML</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">id</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -81,6 +81,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set the html disabled attribute on rendered html element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">escape</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">Boolean</td>
|
||||
<td align="left" valign="top"> Whether to escape HTML</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">id</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -81,6 +81,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set the html disabled attribute on rendered html element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">escape</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">true</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">Boolean</td>
|
||||
<td align="left" valign="top"> Whether to escape HTML</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">fieldName</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -177,6 +177,10 @@ public class TestAction extends ActionSupport {
|
||||
return result;
|
||||
}
|
||||
|
||||
public String executeThrowsException() throws Exception {
|
||||
throw new StrutsException("something went wrong!");
|
||||
}
|
||||
|
||||
public String doInput() throws Exception {
|
||||
return INPUT;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import org.apache.struts2.views.jsp.AbstractTagTest;
|
||||
import org.apache.struts2.TestConfigurationProvider;
|
||||
import org.apache.struts2.StrutsException;
|
||||
|
||||
/**
|
||||
* Describe your class here
|
||||
*
|
||||
* @author $Author$
|
||||
* <p/>
|
||||
* $Id$
|
||||
*/
|
||||
public class AnotherActionComponentTest extends AbstractTagTest {
|
||||
|
||||
public void testRethrowException() throws Exception {
|
||||
request.setupGetServletPath(TestConfigurationProvider.TEST_NAMESPACE + "/"
|
||||
+ "foo.action" );
|
||||
ActionComponent ac = new ActionComponent(stack, request, response) ;
|
||||
container.inject(ac);
|
||||
ac.setNamespace(TestConfigurationProvider.TEST_NAMESPACE);
|
||||
ac.setName(TestConfigurationProvider.TEST_ACTION_NAME + "!executeThrowsException");
|
||||
ac.setRethrowException(true);
|
||||
boolean exceptionCaught = false;
|
||||
try {
|
||||
ac.executeAction();
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (e instanceof StrutsException)
|
||||
exceptionCaught = true;
|
||||
}
|
||||
assertTrue(exceptionCaught);
|
||||
}
|
||||
|
||||
public void testDoesNotThrowException() throws Exception {
|
||||
request.setupGetServletPath(TestConfigurationProvider.TEST_NAMESPACE + "/"
|
||||
+ "foo.action" );
|
||||
ActionComponent ac = new ActionComponent(stack, request, response) ;
|
||||
container.inject(ac);
|
||||
ac.setNamespace(TestConfigurationProvider.TEST_NAMESPACE);
|
||||
ac.setName(TestConfigurationProvider.TEST_ACTION_NAME+ "!executeThrowsException");
|
||||
ac.setRethrowException(false);
|
||||
boolean exceptionCaught = false;
|
||||
try {
|
||||
ac.executeAction();
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (e instanceof StrutsException)
|
||||
exceptionCaught = true;
|
||||
}
|
||||
assertTrue(! exceptionCaught);
|
||||
}
|
||||
}
|
||||
@@ -25,8 +25,14 @@ import java.util.List;
|
||||
|
||||
import org.apache.struts2.TestAction;
|
||||
import org.apache.struts2.views.jsp.AbstractUITagTest;
|
||||
import org.easymock.EasyMock;
|
||||
|
||||
import com.opensymphony.xwork2.validator.validators.RequiredFieldValidator;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
|
||||
/**
|
||||
* <code>FormTest</code>
|
||||
@@ -43,4 +49,24 @@ public class FormTest extends AbstractUITagTest {
|
||||
assertEquals(1, v.size());
|
||||
assertEquals(RequiredFieldValidator.class, v.get(0).getClass());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
ActionConfig config = new ActionConfig.Builder("", "name", "").build();
|
||||
ActionInvocation invocation = EasyMock.createNiceMock(ActionInvocation.class);
|
||||
ActionProxy proxy = EasyMock.createNiceMock(ActionProxy.class);
|
||||
|
||||
EasyMock.expect(invocation.getProxy()).andReturn(proxy).anyTimes();
|
||||
EasyMock.expect(invocation.getAction()).andReturn(null).anyTimes();
|
||||
EasyMock.expect(invocation.invoke()).andReturn(Action.SUCCESS).anyTimes();
|
||||
EasyMock.expect(proxy.getMethod()).andReturn("execute").anyTimes();
|
||||
EasyMock.expect(proxy.getConfig()).andReturn(config).anyTimes();
|
||||
|
||||
EasyMock.replay(invocation);
|
||||
EasyMock.replay(proxy);
|
||||
|
||||
ActionContext.getContext().setActionInvocation(invocation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,38 @@ public class StreamResultTest extends StrutsTestCase {
|
||||
assertEquals("inline", response.getHeader("Content-disposition"));
|
||||
}
|
||||
|
||||
public void testStreamResultWithCharSet() throws Exception {
|
||||
result.setInputName("streamForImage");
|
||||
result.setContentCharSet("ISO-8859-1");
|
||||
result.doExecute("helloworld", mai);
|
||||
|
||||
assertEquals(String.valueOf(contentLength), result.getContentLength());
|
||||
assertEquals("text/plain", result.getContentType());
|
||||
assertEquals("streamForImage", result.getInputName());
|
||||
assertEquals(1024, result.getBufferSize()); // 1024 is default
|
||||
assertEquals("inline", result.getContentDisposition());
|
||||
assertEquals("text/plain;charset=ISO-8859-1", response.getContentType());
|
||||
assertEquals(contentLength, response.getContentLength());
|
||||
assertEquals("inline", response.getHeader("Content-disposition"));
|
||||
}
|
||||
|
||||
public void testStreamResultWithCharSet2() throws Exception {
|
||||
result.setParse(true);
|
||||
result.setInputName("streamForImage");
|
||||
result.setContentCharSet("${contentCharSetMethod}");
|
||||
|
||||
result.doExecute("helloworld", mai);
|
||||
|
||||
assertEquals(String.valueOf(contentLength), result.getContentLength());
|
||||
assertEquals("text/plain", result.getContentType());
|
||||
assertEquals("streamForImage", result.getInputName());
|
||||
assertEquals(1024, result.getBufferSize()); // 1024 is default
|
||||
assertEquals("inline", result.getContentDisposition());
|
||||
assertEquals("text/plain;charset=UTF-8", response.getContentType());
|
||||
assertEquals(contentLength, response.getContentLength());
|
||||
assertEquals("inline", response.getHeader("Content-disposition"));
|
||||
}
|
||||
|
||||
public void testAllowCacheDefault() throws Exception {
|
||||
result.setInputName("streamForImage");
|
||||
|
||||
@@ -240,6 +272,10 @@ public class StreamResultTest extends StrutsTestCase {
|
||||
public String getStreamForImageAsString() {
|
||||
return "streamForImage";
|
||||
}
|
||||
|
||||
public String getContentCharSetMethod() {
|
||||
return "UTF-8";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* $Id: MessageStoreInterceptorTest.java 651946 2008-04-27 13:41:38Z apetrelli $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
|
||||
package org.apache.struts2.interceptor;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.mock.MockActionInvocation;
|
||||
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
|
||||
/**
|
||||
* Unit test for MultiselectInterceptor.
|
||||
*/
|
||||
public class MultiselectInterceptorTest extends StrutsTestCase {
|
||||
|
||||
private MultiselectInterceptor interceptor;
|
||||
private MockActionInvocation ai;
|
||||
private Map<String, Object> param;
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
param = new HashMap<String, Object>();
|
||||
|
||||
interceptor = new MultiselectInterceptor();
|
||||
ai = new MockActionInvocation();
|
||||
ai.setInvocationContext(ActionContext.getContext());
|
||||
ActionContext.getContext().setParameters(param);
|
||||
}
|
||||
|
||||
public void testNoParam() throws Exception {
|
||||
interceptor.init();
|
||||
interceptor.intercept(ai);
|
||||
interceptor.destroy();
|
||||
|
||||
assertEquals(0, param.size());
|
||||
}
|
||||
|
||||
public void testPassthroughOne() throws Exception {
|
||||
param.put("user", "batman");
|
||||
interceptor.init();
|
||||
interceptor.intercept(ai);
|
||||
interceptor.destroy();
|
||||
|
||||
assertEquals(1, param.size());
|
||||
}
|
||||
|
||||
public void testPassthroughTwo() throws Exception {
|
||||
param.put("user", "batman");
|
||||
param.put("email", "batman@comic.org");
|
||||
interceptor.init();
|
||||
interceptor.intercept(ai);
|
||||
interceptor.destroy();
|
||||
|
||||
assertEquals(2, param.size());
|
||||
}
|
||||
|
||||
public void testSelectedMultiselect() throws Exception {
|
||||
param.put("user", "batman");
|
||||
param.put("email", "batman@comic.org");
|
||||
param.put("superpower", "robin");
|
||||
param.put("__multiselect_superpower", "");
|
||||
assertTrue(param.containsKey("__multiselect_superpower"));
|
||||
|
||||
interceptor.init();
|
||||
interceptor.intercept(ai);
|
||||
interceptor.destroy();
|
||||
|
||||
assertFalse(param.containsKey("__multiselect_superpower"));
|
||||
assertEquals(3, param.size()); // should be 3 as __multiselect_ should be removed
|
||||
assertEquals("robin", param.get("superpower"));
|
||||
}
|
||||
|
||||
public void testMultiselectNoValue() throws Exception {
|
||||
param.put("user", "batman");
|
||||
param.put("email", "batman@comic.org");
|
||||
param.put("__multiselect_superpower", "");
|
||||
assertTrue(param.containsKey("__multiselect_superpower"));
|
||||
|
||||
interceptor.init();
|
||||
interceptor.intercept(ai);
|
||||
interceptor.destroy();
|
||||
|
||||
assertFalse(param.containsKey("__multiselect_superpower"));
|
||||
assertEquals(3, param.size()); // should be 3 as __multiselect_ should be removed
|
||||
assertEquals(0, ((String[]) param.get("superpower")).length);
|
||||
}
|
||||
|
||||
public void testTwoMultiselect() throws Exception {
|
||||
param.put("user", "batman");
|
||||
param.put("email", "batman@comic.org");
|
||||
param.put("__multiselect_superpower", "");
|
||||
param.put("superpower", "yes");
|
||||
param.put("__multiselect_cool", "");
|
||||
assertTrue(param.containsKey("__multiselect_superpower"));
|
||||
assertTrue(param.containsKey("__multiselect_cool"));
|
||||
|
||||
interceptor.init();
|
||||
interceptor.intercept(ai);
|
||||
interceptor.destroy();
|
||||
|
||||
assertFalse(param.containsKey("__multiselect_superpower"));
|
||||
assertFalse(param.containsKey("__multiselect_cool"));
|
||||
assertEquals(4, param.size()); // should be 4 as __multiselect_ should be removed
|
||||
assertEquals("yes", param.get("superpower"));
|
||||
assertEquals(0, ((String[]) param.get("cool")).length);
|
||||
}
|
||||
|
||||
}
|
||||
+8
-3
@@ -22,11 +22,10 @@
|
||||
package org.apache.struts2.interceptor.validation;
|
||||
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
import org.easymock.EasyMock;
|
||||
|
||||
import com.mockobjects.dynamic.Mock;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.ActionProxy;
|
||||
import com.opensymphony.xwork2.Validateable;
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
|
||||
public class AnnotationValidationInterceptorTest extends StrutsTestCase {
|
||||
@@ -48,9 +47,13 @@ public class AnnotationValidationInterceptorTest extends StrutsTestCase {
|
||||
mockActionInvocation.matchAndReturn("getProxy", (ActionProxy) mockActionProxy.proxy());
|
||||
mockActionInvocation.matchAndReturn("getAction", test);
|
||||
mockActionInvocation.expect("invoke");
|
||||
|
||||
ActionContext.getContext().setActionInvocation((ActionInvocation) mockActionInvocation.proxy());
|
||||
}
|
||||
|
||||
public void testShouldNotSkip() throws Exception {
|
||||
mockActionProxy.expectAndReturn("getMethod", "execute");
|
||||
mockActionProxy.expectAndReturn("getActionName", "foo");
|
||||
mockActionProxy.expectAndReturn("getMethod", "execute");
|
||||
mockActionProxy.expectAndReturn("getConfig", config);
|
||||
mockActionProxy.expectAndReturn("getMethod", "execute");
|
||||
@@ -84,6 +87,8 @@ public class AnnotationValidationInterceptorTest extends StrutsTestCase {
|
||||
|
||||
public void testShouldNotSkipBase() throws Exception {
|
||||
mockActionProxy.expectAndReturn("getMethod", "dontSkipMeBase");
|
||||
mockActionProxy.expectAndReturn("getActionName", "foo");
|
||||
mockActionProxy.expectAndReturn("getMethod", "execute");
|
||||
mockActionProxy.expectAndReturn("getConfig", config);
|
||||
mockActionProxy.expectAndReturn("getMethod", "dontSkipMeBase");
|
||||
interceptor.doIntercept((ActionInvocation)mockActionInvocation.proxy());
|
||||
|
||||
+2
-1
@@ -148,7 +148,8 @@ public class JSONValidationInterceptorTest extends StrutsTestCase {
|
||||
StrutsMockServletContext servletContext = new StrutsMockServletContext();
|
||||
|
||||
context.put(StrutsStatics.SERVLET_CONTEXT, servletContext);
|
||||
invocation = new MockActionInvocation();
|
||||
invocation = new MockActionInvocation();
|
||||
ActionContext.getContext().setActionInvocation(invocation);
|
||||
invocation.setAction(action);
|
||||
invocation.setInvocationContext(context);
|
||||
MockActionProxy proxy = new MockActionProxy();
|
||||
|
||||
@@ -42,6 +42,10 @@ public class ContainUtilTest extends TestCase {
|
||||
assertFalse(ContainUtil.contains(null, new Object()));
|
||||
}
|
||||
|
||||
public void testNullInAray()throws Exception {
|
||||
assertTrue(ContainUtil.contains(new String[] {"a", null, "b"}, "b"));
|
||||
}
|
||||
|
||||
public void testSimpleList() throws Exception {
|
||||
List<String> l = new ArrayList<String>();
|
||||
l.add("one");
|
||||
|
||||
@@ -21,12 +21,11 @@
|
||||
|
||||
package org.apache.struts2.views.jsp.ui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.struts2.views.jsp.AbstractUITagTest;
|
||||
import org.apache.struts2.TestAction;
|
||||
import org.apache.commons.lang.xwork.StringUtils;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
@@ -50,6 +49,38 @@ public class ActionErrorTagTest extends AbstractUITagTest {
|
||||
verify(ActionErrorTagTest.class.getResource("actionerror-1.txt"));
|
||||
}
|
||||
|
||||
public void testActionErrorsEscape() throws Exception {
|
||||
|
||||
ActionErrorTag tag = new ActionErrorTag();
|
||||
TestAction testAction = new TestAction();
|
||||
testAction.addActionError("<p>hey</p>");
|
||||
stack.pop();
|
||||
stack.push(testAction);
|
||||
tag.setEscape(true);
|
||||
tag.setPageContext(pageContext);
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
assertEquals(normalize("<ul class=\"errorMessage\"><li><span><p>hey</p></span></li></ul>", true),
|
||||
normalize(writer.toString(), true));
|
||||
}
|
||||
|
||||
public void testActionErrorsDontEscape() throws Exception {
|
||||
|
||||
ActionErrorTag tag = new ActionErrorTag();
|
||||
TestAction testAction = new TestAction();
|
||||
testAction.addActionError("<p>hey</p>");
|
||||
stack.pop();
|
||||
stack.push(testAction);
|
||||
tag.setEscape(false);
|
||||
tag.setPageContext(pageContext);
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
assertEquals(normalize("<ul class=\"errorMessage\"><li><span><p>hey</p></span></li></ul>", true),
|
||||
normalize(writer.toString(), true));
|
||||
}
|
||||
|
||||
public void testHaveActionErrors() throws Exception {
|
||||
|
||||
ActionErrorTag tag = new ActionErrorTag();
|
||||
@@ -75,6 +106,19 @@ public class ActionErrorTagTest extends AbstractUITagTest {
|
||||
verify(ActionErrorTagTest.class.getResource("actionerror-2.txt"));
|
||||
}
|
||||
|
||||
public void testEmptyErrorList() throws Exception {
|
||||
|
||||
ActionErrorTag tag = new ActionErrorTag();
|
||||
tag.setId("someid");
|
||||
((InternalActionSupport)action).setHasActionErrors(true);
|
||||
((InternalActionSupport)action).setJustNullElement(true);
|
||||
tag.setPageContext(pageContext);
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
assertTrue(StringUtils.isBlank(writer.toString()));
|
||||
}
|
||||
|
||||
|
||||
public Action getAction() {
|
||||
return new InternalActionSupport();
|
||||
@@ -86,6 +130,11 @@ public class ActionErrorTagTest extends AbstractUITagTest {
|
||||
private static final long serialVersionUID = -4777466640658557661L;
|
||||
|
||||
private boolean yesActionErrors;
|
||||
private boolean justNullElement;
|
||||
|
||||
public void setJustNullElement(boolean justNullElement) {
|
||||
this.justNullElement = justNullElement;
|
||||
}
|
||||
|
||||
public void setHasActionErrors(boolean aYesActionErrors) {
|
||||
yesActionErrors = aYesActionErrors;
|
||||
@@ -96,7 +145,9 @@ public class ActionErrorTagTest extends AbstractUITagTest {
|
||||
}
|
||||
|
||||
public Collection getActionErrors() {
|
||||
if (yesActionErrors) {
|
||||
if (justNullElement) {
|
||||
return Arrays.asList(null);
|
||||
} else if (yesActionErrors) {
|
||||
List errors = new ArrayList();
|
||||
errors.add("action error number 1");
|
||||
errors.add("action error number 2");
|
||||
|
||||
@@ -21,12 +21,11 @@
|
||||
|
||||
package org.apache.struts2.views.jsp.ui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.struts2.views.jsp.AbstractUITagTest;
|
||||
import org.apache.struts2.TestAction;
|
||||
import org.apache.commons.lang.xwork.StringUtils;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
@@ -48,6 +47,39 @@ public class ActionMessageTagTest extends AbstractUITagTest {
|
||||
verify(ActionMessageTagTest.class.getResource("actionmessage-1.txt"));
|
||||
}
|
||||
|
||||
public void testActionMessageEscape() throws Exception {
|
||||
|
||||
ActionMessageTag tag = new ActionMessageTag();
|
||||
TestAction testAction = new TestAction();
|
||||
testAction.addActionMessage("<p>hey</p>");
|
||||
stack.pop();
|
||||
stack.push(testAction);
|
||||
tag.setEscape(true);
|
||||
tag.setPageContext(pageContext);
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
assertEquals(normalize("<ul class=\"actionMessage\"><li><span><p>hey</p></span></li></ul>", true),
|
||||
normalize(writer.toString(), true));
|
||||
}
|
||||
|
||||
public void testActionErrorsDontEscape() throws Exception {
|
||||
|
||||
ActionMessageTag tag = new ActionMessageTag();
|
||||
TestAction testAction = new TestAction();
|
||||
testAction.addActionMessage("<p>hey</p>");
|
||||
stack.pop();
|
||||
stack.push(testAction);
|
||||
tag.setEscape(false);
|
||||
tag.setPageContext(pageContext);
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
assertEquals(normalize("<ul class=\"actionMessage\"><li><span><p>hey</p></span></li></ul>", true),
|
||||
normalize(writer.toString(), true));
|
||||
}
|
||||
|
||||
|
||||
public void testYesActionMessages() throws Exception {
|
||||
|
||||
ActionMessageTag tag = new ActionMessageTag();
|
||||
@@ -60,6 +92,19 @@ public class ActionMessageTagTest extends AbstractUITagTest {
|
||||
verify(ActionMessageTagTest.class.getResource("actionmessage-2.txt"));
|
||||
}
|
||||
|
||||
public void testYesActionMessagesWithEmptyMessages() throws Exception {
|
||||
|
||||
ActionMessageTag tag = new ActionMessageTag();
|
||||
tag.setId("someid");
|
||||
InternalActionSupport internalActionSupport = (InternalActionSupport) action;
|
||||
internalActionSupport.setJustNullElement(true);
|
||||
tag.setPageContext(pageContext);
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
assertTrue(StringUtils.isBlank(writer.toString()));
|
||||
}
|
||||
|
||||
public void testNullMessage() throws Exception {
|
||||
|
||||
ActionMessageTag tag = new ActionMessageTag();
|
||||
@@ -87,13 +132,20 @@ public class ActionMessageTagTest extends AbstractUITagTest {
|
||||
private static final long serialVersionUID = -3230043189352453629L;
|
||||
|
||||
private boolean canHaveActionMessage;
|
||||
private boolean justNullElement;
|
||||
|
||||
public void setHasActionMessage(boolean canHaveActionMessage) {
|
||||
this.canHaveActionMessage = canHaveActionMessage;
|
||||
}
|
||||
|
||||
public void setJustNullElement(boolean justNullElement) {
|
||||
this.justNullElement = justNullElement;
|
||||
}
|
||||
|
||||
public Collection getActionMessages() {
|
||||
if (canHaveActionMessage) {
|
||||
if (justNullElement) {
|
||||
return Arrays.asList(null);
|
||||
} else if (canHaveActionMessage) {
|
||||
List messages = new ArrayList();
|
||||
messages.add("action message number 1");
|
||||
messages.add("action message number 2");
|
||||
|
||||
@@ -29,6 +29,7 @@ import java.util.Map;
|
||||
|
||||
import org.apache.struts2.views.jsp.AbstractUITagTest;
|
||||
import org.apache.struts2.views.jsp.ParamTag;
|
||||
import org.apache.struts2.TestAction;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
@@ -60,6 +61,38 @@ public class FieldErrorTagTest extends AbstractUITagTest {
|
||||
verify(FieldErrorTagTest.class.getResource("fielderror-2.txt"));
|
||||
}
|
||||
|
||||
public void testFieldErrorsEscape() throws Exception {
|
||||
|
||||
FieldErrorTag tag = new FieldErrorTag();
|
||||
TestAction testAction = new TestAction();
|
||||
testAction.addFieldError("f", "<p>hey</p>");
|
||||
stack.pop();
|
||||
stack.push(testAction);
|
||||
tag.setEscape(true);
|
||||
tag.setPageContext(pageContext);
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
assertEquals(normalize("<ul class=\"errorMessage\"><li><span><p>hey</p></span></li></ul>", true),
|
||||
normalize(writer.toString(), true));
|
||||
}
|
||||
|
||||
public void testFieldErrorsDontEscape() throws Exception {
|
||||
|
||||
FieldErrorTag tag = new FieldErrorTag();
|
||||
TestAction testAction = new TestAction();
|
||||
testAction.addFieldError("f", "<p>hey</p>");
|
||||
stack.pop();
|
||||
stack.push(testAction);
|
||||
tag.setEscape(false);
|
||||
tag.setPageContext(pageContext);
|
||||
tag.doStartTag();
|
||||
tag.doEndTag();
|
||||
|
||||
assertEquals(normalize("<ul class=\"errorMessage\"><li><span><p>hey</p></span></li></ul>", true),
|
||||
normalize(writer.toString(), true));
|
||||
}
|
||||
|
||||
public void testWithParamsWithFieldErrors1() throws Exception {
|
||||
FieldErrorTag tag = new FieldErrorTag();
|
||||
tag.setId("someid");
|
||||
|
||||
@@ -33,10 +33,9 @@ import org.apache.struts2.TestConfigurationProvider;
|
||||
import org.apache.struts2.components.Form;
|
||||
import org.apache.struts2.views.jsp.AbstractUITagTest;
|
||||
import org.apache.struts2.views.jsp.ActionTag;
|
||||
import org.easymock.EasyMock;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionSupport;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.config.RuntimeConfiguration;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.config.entities.InterceptorMapping;
|
||||
@@ -762,5 +761,21 @@ public class FormTagTest extends AbstractUITagTest {
|
||||
put("configProviders", TestConfigurationProvider.class.getName());
|
||||
}});
|
||||
ActionContext.getContext().setValueStack(stack);
|
||||
|
||||
ActionConfig config = new ActionConfig.Builder("", "name", "").build();
|
||||
ActionInvocation invocation = EasyMock.createNiceMock(ActionInvocation.class);
|
||||
ActionProxy proxy = EasyMock.createNiceMock(ActionProxy.class);
|
||||
|
||||
EasyMock.expect(invocation.getProxy()).andReturn(proxy).anyTimes();
|
||||
EasyMock.expect(invocation.getAction()).andReturn(null).anyTimes();
|
||||
EasyMock.expect(invocation.invoke()).andReturn(Action.SUCCESS).anyTimes();
|
||||
EasyMock.expect(proxy.getMethod()).andReturn("execute").anyTimes();
|
||||
EasyMock.expect(proxy.getConfig()).andReturn(config).anyTimes();
|
||||
|
||||
|
||||
EasyMock.replay(invocation);
|
||||
EasyMock.replay(proxy);
|
||||
|
||||
ActionContext.getContext().setActionInvocation(invocation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,4 +159,35 @@ public class OptGroupTest extends AbstractUITagTest {
|
||||
//System.out.println(writer.toString());
|
||||
verify(SelectTag.class.getResource("OptGroup-4.txt"));
|
||||
}
|
||||
|
||||
public void testOptGroupForHtmlEncoding() throws Exception {
|
||||
SelectTag selectTag = new SelectTag();
|
||||
selectTag.setMultiple("true");
|
||||
selectTag.setName("mySelection");
|
||||
selectTag.setLabel("My Selection");
|
||||
selectTag.setList("%{#{'ONE':'one','TWO':'two','THREE':'three'}}");
|
||||
selectTag.setValue("%{{'EEE','TWO'}}");
|
||||
|
||||
OptGroupTag optGroupTag1 = new OptGroupTag();
|
||||
optGroupTag1.setLabel("My Label 1");
|
||||
optGroupTag1.setList("%{#{'&':'aaa','<':'bbb','CCC':'<script'}}");
|
||||
|
||||
OptGroupTag optGroupTag2 = new OptGroupTag();
|
||||
optGroupTag2.setLabel("My Label 2");
|
||||
optGroupTag2.setList("%{#{'<cat>':'ddd','EEE':'eee','FFF':'fff'}}");
|
||||
|
||||
selectTag.setPageContext(pageContext);
|
||||
selectTag.doStartTag();
|
||||
optGroupTag1.setPageContext(pageContext);
|
||||
optGroupTag1.doStartTag();
|
||||
optGroupTag1.doEndTag();
|
||||
optGroupTag2.setPageContext(pageContext);
|
||||
optGroupTag2.doStartTag();
|
||||
optGroupTag2.doEndTag();
|
||||
selectTag.doEndTag();
|
||||
|
||||
|
||||
//System.out.println(writer.toString());
|
||||
verify(SelectTag.class.getResource("OptGroup-5.txt"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,6 +248,7 @@ public class XSLTResultTest extends StrutsTestCase {
|
||||
public List getBooks() {
|
||||
List list = new ArrayList();
|
||||
list.add(new Book("WebWork in Action", "Patrick and Jason"));
|
||||
list.add(null);
|
||||
list.add(new Book("XWork not in Action", "Superman"));
|
||||
return list;
|
||||
}
|
||||
|
||||
@@ -7,5 +7,6 @@
|
||||
<label for="foo-2" class="checkboxLabel">bar</label>
|
||||
<input type="checkbox" name="foo" value="baz" id="foo-3" title="mytitle" onchange="alert('foo');"/>
|
||||
<label for="foo-3" class="checkboxLabel"></label>
|
||||
<input type="hidden" id="__multiselect_foo" name="__multiselect_foo" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -7,5 +7,6 @@
|
||||
<label for="collection-2" class="checkboxLabel">bar</label>
|
||||
<input type="checkbox" name="collection" value="cat" id="collection-3"/>
|
||||
<label for="collection-3" class="checkboxLabel">dog</label>
|
||||
<input type="hidden" id="__multiselect_collection" name="__multiselect_collection" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -7,5 +7,6 @@
|
||||
<label for="collection-2" class="checkboxLabel">bar</label>
|
||||
<input type="checkbox" name="collection" value="cat" id="collection-3" disabled="disabled"/>
|
||||
<label for="collection-3" class="checkboxLabel">dog</label>
|
||||
<input type="hidden" id="__multiselect_collection" name="__multiselect_collection" value="" disabled="disabled"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
<label for="foo-1" class="checkboxLabel">world</label>
|
||||
<input type="checkbox" name="foo" value="foo" id="foo-2" disabled="disabled" onchange="alert('foo');"/>
|
||||
<label for="foo-2" class="checkboxLabel">bar</label>
|
||||
<input type="hidden" id="__multiselect_foo" name="__multiselect_foo" value="" disabled="disabled"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
<table>
|
||||
<tr><td>
|
||||
<select name="myUpDownSelectTag" size="5" id="myAction_myUpDownSelectTag" multiple="multiple">
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myAction_myUpDownSelectTag" name="__multiselect_myUpDownSelectTag"value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myAction_myUpDownSelectTag'), 'key', '');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myAction_myUpDownSelectTag'), 'key', '');" />
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
<table>
|
||||
<tr><td>
|
||||
<select name="myUpDownSelectTag" size="5" id="myAction_myUpDownSelectTag" multiple="multiple">
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myAction_myUpDownSelectTag" name="__multiselect_myUpDownSelectTag"value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myAction_myUpDownSelectTag'), 'key', '');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myAction_myUpDownSelectTag'), 'key', '');" />
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
<table>
|
||||
<tr><td>
|
||||
<select name="myUpDownSelectTag" size="5" id="myAction_myUpDownSelectTag" multiple="multiple">
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myAction_myUpDownSelectTag" name="__multiselect_myUpDownSelectTag"value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myAction_myUpDownSelectTag'), 'key', '');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myAction_myUpDownSelectTag'), 'key', '');" />
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
<table>
|
||||
<tr><td>
|
||||
<select name="myUpDownSelectTag" size="5" id="myAction_myUpDownSelectTag" multiple="multiple">
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myAction_myUpDownSelectTag" name="__multiselect_myUpDownSelectTag"value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myAction_myUpDownSelectTag'), 'key', '');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myAction_myUpDownSelectTag'), 'key', '');" />
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
<table>
|
||||
<tr><td>
|
||||
<select name="myUpDownSelectTag" size="5" id="myAction_myUpDownSelectTag" multiple="multiple">
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myAction_myUpDownSelectTag" name="__multiselect_myUpDownSelectTag"value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myAction_myUpDownSelectTag'), 'key', '');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myAction_myUpDownSelectTag'), 'key', '');" />
|
||||
|
||||
@@ -38,5 +38,6 @@
|
||||
</optgroup>
|
||||
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_mySelection" name="__multiselect_mySelection" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -0,0 +1,42 @@
|
||||
<tr>
|
||||
<td class="tdLabel"><label for="mySelection" class="label">My Selection:</label></td>
|
||||
<td>
|
||||
<select name="mySelection" id="mySelection" multiple="multiple">
|
||||
<option value="ONE">one</option>
|
||||
<option value="TWO" selected="selected">two</option>
|
||||
<option value="THREE">three</option>
|
||||
|
||||
<optgroup
|
||||
label="My Label 1"
|
||||
>
|
||||
|
||||
<option value="&"
|
||||
>aaa
|
||||
</option>
|
||||
<option value="<"
|
||||
>bbb
|
||||
</option>
|
||||
<option value="CCC"
|
||||
><script
|
||||
</option>
|
||||
</optgroup>
|
||||
<optgroup
|
||||
label="My Label 2"
|
||||
>
|
||||
|
||||
<option value="<cat>"
|
||||
>ddd
|
||||
</option>
|
||||
<option value="EEE"
|
||||
selected="selected"
|
||||
>eee
|
||||
</option>
|
||||
<option value="FFF"
|
||||
>fff
|
||||
</option>
|
||||
</optgroup>
|
||||
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_mySelection" name="__multiselect_mySelection" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -3,5 +3,7 @@
|
||||
<td><select name="collection" id="collection" title="mytitle" multiple="multiple" onmousedown="alert('onmousedown');" onmouseup="alert('onmouseup');" onmouseover="alert('onmouseover');" onmousemove="alert('onmousemove');" onmouseout="alert('onmouseout');">
|
||||
<option value="1" selected="selected">hello</option>
|
||||
<option value="2" selected="selected">foo</option>
|
||||
</select></td>
|
||||
</select>
|
||||
<inputtype="hidden" id="__multiselect_collection" name="__multiselect_collection" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -4,5 +4,7 @@
|
||||
<option value="1" selected="selected">foo</option>
|
||||
<option value="2">bar</option>
|
||||
<option value="300000000" selected="selected">foobar</option>
|
||||
</select></td>
|
||||
</select>
|
||||
<inputtype="hidden" id="__multiselect_collection" name="__multiselect_collection" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -4,5 +4,7 @@
|
||||
<option value="hello" selected="selected">world</option>
|
||||
<option value="foo" selected="selected">bar</option>
|
||||
<option value="cat">dog</option>
|
||||
</select></td>
|
||||
</select>
|
||||
<inputtype="hidden" id="__multiselect_collection" name="__multiselect_collection" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -4,5 +4,7 @@
|
||||
<option value="hello" selected="selected">1</option>
|
||||
<option value="foo" selected="selected">2</option>
|
||||
<option value="<cat>">1.5</option>
|
||||
</select></td>
|
||||
</select>
|
||||
<inputtype="hidden" id="__multiselect_collection" name="__multiselect_collection" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -4,5 +4,7 @@
|
||||
<option value=""></option>
|
||||
<option value="aaa">aaa</option>
|
||||
<option value="bbb">bbb</option>
|
||||
</select></td>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName" value=""/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
<selectname="collection"size="5"id="collection"multiple="multiple">
|
||||
<optionvalue="ItemOne"selected="selected">ItemOne</option>
|
||||
<optionvalue="ItemTwo"selected="selected">ItemTwo</option></select>
|
||||
<inputtype="hidden"id="__multiselect_collection"name="__multiselect_collection"value=""/>
|
||||
<inputtype="button"onclick="moveOptionDown(document.getElementById('collection'),'key','');"value="v"/>
|
||||
<inputtype="button"onclick="moveOptionUp(document.getElementById('collection'),'key','');"value="^"/>
|
||||
</td></tr>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<option value="Left1" selected="selected">Left1</option>
|
||||
<option value="Left2" selected="selected">Left2</option>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_id" name="__multiselect_collection" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('id'), 'key', 'Header Key');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('id'), 'key', 'Header Key');" value="^" />
|
||||
</td>
|
||||
@@ -41,7 +42,8 @@
|
||||
<option value=""></option>
|
||||
<option value="Right1" selected="selected">Right1</option>
|
||||
<option value="Right2" selected="selected">Right2</option>
|
||||
</select>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_doubleId" name="__multiselect_list2" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('doubleId'), 'key', 'Double Header Key');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('doubleId'), 'key', 'Double Header Key');" value="^" />
|
||||
</td>
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
<option value="Left1">Left1</option>
|
||||
<option value="Left2" selected="selected">Left2</option>
|
||||
<option value="Left3">Left3</option>
|
||||
</select>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_id" name="__multiselect_collection" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('id'), 'key', 'Header Key');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('id'), 'key', 'Header Key');" value="^" />
|
||||
</td>
|
||||
@@ -41,6 +42,7 @@
|
||||
<option value="Right2" selected="selected">Right2</option>
|
||||
<option value="Right3">Right3</option>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_doubleId" name="__multiselect_list2" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('doubleId'), 'key', 'Double Header Key');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('doubleId'), 'key', 'Double Header Key');" value="^" />
|
||||
</td>
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
<option value="Left1">Left1</option>
|
||||
<option value="Left2" selected="selected">Left2</option>
|
||||
<option value="Left3">Left3</option>
|
||||
</select>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_id" name="__multiselect_collection" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('id'), 'key', '');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('id'), 'key', '');" value="^" />
|
||||
</td>
|
||||
@@ -40,6 +41,7 @@
|
||||
<option value="Right2" selected="selected">Right2</option>
|
||||
<option value="Right3">Right3</option>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_doubleId" name="__multiselect_list2" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('doubleId'), 'key', '');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('doubleId'), 'key', '');" value="^" />
|
||||
</td>
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
<option value="Left1">Left1</option>
|
||||
<option value="Left2" selected="selected">Left2</option>
|
||||
<option value="Left3">Left3</option>
|
||||
</select>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_id" name="__multiselect_collection" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('id'), 'key', 'Header Key');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('id'), 'key', 'Header Key');" value="^" />
|
||||
</td>
|
||||
@@ -41,6 +42,7 @@
|
||||
<option value="Right2" selected="selected">Right2</option>
|
||||
<option value="Right3">Right3</option>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_doubleId" name="__multiselect_list2" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('doubleId'), 'key', '');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('doubleId'), 'key', '');" value="^" />
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
<option value="Left1">Left1</option>
|
||||
<option value="Left2" selected="selected">Left2</option>
|
||||
<option value="Left3">Left3</option>
|
||||
</select>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_id" name="__multiselect_collection" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('id'), 'key', 'Header Key');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('id'), 'key', 'Header Key');" value="^" />
|
||||
</td>
|
||||
@@ -40,6 +41,7 @@
|
||||
<option value="Right2" selected="selected">Right2</option>
|
||||
<option value="Right3">Right3</option>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_doubleId" name="__multiselect_list2" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('doubleId'), 'key', 'Double Header Key');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('doubleId'), 'key', 'Double Header Key');" value="^" />
|
||||
</td>
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
<option value="Left1">Left1</option>
|
||||
<option value="Left2" selected="selected">Left2</option>
|
||||
<option value="Left3">Left3</option>
|
||||
</select>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_id" name="__multiselect_collection" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('id'), 'key', 'Header Key');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('id'), 'key', 'Header Key');" value="^" />
|
||||
</td>
|
||||
@@ -41,6 +42,7 @@
|
||||
<option value="Right2" selected="selected">Right2</option>
|
||||
<option value="Right3">Right3</option>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_doubleId" name="__multiselect_list2" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('doubleId'), 'key', 'Double Header Key');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('doubleId'), 'key', 'Double Header Key');" value="^" />
|
||||
</td>
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
<option value="Left1">Left1</option>
|
||||
<option value="Left2" selected="selected">Left2</option>
|
||||
<option value="Left3">Left3</option>
|
||||
</select>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_id" name="__multiselect_collection" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('id'), 'key', 'Header Key');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('id'), 'key', 'Header Key');" value="^" />
|
||||
</td>
|
||||
@@ -36,6 +37,7 @@
|
||||
<option value="Right2" selected="selected">Right2</option>
|
||||
<option value="Right3">Right3</option>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_doubleId" name="__multiselect_list2" value=""/>
|
||||
<input type="button" onclick="moveOptionDown(document.getElementById('doubleId'), 'key', 'Double Header Key');" value="v" />
|
||||
<input type="button" onclick="moveOptionUp(document.getElementById('doubleId'), 'key', 'Double Header Key');" value="^" />
|
||||
</td>
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<option value="america" selected="selected">America</option>
|
||||
<option value="australia" selected="selected">Australia</option>
|
||||
<option value="germany" selected="selected">Germany</option>
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName"value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myId'), 'key', '');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myId'), 'key', '');" />
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<option value="america" selected="selected">America</option>
|
||||
<option value="australia">Australia</option>
|
||||
<option value="germany" selected="selected">Germany</option>
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName" value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="Move Up" onclick="moveOptionUp(document.getElementById('myId'), 'key', '');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myId'), 'key', '');" />
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<option value="america" selected="selected">America</option>
|
||||
<option value="australia">Australia</option>
|
||||
<option value="germany" selected="selected">Germany</option>
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName" value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myId'), 'key', '');" />
|
||||
<input type="button" value="Move Down" onclick="moveOptionDown(document.getElementById('myId'), 'key', '');" />
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
<option value="america" selected="selected">America</option>
|
||||
<option value="australia">Australia</option>
|
||||
<option value="germany" selected="selected">Germany</option>
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName" value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myId'), 'key', '');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myId'), 'key', '');" />
|
||||
|
||||
@@ -9,7 +9,9 @@
|
||||
<option value="america" selected="selected">America</option>
|
||||
<option value="australia">Australia</option>
|
||||
<option value="germany" selected="selected">Germany</option>
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName" value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myId'), 'key', '-1');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myId'), 'key', '-1');" />
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<option value="america" selected="selected">America</option>
|
||||
<option value="australia">Australia</option>
|
||||
<option value="germany" selected="selected">Germany</option>
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName" value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myId'), 'key', '-1');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myId'), 'key', '-1');" />
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<option value="america" selected="selected">America</option>
|
||||
<option value="australia">Australia</option>
|
||||
<option value="germany" selected="selected">Germany</option>
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName" value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myId'), 'key', '');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myId'), 'key', '');" />
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<option value="america" selected="selected">America</option>
|
||||
<option value="australia">Australia</option>
|
||||
<option value="germany" selected="selected">Germany</option>
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName" value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myId'), 'key', '');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myId'), 'key', '');" />
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<option value="america" selected="selected">America</option>
|
||||
<option value="australia">Australia</option>
|
||||
<option value="germany" selected="selected">Germany</option>
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName" value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myId'), 'key', '');" />
|
||||
<input type="button" value="*" onclick="selectAllOptions(document.getElementById('myId'), 'key', '');" />
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<option value="america" selected="selected">America</option>
|
||||
<option value="australia">Australia</option>
|
||||
<option value="germany" selected="selected">Germany</option>
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName" value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myId'), 'key', '');" />
|
||||
<input type="button" value="*" onclick="selectAllOptions(document.getElementById('myId'), 'key', '');" />
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
<option value="america" selected="selected">America</option>
|
||||
<option value="australia">Australia</option>
|
||||
<option value="germany" selected="selected">Germany</option>
|
||||
</select></td></tr>
|
||||
</select>
|
||||
<input type="hidden" id="__multiselect_myId" name="__multiselect_myName" value=""/>
|
||||
</td></tr>
|
||||
<tr><td>
|
||||
<input type="button" value="^" onclick="moveOptionUp(document.getElementById('myId'), 'key', '');" />
|
||||
<input type="button" value="v" onclick="moveOptionDown(document.getElementById('myId'), 'key', '');" />
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</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_1_7/plugins/codebehind</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/plugins/codebehind</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/plugins/codebehind</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/plugins/codebehind</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/plugins/codebehind</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_8/plugins/codebehind</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.1.7</version>
|
||||
<version>2.1.8</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_1_7/plugins/config-browser</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_7/plugins/config-browser</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_7/plugins/config-browser</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/plugins/config-browser</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_1_8/plugins/config-browser</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_1_8/plugins/config-browser</url>
|
||||
</scm>
|
||||
|
||||
</project>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user