Compare commits

...

42 Commits

Author SHA1 Message Date
Lukasz Lenart b2fe62824e [maven-release-plugin] copy for tag STRUTS_2_3_8
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8@1422545 13f79535-47bb-0310-9956-ffa450edef68
2012-12-16 11:45:13 +00:00
Lukasz Lenart 992bc8c641 [maven-release-plugin] prepare release STRUTS_2_3_8
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1422543 13f79535-47bb-0310-9956-ffa450edef68
2012-12-16 11:44:57 +00:00
Lukasz Lenart 3ac5711ef3 WW-3946 Removes commented plugins to allow prepare a release
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1422519 13f79535-47bb-0310-9956-ffa450edef68
2012-12-16 11:09:31 +00:00
Lukasz Lenart eb43cfc9c8 WW-3946 updates archetypes version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1422507 13f79535-47bb-0310-9956-ffa450edef68
2012-12-16 10:29:05 +00:00
Lukasz Lenart 1f1d855086 WW-3946 prepares for release
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1422506 13f79535-47bb-0310-9956-ffa450edef68
2012-12-16 10:27:44 +00:00
Lukasz Lenart a4f1a77b2d WW-3863 Allows to define encoding per result
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1421740 13f79535-47bb-0310-9956-ffa450edef68
2012-12-14 08:53:49 +00:00
Lukasz Lenart b86d3d13fe WW-3942 solves NPE in iterator tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1421210 13f79535-47bb-0310-9956-ffa450edef68
2012-12-13 10:42:09 +00:00
Lukasz Lenart 0d93ceedf3 WW-3943 adds support for REST plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1421096 13f79535-47bb-0310-9956-ffa450edef68
2012-12-13 07:24:06 +00:00
Christian Grobmeier 6bd836ee2a corrected svn id tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1420932 13f79535-47bb-0310-9956-ffa450edef68
2012-12-12 19:44:33 +00:00
Christian Grobmeier b87e82b1c9 added required license header
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1420931 13f79535-47bb-0310-9956-ffa450edef68
2012-12-12 19:43:31 +00:00
Christian Grobmeier b72d2a08c4 created serial uid
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1420930 13f79535-47bb-0310-9956-ffa450edef68
2012-12-12 19:37:49 +00:00
Christian Grobmeier adacc6741a example on how to wire session scoped spring beans prio spring-test 3.2 with the junit plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1420928 13f79535-47bb-0310-9956-ffa450edef68
2012-12-12 19:36:56 +00:00
Lukasz Lenart 21d624697d WW-3766 sets struts.freemarker.mru.max.strong.size to 0 to SoftCacheStorage which performs better in heavy loaded applications
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1419061 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 18:09:19 +00:00
Lukasz Lenart 147a391cb6 WW-2537 cleans up code and logging
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1419038 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 17:45:58 +00:00
Lukasz Lenart f437838f39 WW-2537 clears warning about generics
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1418923 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 12:57:07 +00:00
Lukasz Lenart b312f1e7a0 WW-2537 clears warning about generics
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1418920 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 12:51:14 +00:00
Lukasz Lenart 225921477b WW-3058 Removes version from pom to use version from parent pom
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1418881 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 10:18:47 +00:00
Lukasz Lenart 3b8f2023c2 WW-3058 Upgrades only Velocity to 1.6.4 and cleans up poms a bit
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1418866 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 09:45:55 +00:00
Lukasz Lenart 35897a3c6c WW-3910 returns empty string list instead null and uses List instead of String[] array
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1417344 13f79535-47bb-0310-9956-ffa450edef68
2012-12-05 10:35:55 +00:00
Lukasz Lenart 58c919c5cb WW-3927 corrects developer notification
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1417339 13f79535-47bb-0310-9956-ffa450edef68
2012-12-05 10:17:35 +00:00
Lukasz Lenart 87feb01fd6 Adds Comparable to allow compile under JDK7
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1417321 13f79535-47bb-0310-9956-ffa450edef68
2012-12-05 09:08:10 +00:00
Lukasz Lenart d5108840a5 WW-3928 Rollbacks changes introduced with WW-2749 to allow work with mod_jk and so on
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1415770 13f79535-47bb-0310-9956-ffa450edef68
2012-11-30 17:58:41 +00:00
Lukasz Lenart 5c25eab9ef WW-3930 updates JavaDocs about static content loader
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1415524 13f79535-47bb-0310-9956-ffa450edef68
2012-11-30 07:25:53 +00:00
Lukasz Lenart cbe1d02cc5 Removes metadata as it's useless now
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1414891 13f79535-47bb-0310-9956-ffa450edef68
2012-11-28 20:12:49 +00:00
Lukasz Lenart c7eb0be7bf WW-3928 Adds deprecation warning to don't use ActionContextCleanUp any more
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1414400 13f79535-47bb-0310-9956-ffa450edef68
2012-11-27 21:06:08 +00:00
Lukasz Lenart 64c1753893 Excludes gxp and embedded jsp plugins from Maven build as theses plugins aren't Java5 complaint
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412446 13f79535-47bb-0310-9956-ffa450edef68
2012-11-22 08:06:54 +00:00
Lukasz Lenart 0f2c049ef2 Adjusts code base to be compliant with Java 1.5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412443 13f79535-47bb-0310-9956-ffa450edef68
2012-11-22 07:49:20 +00:00
Lukasz Lenart 948cbd8679 Adjusts code base to be compliant with Java 1.5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412438 13f79535-47bb-0310-9956-ffa450edef68
2012-11-22 07:34:17 +00:00
Lukasz Lenart 0802b09ea1 Adjusts code base to be compliant with Java 1.7
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412316 13f79535-47bb-0310-9956-ffa450edef68
2012-11-21 21:43:04 +00:00
Lukasz Lenart edbfa6716c Adjusts code base to be compliant with Java 1.5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412281 13f79535-47bb-0310-9956-ffa450edef68
2012-11-21 20:48:20 +00:00
Christian Grobmeier 7f83250dc3 fixed typo
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412216 13f79535-47bb-0310-9956-ffa450edef68
2012-11-21 18:02:53 +00:00
Christian Grobmeier 6a0abf4387 Example should not use deprecated attributes. Added example showing evaluation of tag body
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412215 13f79535-47bb-0310-9956-ffa450edef68
2012-11-21 18:02:17 +00:00
Lukasz Lenart b2428dbe78 WW-3884 reverts site target back to 2.x
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1411402 13f79535-47bb-0310-9956-ffa450edef68
2012-11-19 20:45:37 +00:00
Lukasz Lenart 7e3f60601b WW-3918 removes FileManager#isReloadConfigs() method and use @Inject("struts.configuration.xml.reload")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406190 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 15:45:57 +00:00
Lukasz Lenart 1011732ee2 WW-3918 removes FileManager#isReloadConfigs() method and use @Inject("struts.configuration.xml.reload")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406183 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 15:36:59 +00:00
Lukasz Lenart 60afb3aa82 WW-3918 removes FileManager#isReloadConfigs() method and use @Inject("struts.configuration.xml.reload")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406176 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 15:28:56 +00:00
Lukasz Lenart ac46437f21 WW-3907 upgrades to OGNL 3.0.6
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406159 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 14:54:28 +00:00
Lukasz Lenart 68b0ac243d Does minor code refactoring and adds some additional logging
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406154 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 14:44:10 +00:00
Lukasz Lenart f619eaefbf WW-3918 removes FileManager#isReloadConfigs() method and use @Inject("struts.configuration.xml.reload")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406145 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 14:23:51 +00:00
Lukasz Lenart 2f465f8daf WW-3917 removes FileManager dependency from UrlSet
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406110 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 12:18:21 +00:00
Lukasz Lenart e0609a5fe8 WW-3916 adds the latest Jetty maven plugin to blank app
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406109 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 12:10:41 +00:00
Lukasz Lenart a7443f0693 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406062 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 07:06:02 +00:00
113 changed files with 930 additions and 2232 deletions
+8 -9
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.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_3_7/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps/blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/apps/blank</url>
</scm>
<dependencies>
@@ -65,15 +65,14 @@
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.0.1</version>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.7.v20120910</version>
<configuration>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
<scanIntervalSeconds>10</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp/WEB-INF</scanTarget>
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
<scanTarget>src/main/resources/struts.xml</scanTarget>
<scanTarget>src/main/resources/example.xml</scanTarget>
</scanTargets>
</configuration>
</plugin>
+1 -1
View File
@@ -6,7 +6,7 @@
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.devMode" value="true" />
<package name="default" namespace="/" extends="struts-default">
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jboss-blank</artifactId>
@@ -34,9 +34,9 @@
<name>JBoss Blank Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps/jboss-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/apps/jboss-blank</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -34,9 +34,9 @@
<name>Mail Reader Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps/mailreader</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/apps/mailreader</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
@@ -42,9 +42,9 @@
</modules>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/apps</url>
</scm>
<profiles>
+5 -19
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.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_3_7/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps/portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/apps/portlet</url>
</scm>
<profiles>
@@ -118,22 +118,8 @@
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>1.3</version>
<exclusions>
<exclusion>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
+7 -2
View File
@@ -26,13 +26,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>2.3.7</version>
<version>2.3.8</version>
<name>Struts 2 Rest Showcase Example</name>
<description>Struts 2 Rest Showcase Example</description>
@@ -47,6 +47,11 @@
<artifactId>struts2-convention-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
+4 -19
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.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_3_7/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps/showcase</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/apps/showcase</url>
</scm>
@@ -134,23 +134,8 @@
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<exclusions>
<exclusion>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Maven Archetypes</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes</url>
</scm>
<modules>
+5 -5
View File
@@ -3,19 +3,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-blank</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Blank</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-blank</url>
</scm>
<properties>
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-convention</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Blank Convention</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-convention</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-convention</url>
</scm>
<properties>
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-dbportlet</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Database Portlet</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-dbportlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-dbportlet</url>
</scm>
<properties>
+5 -5
View File
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-plugin</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-plugin</url>
</scm>
<properties>
+5 -5
View File
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-portlet</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Portlet</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-portlet</url>
</scm>
<properties>
+5 -5
View File
@@ -4,19 +4,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-starter</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Starter</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-starter</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/archetypes/struts2-archetype-starter</url>
</scm>
<properties>
+4 -4
View File
@@ -11,13 +11,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/assembly</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/assembly</url>
</scm>
<profiles>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.3.7</version>
<version>2.3.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_3_7/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/bundles/admin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/bundles/admin</url>
</scm>
<dependencies>
+4 -10
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.3.7</version>
<version>2.3.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_3_7/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/bundles/demo</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/bundles/demo</url>
</scm>
<dependencies>
@@ -28,12 +28,6 @@
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.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_3_7/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/bundles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/bundles</url>
</scm>
<modules>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.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_3_7/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/core</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/core</url>
</scm>
<properties>
@@ -21,19 +21,18 @@
package org.apache.struts2.components;
import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import java.util.Arrays;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.util.MakeIterator;
import org.apache.struts2.views.jsp.IteratorStatus;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.util.MakeIterator;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.jsp.IteratorStatus;
import java.io.Writer;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
/**
* <!-- START SNIPPET: javadoc -->
@@ -357,7 +356,7 @@ public class IteratorComponent extends ContextBean {
}
}
class CounterIterator implements Iterator<Object> {
static class CounterIterator implements Iterator<Object> {
private int step;
private int end;
private int currentIndex;
@@ -380,7 +379,7 @@ public class IteratorComponent extends ContextBean {
if (hasNext()) {
int nextIndex = peekNextIndex();
currentIndex += step;
return value != null ? values.get(nextIndex) : nextIndex;
return values != null ? values.get(nextIndex) : nextIndex;
} else {
throw new IndexOutOfBoundsException("Index " + ( currentIndex + step) + " must be less than or equal to " + end);
}
@@ -33,7 +33,6 @@ import org.apache.struts2.views.annotations.StrutsTagAttribute;
import java.io.IOException;
import java.io.Writer;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.util.Currency;
@@ -212,6 +211,8 @@ public class Number extends ContextBean {
}
private void setRoundingMode(NumberFormat format) {
/*
TODO lukaszlenart: enable when switched to Java 1.6
if (roundingMode != null) {
roundingMode = findString(roundingMode);
if ("ceiling".equals(roundingMode)) {
@@ -234,6 +235,7 @@ public class Number extends ContextBean {
LOG.error("Could not recognise a roundingMode of [" + roundingMode + "]");
}
}
*/
}
private NumberFormat getNumberFormat() {
@@ -396,7 +398,7 @@ public class Number extends ContextBean {
/**
* @param roundingMode the roundingMode to set
*/
@StrutsTagAttribute(description = "The rounding mode to use", type = "String")
@StrutsTagAttribute(description = "The rounding mode to use - not implemented yet as this required Java 1.6", type = "String")
public void setRoundingMode(String roundingMode) {
this.roundingMode = roundingMode;
}
@@ -35,7 +35,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* useful in both cases: when the complex expression takes time (performance improvement) or is hard to read (code
* readability improvement).</p>
* <p>If the tag is used with body content, the evaluation of the value parameter is omitted. Instead, the String to
* which the body eveluates is set as value for the scoped variable.</p>
* which the body evaluates is set as value for the scoped variable.</p>
*
* The scopes available are as follows :-
* <ul>
@@ -72,8 +72,11 @@ import com.opensymphony.xwork2.util.ValueStack;
*
* <pre>
* <!-- START SNIPPET: example -->
* &lt;s:set name="personName" value="person.name"/&gt;
* Hello, &lt;s:property value="#personName"/&gt;. How are you?
* &lt;s:set var="personName" value="person.name"/&gt;
* Hello, &lt;s:property value="#personName"/&gt;
*
* &lt;s:set var="janesName"&gt;Jane Doe&lt;/s:set&gt;
* &lt;s:property value="#janesName"/&gt;
* <!-- END SNIPPET: example -->
* </pre>
*
@@ -21,7 +21,10 @@
package org.apache.struts2.dispatcher;
import java.io.IOException;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import com.opensymphony.xwork2.util.profiling.UtilTimerStack;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@@ -31,11 +34,7 @@ import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import com.opensymphony.xwork2.util.profiling.UtilTimerStack;
import java.io.IOException;
/**
* <!-- SNIPPET START: description -->
@@ -80,6 +79,8 @@ public class ActionContextCleanUp implements Filter {
*/
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
showDeprecatedWarning();
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
@@ -137,4 +138,22 @@ public class ActionContextCleanUp implements Filter {
public void init(FilterConfig arg0) throws ServletException {
}
private void showDeprecatedWarning() {
String msg =
"\n\n" +
"***************************************************************************\n" +
"* WARNING!!! *\n" +
"* *\n" +
"* >>> ActionContextCleanUp <<< is deprecated! Please use the new filters! *\n" +
"* *\n" +
"* This can be a source of unpredictable problems! *\n" +
"* *\n" +
"* Please refer to the docs for more details! *\n" +
"* http://struts.apache.org/2.x/docs/webxml.html *\n" +
"* *\n" +
"***************************************************************************\n\n";
System.out.println(msg);
}
}
@@ -37,9 +37,30 @@ import java.net.URL;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;
/**
* <b>Default implementation to server static content</b>
* <p/>
* This class is used to serve common static content needed when using various parts of Struts, such as JavaScript
* files, CSS files, etc. It works by looking for requests to /struts/* (or /static/*), and then mapping the value after "/struts/"
* to common packages in Struts and, optionally, in your class path. By default, the following packages are
* automatically searched:
* <ul>
* <li>org.apache.struts2.static</li>
* <li>template</li>
* <li>static</li>
* </ul>
* <p/> This means that you can simply request /struts/xhtml/styles.css and the XHTML UI theme's default stylesheet
* will be returned. Likewise, many of the AJAX UI components require various JavaScript files, which are found in the
* org.apache.struts2.static package. If you wish to add additional packages to be searched, you can add a comma
* separated (space, tab and new line will do as well) list in the filter init parameter named "packages". <b>Be
* careful</b>, however, to expose any packages that may have sensitive information, such as properties file with
* database access credentials.
* <p/>
*/
public class DefaultStaticContentLoader implements StaticContentLoader {
/**
* Provide a logging instance.
@@ -49,7 +70,7 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
/**
* Store set of path prefixes to use with static resources.
*/
protected String[] pathPrefixes;
protected List<String> pathPrefixes;
/**
* Store state of StrutsConstants.STRUTS_SERVE_STATIC_CONTENT setting.
@@ -130,9 +151,9 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
* A comma-delimited String listing packages
* @return A string array of packages
*/
protected String[] parse(String packages) {
protected List<String> parse(String packages) {
if (packages == null) {
return null;
return Collections.emptyList();
}
List<String> pathPrefixes = new ArrayList<String>();
@@ -145,7 +166,7 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
pathPrefixes.add(pathPrefix);
}
return pathPrefixes.toArray(new String[pathPrefixes.size()]);
return pathPrefixes;
}
/*
@@ -233,7 +254,6 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
} finally {
is.close();
}
return;
}
}
@@ -256,7 +276,7 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
}
}
log = LoggerFactory.getLogger(FilterDispatcher.class);
log = LoggerFactory.getLogger(DefaultStaticContentLoader.class);
}
@@ -276,7 +296,6 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
* @param packagePrefix The package prefix to use to locate the resource
* @return full path
* @throws UnsupportedEncodingException
* @throws IOException
*/
protected String buildPath(String name, String packagePrefix) throws UnsupportedEncodingException {
String resourcePath;
@@ -20,15 +20,20 @@
*/
package org.apache.struts2.dispatcher;
import java.io.IOException;
import org.apache.struts2.dispatcher.ng.HostConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.dispatcher.ng.HostConfig;
import java.io.IOException;
/**
* Interface for loading static resources, based on a path
* Interface for loading static resources, based on a path. After implementing your own static content loader
* you must tell the framework how to use it, eg.
*
* &lt;bean name="myContentLoader" type="org.apache.struts2.dispatcher" class="com.company.struts.MyContentLoader"/&gt;
* &lt;constant name="struts.staticContentLoader" value="myContentLoader"/&gt;
*
* Check {@link org.apache.struts2.config.BeanSelectionProvider} for more details.
*/
public interface StaticContentLoader {
@@ -3,8 +3,8 @@ package org.apache.struts2.dispatcher.mapper;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import javax.servlet.http.HttpServletRequest;
@@ -14,7 +14,7 @@ import java.util.Map;
/**
* <!-- START SNIPPET: description -->
*
*
* A prefix based action mapper that is capable of delegating to other {@link ActionMapper}s based on the request's prefix
*
* It is configured through struts.xml
@@ -37,98 +37,100 @@ import java.util.Map;
*
* @see ActionMapper
* @see ActionMapping
*
*/
public class PrefixBasedActionMapper extends DefaultActionMapper implements ActionMapper {
protected transient final Log log = LogFactory.getLog(getClass());
protected Container container;
protected Map<String,ActionMapper> actionMappers = new HashMap<String,ActionMapper>();
@Inject
public void setContainer(Container container) {
this.container = container;
}
private static final Logger LOG = LoggerFactory.getLogger(PrefixBasedActionMapper.class);
@Inject(StrutsConstants.PREFIX_BASED_MAPPER_CONFIGURATION)
public void setPrefixBasedActionMappers(String list) {
if (list != null) {
String[] mappers = list.split(",");
for (String mapper : mappers) {
String[] thisMapper = mapper.split(":");
if ((thisMapper != null) && (thisMapper.length == 2)) {
String mapperPrefix = thisMapper[0].trim();
String mapperName = thisMapper[1].trim();
Object obj = container.getInstance(ActionMapper.class, mapperName);
if (obj != null) {
actionMappers.put(mapperPrefix, (ActionMapper) obj);
} else if (log.isDebugEnabled()) {
log.debug("invalid PrefixBasedActionMapper config entry: " + mapper);
}
}
}
protected Container container;
protected Map<String, ActionMapper> actionMappers = new HashMap<String, ActionMapper>();
@Inject
public void setContainer(Container container) {
this.container = container;
}
}
@SuppressWarnings("unchecked")
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
String uri = getUri(request);
for (int lastIndex = uri.lastIndexOf('/'); lastIndex > (-1); lastIndex = uri.lastIndexOf('/', lastIndex-1)) {
ActionMapper actionMapper = actionMappers.get(uri.substring(0,lastIndex));
if (actionMapper != null) {
ActionMapping actionMapping = actionMapper.getMapping(request, configManager);
if (log.isDebugEnabled()) {
log.debug("Using ActionMapper "+actionMapper);
}
if (actionMapping != null) {
if (log.isDebugEnabled()) {
if (actionMapping.getParams() != null) {
log.debug("ActionMapper found mapping. Parameters: "+actionMapping.getParams());
for (Map.Entry<String,Object> mappingParameterEntry : ((Map<String,Object>)(actionMapping.getParams())).entrySet()) {
Object paramValue = mappingParameterEntry.getValue();
if (paramValue == null) {
log.debug(mappingParameterEntry.getKey()+" : null!");
} else if (paramValue instanceof String[]) {
log.debug(mappingParameterEntry.getKey()+" : (String[]) "+Arrays.toString((String[])paramValue));
} else if (paramValue instanceof String) {
log.debug(mappingParameterEntry.getKey()+" : (String) "+(String)paramValue);
} else {
log.debug(mappingParameterEntry.getKey()+" : (Object) "+(paramValue.toString()));
@Inject(StrutsConstants.PREFIX_BASED_MAPPER_CONFIGURATION)
public void setPrefixBasedActionMappers(String list) {
if (list != null) {
String[] mappers = list.split(",");
for (String mapper : mappers) {
String[] thisMapper = mapper.split(":");
if ((thisMapper != null) && (thisMapper.length == 2)) {
String mapperPrefix = thisMapper[0].trim();
String mapperName = thisMapper[1].trim();
Object obj = container.getInstance(ActionMapper.class, mapperName);
if (obj != null) {
actionMappers.put(mapperPrefix, (ActionMapper) obj);
} else if (LOG.isDebugEnabled()) {
LOG.debug("invalid PrefixBasedActionMapper config entry: [#0]", mapper);
}
}
}
}
}
return actionMapping;
} else if (log.isDebugEnabled()) {
log.debug("ActionMapper "+actionMapper+" failed to return an ActionMapping");
}
}
}
if (log.isDebugEnabled()) {
log.debug("no ActionMapper found");
}
return null;
}
public String getUriFromActionMapping(ActionMapping mapping) {
String namespace = mapping.getNamespace();
for (int lastIndex = namespace.length(); lastIndex > (-1); lastIndex = namespace.lastIndexOf('/', lastIndex-1)) {
ActionMapper actionMapper = actionMappers.get(namespace.substring(0,lastIndex));
if (actionMapper != null) {
String uri = actionMapper.getUriFromActionMapping(mapping);
if (log.isDebugEnabled()) {
log.debug("Using ActionMapper "+actionMapper);
@SuppressWarnings("unchecked")
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
String uri = getUri(request);
for (int lastIndex = uri.lastIndexOf('/'); lastIndex > (-1); lastIndex = uri.lastIndexOf('/', lastIndex - 1)) {
ActionMapper actionMapper = actionMappers.get(uri.substring(0, lastIndex));
if (actionMapper != null) {
ActionMapping actionMapping = actionMapper.getMapping(request, configManager);
if (LOG.isDebugEnabled()) {
LOG.debug("Using ActionMapper [#0]", actionMapper.toString());
}
if (actionMapping != null) {
if (LOG.isDebugEnabled()) {
if (actionMapping.getParams() != null) {
LOG.debug("ActionMapper found mapping. Parameters: [#0]", actionMapping.getParams().toString());
for (Map.Entry<String, Object> mappingParameterEntry : actionMapping.getParams().entrySet()) {
Object paramValue = mappingParameterEntry.getValue();
if (paramValue == null) {
LOG.debug("[#0] : null!", mappingParameterEntry.getKey());
} else if (paramValue instanceof String[]) {
LOG.debug("[#0] : (String[]) #1", mappingParameterEntry.getKey(), Arrays.toString((String[]) paramValue));
} else if (paramValue instanceof String) {
LOG.debug("[#0] : (String) [#1]", mappingParameterEntry.getKey(), paramValue.toString());
} else {
LOG.debug("[#0] : (Object) [#1]", mappingParameterEntry.getKey(), paramValue.toString());
}
}
}
}
return actionMapping;
} else if (LOG.isDebugEnabled()) {
LOG.debug("ActionMapper [#0] failed to return an ActionMapping", actionMapper.toString());
}
}
}
if (uri != null) {
return uri;
} else if (log.isDebugEnabled()) {
log.debug("ActionMapper "+actionMapper+" failed to return an ActionMapping (null)");
if (LOG.isDebugEnabled()) {
LOG.debug("No ActionMapper found");
}
}
return null;
}
if (log.isDebugEnabled()) {
log.debug("ActionMapper failed to return a uri");
public String getUriFromActionMapping(ActionMapping mapping) {
String namespace = mapping.getNamespace();
for (int lastIndex = namespace.length(); lastIndex > (-1); lastIndex = namespace.lastIndexOf('/', lastIndex - 1)) {
ActionMapper actionMapper = actionMappers.get(namespace.substring(0, lastIndex));
if (actionMapper != null) {
String uri = actionMapper.getUriFromActionMapping(mapping);
if (LOG.isDebugEnabled()) {
LOG.debug("Using ActionMapper [#0]", actionMapper.toString());
}
if (uri != null) {
return uri;
} else if (LOG.isDebugEnabled()) {
LOG.debug("ActionMapper [#0] failed to return an ActionMapping (null)", actionMapper.toString());
}
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("ActionMapper failed to return a uri");
}
return null;
}
return null;
}
}
@@ -58,12 +58,13 @@ public class CheckboxInterceptor extends AbstractInterceptor {
private static final Logger LOG = LoggerFactory.getLogger(CheckboxInterceptor.class);
public String intercept(ActionInvocation ai) throws Exception {
Map parameters = ai.getInvocationContext().getParameters();
Map<String, Object> parameters = ai.getInvocationContext().getParameters();
Map<String, String[]> newParams = new HashMap<String, String[]>();
Set<Map.Entry> entries = parameters.entrySet();
for (Iterator<Map.Entry> iterator = entries.iterator(); iterator.hasNext();) {
Map.Entry entry = iterator.next();
String key = (String)entry.getKey();
Set<Map.Entry<String, Object>> entries = parameters.entrySet();
for (Iterator<Map.Entry<String, Object>> iterator = entries.iterator(); iterator.hasNext();) {
Map.Entry<String, Object> entry = iterator.next();
String key = entry.getKey();
if (key.startsWith("__checkbox_")) {
String name = key.substring("__checkbox_".length());
@@ -20,16 +20,14 @@
*/
package org.apache.struts2.interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
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
@@ -49,7 +47,7 @@ public class MultiselectInterceptor extends AbstractInterceptor {
* @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> parameters = actionInvocation.getInvocationContext().getParameters();
Map<String, Object> newParams = new HashMap<String, Object>();
Set<String> keys = parameters.keySet();
@@ -74,4 +72,5 @@ public class MultiselectInterceptor extends AbstractInterceptor {
return actionInvocation.invoke();
}
}
@@ -154,8 +154,9 @@ public class JBossFileManager extends DefaultFileManager {
}
private void readFile(List<URL> urls, File physicalFile) throws MalformedURLException {
if (physicalFile.isDirectory()) {
for (File file : physicalFile.listFiles()) {
File[] files = physicalFile.listFiles();
if (physicalFile.isDirectory() && files != null) {
for (File file : files) {
if (file.isFile()) {
addIfAbsent(urls, file.toURI().toURL());
} else if (file.isDirectory()) {
@@ -184,8 +184,9 @@ struts.freemarker.beanwrapperCache=false
### See the StrutsBeanWrapper javadocs for more information
struts.freemarker.wrapper.altMap=true
### maxStrongSize for MruCacheStorage for freemarker
struts.freemarker.mru.max.strong.size=100
### maxStrongSize for MruCacheStorage for freemarker, when set to 0 SoftCacheStorage which performs better in heavy loaded application
### check WW-3766 for more details
struts.freemarker.mru.max.strong.size=0
### configure the XSLTResult class to use stylesheet caching.
### Set to true for developers and false for production.
+1 -1
View File
@@ -111,7 +111,7 @@ Please do not edit it directly.
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">The rounding mode to use</td>
<td align="left" valign="top">The rounding mode to use - not implemented yet as this required Java 1.6</td>
</tr>
<tr>
<td align="left" valign="top">type</td>
@@ -0,0 +1,91 @@
package org.apache.struts2.components;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.StrutsTestCase;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.List;
public class IteratorComponentTest extends StrutsTestCase {
public void testIterator() throws Exception {
// given
final ValueStack stack = ActionContext.getContext().getValueStack();
stack.push(new FooAction());
StringWriter out = new StringWriter();
IteratorComponent ic = new IteratorComponent(stack);
ic.setValue("items");
ic.setVar("val");
Property prop = new Property(stack);
ic.getComponentStack().push(prop);
ic.getComponentStack().push(prop);
ic.getComponentStack().push(prop);
ic.getComponentStack().push(prop);
String body = " ";
// when
assertTrue(ic.start(out));
for (int i = 0; i < 4; i++) {
prop.start(out);
prop.end(out, body);
ic.end(out, null);
}
// then
assertEquals("item1 item2 item3 item4 ", out.getBuffer().toString());
}
public void testIteratorWithBegin() throws Exception {
// given
final ValueStack stack = ActionContext.getContext().getValueStack();
stack.push(new FooAction());
StringWriter out = new StringWriter();
IteratorComponent ic = new IteratorComponent(stack);
ic.setValue("items");
ic.setVar("val");
ic.setBegin("1");
Property prop = new Property(stack);
ic.getComponentStack().push(prop);
ic.getComponentStack().push(prop);
ic.getComponentStack().push(prop);
String body = " ";
// when
assertTrue(ic.start(out));
for (int i = 0; i < 3; i++) {
prop.start(out);
prop.end(out, body);
ic.end(out, null);
}
// then
assertEquals("item2 item3 item4 ", out.getBuffer().toString());
}
static class FooAction {
private List items;
public FooAction() {
items = Arrays.asList("item1", "item2", "item3", "item4");
}
public List getItems() {
return items;
}
}
}
@@ -0,0 +1,35 @@
package org.apache.struts2.dispatcher;
import org.apache.struts2.StrutsTestCase;
import java.util.List;
public class DefaultStaticContentLoaderTest extends StrutsTestCase {
public void testParsePackages() throws Exception {
DefaultStaticContentLoader filterDispatcher = new DefaultStaticContentLoader();
List<String> result1 = filterDispatcher.parse("foo.bar.package1 foo.bar.package2 foo.bar.package3");
List<String> result2 = filterDispatcher.parse("foo.bar.package1\tfoo.bar.package2\tfoo.bar.package3");
List<String> result3 = filterDispatcher.parse("foo.bar.package1,foo.bar.package2,foo.bar.package3");
List<String> result4 = filterDispatcher.parse("foo.bar.package1 foo.bar.package2 \t foo.bar.package3 , foo.bar.package4");
assertEquals(result1.get(0), "foo/bar/package1/");
assertEquals(result1.get(1), "foo/bar/package2/");
assertEquals(result1.get(2), "foo/bar/package3/");
assertEquals(result2.get(0), "foo/bar/package1/");
assertEquals(result2.get(1), "foo/bar/package2/");
assertEquals(result2.get(2), "foo/bar/package3/");
assertEquals(result3.get(0), "foo/bar/package1/");
assertEquals(result3.get(1), "foo/bar/package2/");
assertEquals(result3.get(2), "foo/bar/package3/");
assertEquals(result4.get(0), "foo/bar/package1/");
assertEquals(result4.get(1), "foo/bar/package2/");
assertEquals(result4.get(2), "foo/bar/package3/");
assertEquals(result4.get(3), "foo/bar/package4/");
}
}
@@ -23,8 +23,8 @@ package org.apache.struts2.dispatcher;
import com.mockobjects.dynamic.C;
import com.mockobjects.dynamic.Mock;
import com.opensymphony.xwork2.FileManagerFactory;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.XWorkConstants;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.config.entities.InterceptorMapping;
@@ -33,7 +33,6 @@ import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.interceptor.Interceptor;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.dispatcher.FilterDispatcherTest.InnerDestroyableObjectFactory;
@@ -194,17 +193,19 @@ public class DispatcherTest extends StrutsTestCase {
cm.setConfiguration((Configuration)mockConfiguration.proxy());
Mock mockContainer = new Mock(Container.class);
mockConfiguration.expectAndReturn("getContainer", mockContainer.proxy());
String reloadConfigs = container.getInstance(String.class, XWorkConstants.RELOAD_XML_CONFIGURATION);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
reloadConfigs);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(ObjectFactory.class)), destroyedObjectFactory);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
reloadConfigs);
mockConfiguration.expectAndReturn("getContainer", mockContainer.proxy());
mockConfiguration.expectAndReturn("getContainer", mockContainer.proxy());
mockConfiguration.expectAndReturn("getContainer", mockContainer.proxy());
FileManagerFactory fileManagerFactory = new DefaultFileManagerFactory();
container.inject(fileManagerFactory);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(FileManagerFactory.class)), fileManagerFactory);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(FileManagerFactory.class)), fileManagerFactory);
mockConfiguration.expect("destroy");
mockConfiguration.matchAndReturn("getPackageConfigs", new HashMap<String, PackageConfig>());
du.setConfigurationManager(cm);
assertFalse(destroyedObjectFactory.destroyed);
du.cleanup();
@@ -229,9 +230,11 @@ public class DispatcherTest extends StrutsTestCase {
Mock mockContainer = new Mock(Container.class);
mockContainer.matchAndReturn("getInstance", C.args(C.eq(ObjectFactory.class)), new ObjectFactory());
DefaultFileManagerFactory factory = new DefaultFileManagerFactory();
container.inject(factory);
mockContainer.matchAndReturn("getInstance", C.args(C.eq(FileManagerFactory.class)), factory);
String reloadConfigs = container.getInstance(String.class, XWorkConstants.RELOAD_XML_CONFIGURATION);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
reloadConfigs);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(String.class), C.eq(XWorkConstants.RELOAD_XML_CONFIGURATION)),
reloadConfigs);
Mock mockConfiguration = new Mock(Configuration.class);
mockConfiguration.matchAndReturn("getPackageConfigs", packageConfigs);
@@ -49,35 +49,6 @@ import java.util.HashMap;
*/
public class FilterDispatcherTest extends StrutsTestCase {
public void testParsePackages() throws Exception {
DefaultStaticContentLoader filterDispatcher = new DefaultStaticContentLoader();
String[] result1 = filterDispatcher.parse("foo.bar.package1 foo.bar.package2 foo.bar.package3");
String[] result2 = filterDispatcher.parse("foo.bar.package1\tfoo.bar.package2\tfoo.bar.package3");
String[] result3 = filterDispatcher.parse("foo.bar.package1,foo.bar.package2,foo.bar.package3");
String[] result4 = filterDispatcher.parse("foo.bar.package1 foo.bar.package2 \t foo.bar.package3 , foo.bar.package4");
assertEquals(result1[0], "foo/bar/package1/");
assertEquals(result1[1], "foo/bar/package2/");
assertEquals(result1[2], "foo/bar/package3/");
assertEquals(result2[0], "foo/bar/package1/");
assertEquals(result2[1], "foo/bar/package2/");
assertEquals(result2[2], "foo/bar/package3/");
assertEquals(result3[0], "foo/bar/package1/");
assertEquals(result3[1], "foo/bar/package2/");
assertEquals(result3[2], "foo/bar/package3/");
assertEquals(result4[0], "foo/bar/package1/");
assertEquals(result4[1], "foo/bar/package2/");
assertEquals(result4[2], "foo/bar/package3/");
assertEquals(result4[3], "foo/bar/package4/");
}
public void testIfActionMapperIsNullDontServiceAction() throws Exception {
MockServletContext servletContext = new MockServletContext();
MockFilterConfig filterConfig = new MockFilterConfig(servletContext);
@@ -217,10 +217,24 @@ public class FreeMarkerResultTest extends StrutsTestCase {
Dispatcher dispatcher = Dispatcher.getInstance();
ActionMapping mapping = dispatcher.getContainer().getInstance(ActionMapper.class).getMapping(request, dispatcher.getConfigurationManager());
dispatcher.serviceAction(request, response, servletContext, mapping);
String expected = "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" placeholder=\"input\" foo=\"bar\"/>"
// TODO lukaszlenart: remove expectedJDK15 and if() after switching to Java 1.6
String expectedJDK15 =
"<input type=\"text\" name=\"test\" value=\"\" id=\"test\" foo=\"bar\" placeholder=\"input\"/>"
+ "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" foo=\"bar\" placeholder=\"input\"/>"
+ "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" break=\"true\"/>";
String expectedJDK16 =
"<input type=\"text\" name=\"test\" value=\"\" id=\"test\" placeholder=\"input\" foo=\"bar\"/>"
+ "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" placeholder=\"input\" foo=\"bar\"/>"
+ "<input type=\"text\" name=\"test\" value=\"\" id=\"test\" break=\"true\"/>";
assertEquals(expected, stringWriter.toString());
String result = stringWriter.toString();
if (result.contains("foo=\"bar\" placeholder=\"input\"")) {
assertEquals(expectedJDK15, result);
} else {
assertEquals(expectedJDK16, result);
}
}
public void testManualListInTemplate() throws Exception {
@@ -3,7 +3,6 @@ package org.apache.struts2.views.jsp;
import com.opensymphony.xwork2.ActionContext;
import org.apache.struts2.TestAction;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.util.Locale;
@@ -66,7 +65,10 @@ public class NumberTagTest extends AbstractTagTest {
// then
NumberFormat format = NumberFormat.getCurrencyInstance((Locale) context.get(ActionContext.LOCALE));
/*
TODO lukaszlenart: enable when switched to Java 1.6
format.setRoundingMode(RoundingMode.CEILING);
*/
String expected = format.format(120.0f);
assertEquals(expected, writer.toString());
@@ -90,7 +92,10 @@ public class NumberTagTest extends AbstractTagTest {
// then
NumberFormat format = NumberFormat.getInstance((Locale) context.get(ActionContext.LOCALE));
/*
TODO lukaszlenart: enable when switched to Java 1.6
format.setRoundingMode(RoundingMode.CEILING);
*/
String expected = format.format(120.45f);
assertEquals(expected, writer.toString());
+1 -1
View File
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.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_3_7/plugins/codebehind</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/codebehind</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/codebehind</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/codebehind</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/codebehind</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/codebehind</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.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_3_7/plugins/config-browser</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/config-browser</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/config-browser</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/config-browser</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/config-browser</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/config-browser</url>
</scm>
</project>
@@ -95,4 +95,19 @@ public class ActionNamesAction extends ActionSupport {
actionNames = new TreeSet<String>(configHelper.getActionNames(namespace));
return SUCCESS;
}
/**
* Index action to support cooperation with REST plugin
*
* @return action result
* @throws Exception
*/
public String index() throws Exception {
return execute();
}
public String redirect() {
return SUCCESS;
}
}
@@ -83,6 +83,16 @@ public class ListValidatorsAction extends ActionSupport {
return super.execute();
}
/**
* Index action to support cooperation with REST plugin
*
* @return action result
* @throws Exception
*/
public String index() throws Exception {
return execute();
}
protected void loadValidators() {
Class value = getClassInstance();
if ( value != null ) {
@@ -42,7 +42,7 @@
<result name="input" type="freemarker">/config-browser/error.ftl</result>
</global-results>
<action name="index">
<action name="index" class="org.apache.struts2.config_browser.ActionNamesAction" method="redirect">
<result type="redirectAction">actionNames</result>
</action>
+4 -4
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-convention-plugin</artifactId>
@@ -11,9 +11,9 @@
<name>Struts 2 Convention Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_7/trunk/struts2-convention-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_7/trunk/struts2-convention-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_7/trunk/struts2-convention-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_8/trunk/struts2-convention-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_8/trunk/struts2-convention-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_8/trunk/struts2-convention-plugin</url>
</scm>
<build>
@@ -65,6 +65,7 @@ import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -80,6 +81,7 @@ import java.util.regex.Pattern;
public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
private static final Logger LOG = LoggerFactory.getLogger(PackageBasedActionConfigBuilder.class);
private static final boolean EXTRACT_BASE_INTERFACES = true;
private final Configuration configuration;
private final ActionNameBuilder actionNameBuilder;
@@ -384,7 +386,8 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
// only considers classes that match the action packages
// specified by the user
Test<String> classPackageTest = getClassPackageTest();
ClassFinder finder = new ClassFinder(getClassLoaderInterface(), buildUrlSet().getUrls(), true, this.fileProtocols, classPackageTest);
List<URL> urls = readUrls();
ClassFinder finder = new ClassFinder(getClassLoaderInterface(), urls, EXTRACT_BASE_INTERFACES, fileProtocols, classPackageTest);
Test<ClassFinder.ClassInfo> test = getActionClassTest();
classes.addAll(finder.findClasses(test));
@@ -397,9 +400,19 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
return classes;
}
private List<URL> readUrls() throws IOException {
List<URL> list = buildUrlSet().getUrls();
// Usually the "classes" dir.
ArrayList<URL> classesList = Collections.list(getClassLoaderInterface().getResources(""));
for (URL url : classesList) {
list.addAll(fileManager.getAllPhysicalUrls(url));
}
return list;
}
private UrlSet buildUrlSet() throws IOException {
ClassLoaderInterface classLoaderInterface = getClassLoaderInterface();
UrlSet urlSet = new UrlSet(fileManager, classLoaderInterface, this.fileProtocols);
UrlSet urlSet = new UrlSet(classLoaderInterface, this.fileProtocols);
//excluding the urls found by the parent class loader is desired, but fails in JBoss (all urls are removed)
if (excludeParentClassLoader) {
@@ -425,7 +438,11 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
}
//try to find classes dirs inside war files
urlSet = urlSet.includeClassesUrl(classLoaderInterface);
urlSet = urlSet.includeClassesUrl(classLoaderInterface, new UrlSet.FileProtocolNormalizer() {
public URL normalizeToFileProtocol(URL url) {
return fileManager.normalizeToFileProtocol(url);
}
});
urlSet = urlSet.excludeJavaExtDirs();
@@ -472,7 +489,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
}
}
}
return new UrlSet(fileManager, includeUrls);
return new UrlSet(includeUrls);
}
return urlSet;
+4 -4
View File
@@ -25,7 +25,7 @@
<parent>
<artifactId>struts2-plugins</artifactId>
<groupId>org.apache.struts</groupId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.struts</groupId>
@@ -33,9 +33,9 @@
<name>Struts 2 Dojo Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/dojo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/dojo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/dojo</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/dojo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/dojo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/dojo</url>
</scm>
<profiles>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-dwr-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 DWR Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/dwr</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/dwr</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/dwr</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/dwr</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/dwr</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/dwr</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
@@ -35,9 +35,9 @@
<name>Struts 2 Embedded JSP Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/embeddedjsp</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/embeddedjsp</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/embeddedjsp</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/embeddedjsp</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/embeddedjsp</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/embeddedjsp</url>
</scm>
<dependencies>
@@ -184,7 +184,7 @@ public class JSPLoader {
//find available jars
ClassLoaderInterface classLoaderInterface = getClassLoaderInterface();
UrlSet urlSet = new UrlSet(fileManager, classLoaderInterface);
UrlSet urlSet = new UrlSet(classLoaderInterface);
//find jars
List<URL> urls = urlSet.getUrls();
+4 -4
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
@@ -13,9 +13,9 @@
<url>http://struts.apache.org</url>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_7/trunk/struts2-gxp-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_7/trunk/struts2-gxp-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_7/trunk/struts2-gxp-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_8/trunk/struts2-gxp-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/sandbox/tags/STRUTS_2_3_8/trunk/struts2-gxp-plugin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/sandbox/tags/STRUTS_2_3_8/trunk/struts2-gxp-plugin</url>
</scm>
<dependencies>
@@ -40,11 +40,11 @@ public class GxpInstance extends Gxp {
private static final Logger logger = Logger.getLogger(GxpInstance.class.getCanonicalName());
private Class<?> gxpInterface;
private Class<?> gxpInstance;
private Class gxpInterface;
private Class gxpInstance;
private ObjectFactory objectFactory;
GxpInstance(Class<?> gxpClass) {
GxpInstance(Class gxpClass) {
super(gxpClass,
lookupMethodByName(getNestedClass(gxpClass, "Interface"), "write"),
lookupMethodByName(getNestedClass(gxpClass, "Interface"), "getGxpClosure"));
@@ -52,8 +52,8 @@ public class GxpInstance extends Gxp {
this.gxpInstance = getNestedClass(gxpClass, "Instance");
}
private static Class<?> getNestedClass(Class<?> clazz, String nestedClassName) {
for (Class<?> nested : clazz.getDeclaredClasses()) {
private static Class getNestedClass(Class clazz, String nestedClassName) {
for (Class nested : clazz.getDeclaredClasses()) {
if (nestedClassName.equals(nested.getSimpleName())) {
return nested;
}
@@ -92,9 +92,9 @@ public class GxpInstance extends Gxp {
return this.gxpInterface;
}
private static final Map<Class<?>, GxpInstance> classToGxpInstance = new MapMaker().weakKeys().softValues()
.makeComputingMap(new Function<Class<?>, GxpInstance>() {
public GxpInstance apply(Class<?> from) {
private static final Map<Class, GxpInstance> classToGxpInstance = new MapMaker().weakKeys().softValues()
.makeComputingMap(new Function<Class, GxpInstance>() {
public GxpInstance apply(Class from) {
return classToGxpInstance.containsKey(from) ? classToGxpInstance.get(from) : new GxpInstance(from);
}
});
@@ -126,7 +126,7 @@ public class GxpInstance extends Gxp {
/**
* Looks up {@code GxpInstance} instance for the given GXP class.
*/
public static GxpInstance getInstance(Class<?> gxpClass) {
public static GxpInstance getInstance(Class gxpClass) {
return classToGxpInstance.get(gxpClass);
}
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jasperreports-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Jasper Reports Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/jasperreports</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/jasperreports</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/jasperreports</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/jasperreports</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/jasperreports</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/jasperreports</url>
</scm>
<dependencies>
+4 -4
View File
@@ -25,7 +25,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-javatemplates-plugin</artifactId>
@@ -33,9 +33,9 @@
<name>Struts 2 Java Templates Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/javatemplates</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/javatemplates</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/javatemplates</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/javatemplates</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/javatemplates</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/javatemplates</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jfreechart-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 JFreeChart Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/jfreechart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/jfreechart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/jfreechart</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/jfreechart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/jfreechart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/jfreechart</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jsf-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 JSF Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/jsf</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/jsf</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/jsf</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/jsf</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/jsf</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/jsf</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-json-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 JSON Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/json</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/json</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/json</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/json</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/json</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/json</url>
</scm>
<build>
@@ -65,6 +65,7 @@ public class JSONResult implements Result {
private static final Logger LOG = LoggerFactory.getLogger(JSONResult.class);
private String encoding;
private String defaultEncoding = "ISO-8859-1";
private List<Pattern> includeProperties;
private List<Pattern> excludeProperties;
@@ -217,10 +218,14 @@ public class JSONResult implements Result {
* Retrieve the encoding <p/>
*
* @return The encoding associated with this template (defaults to the value
* of 'struts.i18n.encoding' property)
* of param 'encoding', if empty default to 'struts.i18n.encoding' property)
*/
protected String getEncoding() {
String encoding = this.defaultEncoding;
String encoding = this.encoding;
if (encoding == null) {
encoding = this.defaultEncoding;
}
if (encoding == null) {
encoding = System.getProperty("file.encoding");
@@ -421,4 +426,16 @@ public class JSONResult implements Result {
public void setWrapSuffix(String wrapSuffix) {
this.wrapSuffix = wrapSuffix;
}
/**
* If defined will be used instead of {@link #defaultEncoding}, you can define it with result
* &lt;result name=&quot;success&quot; type=&quot;json&quot;&gt;
* &lt;param name=&quot;encoding&quot;&gt;UTF-8&lt;/param&gt;
* &lt;/result&gt;
*
* @param encoding valid encoding string
*/
public void setEncoding(String encoding) {
this.encoding = encoding;
}
}
@@ -20,6 +20,16 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.StrutsTestCase;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
@@ -34,18 +44,6 @@ import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.StrutsTestCase;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import org.springframework.mock.web.MockServletContext;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
/**
* JSONResultTest
*/
@@ -573,6 +571,31 @@ public class JSONResultTest extends StrutsTestCase {
assertEquals("application/json;charset=ISO-8859-1", response.getContentType());
}
public void testDefaultEncoding() throws Exception {
// given
JSONResult json = new JSONResult();
json.setDefaultEncoding("UTF-16");
// when
String encoding = json.getEncoding();
// thn
assertEquals("UTF-16", encoding);
}
public void testEncoding() throws Exception {
// given
JSONResult json = new JSONResult();
json.setEncoding("UTF-8");
json.setDefaultEncoding("UTF-8");
// when
String encoding = json.getEncoding();
// thn
assertEquals("UTF-8", encoding);
}
@Override
protected void setUp() throws Exception {
super.setUp();
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-junit-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 JUnit Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/junit</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/junit</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/junit</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/junit</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/junit</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/junit</url>
</scm>
<dependencies>
@@ -21,10 +21,16 @@
package org.apache.struts2;
import com.opensymphony.xwork2.ActionSupport;
import org.springframework.beans.factory.annotation.Autowired;
public class JUnitTestAction extends ActionSupport {
private static final long serialVersionUID = 1629266238339053546L;
private String name;
@Autowired
private MySessionBean mySessionBean;
public String getName() {
return name;
}
@@ -0,0 +1,28 @@
/*
* $Id:$
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2;
public class MySessionBean {
public void doSomething() {
// do Something
}
}
@@ -1,6 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ $Id:$
~
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
<property name="scopes">
<map>
<entry key="session">
<bean class="org.springframework.context.support.SimpleThreadScope"/>
</entry>
</map>
</property>
</bean>
<bean id="testAction" class="org.apache.struts2.JUnitTestAction"/>
<bean id="mySessionBean" class="org.apache.struts2.MySessionBean" scope="session" />
</beans>
+20 -1
View File
@@ -1,5 +1,24 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ $Id:$
~
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
"http://struts.apache.org/dtds/struts-2.1.dtd">
@@ -1 +1,21 @@
<#--
~ $Id:$
~
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
Hello
@@ -1 +1,21 @@
<#--
~ $Id:$
~
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
Test-2
@@ -1 +1,21 @@
<#--
~ $Id:$
~
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
Test2
+4 -18
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-plugin</artifactId>
@@ -12,9 +12,9 @@
<name>Struts 2 OSGi Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/osgi</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/osgi</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/osgi</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/osgi</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/osgi</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/osgi</url>
</scm>
<dependencies>
@@ -32,20 +32,6 @@
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-oval-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 OVal Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/oval</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/oval</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/oval</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/oval</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/oval</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/oval</url>
</scm>
<dependencies>
@@ -10,6 +10,7 @@ import net.sf.oval.configuration.Configurer;
import net.sf.oval.configuration.annotation.AnnotationsConfigurer;
import net.sf.oval.configuration.annotation.JPAAnnotationsConfigurer;
import net.sf.oval.configuration.xml.XMLConfigurer;
import org.apache.struts2.StrutsConstants;
import java.net.URL;
import java.util.ArrayList;
@@ -29,8 +30,14 @@ public class DefaultOValValidationManager implements OValValidationManager {
protected boolean validateJPAAnnotations;
private boolean reloadConfigs;
private FileManager fileManager;
@Inject(value = StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, required = false)
public void setReloadingConfigs(String reloadingConfigs) {
this.reloadConfigs = Boolean.parseBoolean(reloadingConfigs);
}
@Inject
public void setFileManagerFactory(FileManagerFactory fileManagerFactory) {
this.fileManager = fileManagerFactory.getFileManager();
@@ -41,7 +48,7 @@ public class DefaultOValValidationManager implements OValValidationManager {
final String validatorKey = buildValidatorKey(clazz, context);
if (validatorCache.containsKey(validatorKey)) {
if (fileManager.isReloadingConfigs()) {
if (reloadConfigs) {
List<Configurer> configurers = buildXMLConfigurers(clazz, context, true, null);
//add an annotation configurer
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-pell-multipart-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Pell Multipart Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/pell-multipart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/pell-multipart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/pell-multipart</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/pell-multipart</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/pell-multipart</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/pell-multipart</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plexus-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Plexus Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/plexus</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/plexus</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/plexus</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/plexus</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/plexus</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/plexus</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
@@ -34,9 +34,9 @@
<name>Struts Plugins</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins</url>
</scm>
<modules>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet-tiles-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Portlet Tiles Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/portlet-tiles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/portlet-tiles</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/portlet-tiles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/portlet-tiles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/portlet-tiles</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/portlet-tiles</url>
</scm>
<dependencies>
+4 -4
View File
@@ -3,7 +3,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet-plugin</artifactId>
@@ -11,9 +11,9 @@
<name>Struts 2 Portlet Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/portlet</url>
</scm>
<dependencies>
+2 -2
View File
@@ -26,11 +26,11 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-plugin</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<name>Struts 2 REST Plugin</name>
<properties>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitegraph-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Sitegraph Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/sitegraph</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/sitegraph</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/sitegraph</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/sitegraph</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/sitegraph</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/sitegraph</url>
</scm>
<build>
@@ -24,7 +24,8 @@ package org.apache.struts2.sitegraph.entities;
/**
*/
public class Target {
public class Target implements Comparable<Target> {
private String target;
private int type;
@@ -59,4 +60,13 @@ public class Target {
result = 29 * result + type;
return result;
}
public int compareTo(Target o) {
if (o.target != null && target != null) {
return o.target.compareTo(target);
} else {
return 0;
}
}
}
+4 -17
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-sitemesh-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Sitemesh Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/sitemesh</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/sitemesh</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/sitemesh</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/sitemesh</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/sitemesh</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/sitemesh</url>
</scm>
<dependencies>
@@ -49,27 +49,14 @@
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.6.3</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>1.3</version>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
</exclusion>
<exclusion>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-spring-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Spring Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/spring</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/spring</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/spring</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/spring</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/spring</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/spring</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-struts1-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Struts 1 Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/struts1</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/struts1</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/struts1</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/struts1</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/struts1</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/struts1</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-testng-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 TestNG Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/testng</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/testng</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/testng</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/testng</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/testng</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/testng</url>
</scm>
<dependencies>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-plugins</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-tiles-plugin</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Tiles Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/tiles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/plugins/tiles</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/plugins/tiles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/tiles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/plugins/tiles</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8/plugins/tiles</url>
</scm>
<dependencies>
@@ -77,7 +77,7 @@ public class StrutsTilesRequestContext extends TilesRequestContextWrapper {
}
public void dispatch(String include) throws IOException {
if (include.endsWith(mask) || include.endsWith(".jsp")) {
if (include.endsWith(mask)) {
// FIXME This way FreeMarker results still don't have a content-type!
include(include);
} else {
+11 -7
View File
@@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<packaging>pom</packaging>
<name>Struts 2</name>
<url>http://struts.apache.org/2.x/</url>
@@ -29,9 +29,9 @@
-->
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_8</url>
</scm>
<issueManagement>
@@ -55,7 +55,7 @@
<distributionManagement>
<site>
<id>apache-site</id>
<url>scp://people.apache.org/www/struts.apache.org/2.3.7/</url>
<url>scp://people.apache.org/www/struts.apache.org/2.3.8/</url>
</site>
</distributionManagement>
@@ -85,7 +85,7 @@
<properties>
<currentVersion>${project.version}</currentVersion>
<struts2.springPlatformVersion>3.0.5.RELEASE</struts2.springPlatformVersion>
<ognl.version>3.0.5</ognl.version>
<ognl.version>3.0.6</ognl.version>
<asm.version>3.3</asm.version>
<tiles.version>2.0.6</tiles.version>
</properties>
@@ -379,7 +379,7 @@
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.6.3</version>
<version>1.6.4</version>
<optional>true</optional>
</dependency>
@@ -388,6 +388,10 @@
<artifactId>velocity-tools</artifactId>
<version>1.3</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
+6 -6
View File
@@ -7,42 +7,42 @@
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-blank</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Blank</description>
</archetype>
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-convention</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Blank Convention</description>
</archetype>
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-dbportlet</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Database Portlet</description>
</archetype>
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-plugin</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Plugin</description>
</archetype>
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-portlet</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Portlet</description>
</archetype>
<archetype>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetype-starter</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
<repository>http://repo1.maven.org/maven2/</repository>
<description>Struts 2 Archetypes - Starter</description>
</archetype>
+4 -4
View File
@@ -5,7 +5,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.8</version>
</parent>
<groupId>org.apache.struts.xwork</groupId>
@@ -15,9 +15,9 @@
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/xwork-core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/xwork-core</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/xwork-core</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/xwork-core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/xwork-core</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_8/xwork-core</url>
</scm>
<properties>
@@ -17,10 +17,8 @@ public interface FileManager {
*/
void setReloadingConfigs(boolean reloadingConfigs);
boolean isReloadingConfigs();
/**
* Checks if given file changed and must be reloaded if {@link #isReloadingConfigs()} is true
* Checks if given file changed and must be reloaded if {@link #setReloadingConfigs(boolean)} is true
*
* @param fileName to check
* @return true if file changed
@@ -45,7 +43,7 @@ public interface FileManager {
InputStream loadFile(URL fileUrl);
/**
* Adds file to list of monitored files if {@link #isReloadingConfigs()} is true
* Adds file to list of monitored files if {@link #setReloadingConfigs(boolean)} is true
*
* @param fileUrl {@link URL} to file to be monitored
*/
@@ -15,8 +15,7 @@
*/
package com.opensymphony.xwork2.config;
import com.opensymphony.xwork2.FileManager;
import com.opensymphony.xwork2.FileManagerFactory;
import com.opensymphony.xwork2.XWorkConstants;
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
@@ -173,8 +172,8 @@ public class ConfigurationManager {
* @param container current container used to obtain instance of {@link com.opensymphony.xwork2.util.fs.DefaultFileManager}
*/
public synchronized void conditionalReload(Container container) {
FileManager fileManager = container.getInstance(FileManagerFactory.class).getFileManager();
if (fileManager.isReloadingConfigs() || providersChanged) {
boolean reloadConfigs = Boolean.parseBoolean(container.getInstance(String.class, XWorkConstants.RELOAD_XML_CONFIGURATION));
if (reloadConfigs || providersChanged) {
if (LOG.isDebugEnabled()) {
LOG.debug("Checking ConfigurationProviders for reload.");
}
@@ -19,6 +19,7 @@ import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.FileManager;
import com.opensymphony.xwork2.FileManagerFactory;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.XWorkConstants;
import com.opensymphony.xwork2.XWorkMessages;
import com.opensymphony.xwork2.XWorkException;
import com.opensymphony.xwork2.conversion.TypeConverter;
@@ -184,6 +185,7 @@ public class XWorkConverter extends DefaultTypeConverter {
private TypeConverter defaultTypeConverter;
private ObjectFactory objectFactory;
private FileManager fileManager;
private boolean reloadingConfigs;
protected XWorkConverter() {
}
@@ -207,6 +209,11 @@ public class XWorkConverter extends DefaultTypeConverter {
this.fileManager = fileManagerFactory.getFileManager();
}
@Inject(value = XWorkConstants.RELOAD_XML_CONFIGURATION, required = false)
public void setReloadingConfigs(String reloadingConfigs) {
this.reloadingConfigs = Boolean.parseBoolean(reloadingConfigs);
}
public static String getConversionErrorMessage(String propertyName, ValueStack stack) {
String defaultMessage = LocalizedTextUtil.findDefaultText(XWorkMessages.DEFAULT_INVALID_FIELDVALUE,
ActionContext.getContext().getLocale(),
@@ -744,7 +751,7 @@ public class XWorkConverter extends DefaultTypeConverter {
private Map<String, Object> conditionalReload(Class clazz, Map<String, Object> oldValues) throws Exception {
Map<String, Object> mapping = oldValues;
if (fileManager.isReloadingConfigs()) {
if (reloadingConfigs) {
URL fileUrl = ClassLoaderUtil.getResource(buildConverterFilename(clazz), clazz);
if (fileManager.fileNeedsReloading(fileUrl.toString())) {
mapping = buildConverterMapping(clazz);
@@ -411,11 +411,12 @@ public class ParametersInterceptor extends MethodFilterInterceptor {
for (Pattern pattern : excludeParams) {
Matcher matcher = pattern.matcher(paramName);
if (matcher.matches()) {
notifyDeveloper("Parameter [#0] is on the excludeParams list of patterns!", paramName);
return true;
}
}
}
notifyDeveloper("Parameter [#0] is on the excludeParams list of patterns!", paramName);
notifyDeveloper("Parameter [#0] is not on the excludeParams list of patterns and will be appended to action!", paramName);
return false;
}
@@ -15,7 +15,6 @@
*/
package com.opensymphony.xwork2.util.finder;
import com.opensymphony.xwork2.FileManager;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.commons.lang3.ObjectUtils;
@@ -26,6 +25,7 @@ import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
@@ -50,40 +50,41 @@ import java.util.Set;
* @version $Rev$ $Date$
*/
public class UrlSet {
private static final Logger LOG = LoggerFactory.getLogger(UrlSet.class);
private final Map<String,URL> urls;
private Set<String> protocols;
private FileManager fileManager;
public UrlSet(FileManager fileManager, ClassLoaderInterface classLoader) throws IOException {
this(fileManager);
private UrlSet() {
this.urls = new HashMap<String,URL>();
}
public UrlSet(ClassLoaderInterface classLoader) throws IOException {
this();
load(getUrls(classLoader));
}
public UrlSet(FileManager fileManager, ClassLoaderInterface classLoader, Set<String> protocols) throws IOException {
this(fileManager);
public UrlSet(ClassLoaderInterface classLoader, Set<String> protocols) throws IOException {
this();
this.protocols = protocols;
this.fileManager = fileManager;
load(getUrls(classLoader, protocols));
}
public UrlSet(URL... urls){
this(Arrays.asList(urls));
}
/**
* Ignores all URLs that are not "jar" or "file"
* @param urls
*/
public UrlSet(FileManager fileManager, Collection<URL> urls){
this(fileManager);
public UrlSet(Collection<URL> urls){
this();
load(urls);
}
private UrlSet(FileManager fileManager) {
this.urls = new HashMap<String,URL>();
this.fileManager = fileManager;
}
private UrlSet(FileManager fileManager, Map<String, URL> urls) {
private UrlSet(Map<String, URL> urls) {
this.urls = urls;
this.fileManager = fileManager;
}
private void load(Collection<URL> urls){
@@ -91,7 +92,9 @@ public class UrlSet {
try {
this.urls.put(location.toExternalForm(), location);
} catch (Exception e) {
e.printStackTrace();
if (LOG.isWarnEnabled()) {
LOG.warn("Cannot translate url to external form!", e);
}
}
}
}
@@ -99,7 +102,7 @@ public class UrlSet {
public UrlSet include(UrlSet urlSet){
Map<String, URL> urls = new HashMap<String, URL>(this.urls);
urls.putAll(urlSet.urls);
return new UrlSet(fileManager, urls);
return new UrlSet(urls);
}
public UrlSet exclude(UrlSet urlSet) {
@@ -108,11 +111,11 @@ public class UrlSet {
for (String url : parentUrls.keySet()) {
urls.remove(url);
}
return new UrlSet(fileManager, urls);
return new UrlSet(urls);
}
public UrlSet exclude(ClassLoaderInterface parent) throws IOException {
return exclude(new UrlSet(fileManager, parent, this.protocols));
return exclude(new UrlSet(parent, this.protocols));
}
public UrlSet exclude(File file) throws MalformedURLException {
@@ -177,13 +180,13 @@ public class UrlSet {
urls.put(url, entry.getValue());
}
}
return new UrlSet(fileManager, urls);
return new UrlSet(urls);
}
/**
* Try to find a classes directory inside a war file add its normalized url to this set
*/
public UrlSet includeClassesUrl(ClassLoaderInterface classLoaderInterface) throws IOException {
public UrlSet includeClassesUrl(ClassLoaderInterface classLoaderInterface, FileProtocolNormalizer normalizer) throws IOException {
Enumeration<URL> rootUrlEnumeration = classLoaderInterface.getResources("");
while (rootUrlEnumeration.hasMoreElements()) {
URL url = rootUrlEnumeration.nextElement();
@@ -192,14 +195,14 @@ public class UrlSet {
//if it is inside a war file, get the url to the file
externalForm = StringUtils.substringBefore(externalForm, "/WEB-INF/classes");
URL warUrl = new URL(externalForm);
URL normalizedUrl = fileManager.normalizeToFileProtocol(warUrl);
URL normalizedUrl = normalizer.normalizeToFileProtocol(warUrl);
URL finalUrl = ObjectUtils.defaultIfNull(normalizedUrl, warUrl);
Map<String, URL> newUrls = new HashMap<String, URL>(this.urls);
if ("jar".equals(finalUrl.getProtocol()) || "file".equals(finalUrl.getProtocol())) {
newUrls.put(finalUrl.toExternalForm(), finalUrl);
}
return new UrlSet(fileManager, newUrls);
return new UrlSet(newUrls);
}
}
@@ -207,7 +210,7 @@ public class UrlSet {
}
public UrlSet relative(File file) throws MalformedURLException {
String urlPath = file.toURL().toExternalForm();
String urlPath = file.toURI().toURL().toExternalForm();
Map<String, URL> urls = new HashMap<String, URL>();
for (Map.Entry<String, URL> entry : this.urls.entrySet()) {
String url = entry.getKey();
@@ -215,7 +218,7 @@ public class UrlSet {
urls.put(url, entry.getValue());
}
}
return new UrlSet(fileManager, urls);
return new UrlSet(urls);
}
public List<URL> getUrls() {
@@ -265,14 +268,13 @@ public class UrlSet {
LOG.debug("Ignoring URL [#0] because it is not a valid protocol", url.toExternalForm());
}
// Usually the "classes" dir.
ArrayList<URL> classesList = Collections.list(classLoader.getResources(""));
for (URL url : classesList) {
list.addAll(fileManager.getAllPhysicalUrls(url));
}
return list;
}
public static interface FileProtocolNormalizer {
URL normalizeToFileProtocol(URL url);
}
}
@@ -52,10 +52,6 @@ public class DefaultFileManager implements FileManager {
this.reloadingConfigs = reloadingConfigs;
}
public boolean isReloadingConfigs() {
return reloadingConfigs;
}
public boolean fileNeedsReloading(URL fileUrl) {
return fileUrl != null && fileNeedsReloading(fileUrl.toString());
}
@@ -19,12 +19,12 @@ public class DefaultFileManagerFactory implements FileManagerFactory {
private static final Logger LOG = LoggerFactory.getLogger(DefaultFileManagerFactory.class);
private boolean reloadingConfigs;
private FileManager fileManager;
private FileManager systemFileManager;
private Container container;
@Inject(value = "system")
public void setFileManager(FileManager fileManager) {
this.fileManager = fileManager;
this.systemFileManager = fileManager;
}
@Inject
@@ -38,6 +38,22 @@ public class DefaultFileManagerFactory implements FileManagerFactory {
}
public FileManager getFileManager() {
FileManager fileManager = lookupFileManager();
if (fileManager != null) {
if (LOG.isDebugEnabled()) {
LOG.debug("Using FileManager implementation [#0]", fileManager.getClass().getSimpleName());
}
fileManager.setReloadingConfigs(reloadingConfigs);
return fileManager;
}
if (LOG.isDebugEnabled()) {
LOG.debug("Using default implementation of FileManager provided under name [system]: #0", systemFileManager.getClass().getSimpleName());
}
systemFileManager.setReloadingConfigs(reloadingConfigs);
return systemFileManager;
}
private FileManager lookupFileManager() {
Set<String> names = container.getInstanceNames(FileManager.class);
if (LOG.isDebugEnabled()) {
LOG.debug("Found following implementations of FileManager interface: #0", names.toString());
@@ -57,7 +73,6 @@ public class DefaultFileManagerFactory implements FileManagerFactory {
if (LOG.isDebugEnabled()) {
LOG.debug("Using FileManager implementation [#0]", fm.getClass().getSimpleName());
}
fm.setReloadingConfigs(reloadingConfigs);
return fm;
}
}
@@ -69,11 +84,7 @@ public class DefaultFileManagerFactory implements FileManagerFactory {
return fm;
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("Using default implementation of FileManager provided under name [system]: #0", fileManager.getClass().getSimpleName());
}
fileManager.setReloadingConfigs(reloadingConfigs);
return fileManager;
return null;
}
}
@@ -21,6 +21,7 @@ import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.FileManager;
import com.opensymphony.xwork2.FileManagerFactory;
import com.opensymphony.xwork2.XWorkConstants;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
@@ -63,6 +64,7 @@ public class AnnotationActionValidatorManager implements ActionValidatorManager
private ValidatorFactory validatorFactory;
private ValidatorFileParser validatorFileParser;
private FileManager fileManager;
private boolean reloadingConfigs;
@Inject
public void setValidatorFactory(ValidatorFactory fac) {
@@ -79,6 +81,11 @@ public class AnnotationActionValidatorManager implements ActionValidatorManager
this.fileManager = fileManagerFactory.getFileManager();
}
@Inject(value = XWorkConstants.RELOAD_XML_CONFIGURATION, required = false)
public void setReloadingConfigs(String reloadingConfigs) {
this.reloadingConfigs = Boolean.parseBoolean(reloadingConfigs);
}
public List<Validator> getValidators(Class clazz, String context) {
return getValidators(clazz, context, null);
}
@@ -88,7 +95,7 @@ public class AnnotationActionValidatorManager implements ActionValidatorManager
final List<ValidatorConfig> cfgs;
if (validatorCache.containsKey(validatorKey)) {
if (fileManager.isReloadingConfigs()) {
if (reloadingConfigs) {
validatorCache.put(validatorKey, buildValidatorConfigs(clazz, context, true, null));
}
} else {
@@ -18,6 +18,7 @@ package com.opensymphony.xwork2.validator;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.FileManager;
import com.opensymphony.xwork2.FileManagerFactory;
import com.opensymphony.xwork2.XWorkConstants;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.ValueStack;
@@ -55,6 +56,7 @@ public class DefaultActionValidatorManager implements ActionValidatorManager {
private ValidatorFactory validatorFactory;
private ValidatorFileParser validatorFileParser;
private FileManager fileManager;
private boolean reloadingConfigs;
@Inject
public void setValidatorFileParser(ValidatorFileParser parser) {
@@ -71,6 +73,11 @@ public class DefaultActionValidatorManager implements ActionValidatorManager {
this.fileManager = fileManagerFactory.getFileManager();
}
@Inject(value = XWorkConstants.RELOAD_XML_CONFIGURATION, required = false)
public void setReloadingConfigs(String reloadingConfigs) {
this.reloadingConfigs = Boolean.parseBoolean(reloadingConfigs);
}
public synchronized List<Validator> getValidators(Class clazz, String context) {
return getValidators(clazz, context, null);
}
@@ -79,7 +86,7 @@ public class DefaultActionValidatorManager implements ActionValidatorManager {
final String validatorKey = buildValidatorKey(clazz, context);
if (validatorCache.containsKey(validatorKey)) {
if (fileManager.isReloadingConfigs()) {
if (reloadingConfigs) {
validatorCache.put(validatorKey, buildValidatorConfigs(clazz, context, true, null));
}
} else {
@@ -1,133 +0,0 @@
/*
* Copyright 2002-2006,2009 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.opensymphony.xwork2.validator.metadata;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* <code>AbstractFieldValidatorDescription</code>
*
* @author Rainer Hermanns
* @version $Id$
*/
public abstract class AbstractFieldValidatorDescription implements ValidatorDescription {
/**
* Jakarta commons-logging reference.
*/
protected static Logger log = null;
public String fieldName;
public String key;
public String message;
public boolean shortCircuit;
public boolean simpleValidator;
public AbstractFieldValidatorDescription() {
log = LoggerFactory.getLogger(this.getClass());
}
/**
* Creates an AbstractFieldValidatorDescription with the specified field name.
*
* @param fieldName
*/
public AbstractFieldValidatorDescription(String fieldName) {
this.fieldName = fieldName;
log = LoggerFactory.getLogger(this.getClass());
}
/**
* Sets the field name for this validator rule.
*
* @return fieldName the field name for this validator rule
*/
public String getFieldName() {
return fieldName;
}
/**
* Sets the field name for this validator rule.
*
* @param fieldName the field name for this validator rule
*/
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
/**
* Sets the I18N message key.
* @param key the I18N message key
*/
public void setKey(String key) {
this.key = key;
}
/**
* Sets the default validator failure message.
*
* @param message the default validator failure message
*/
public void setMessage(String message) {
this.message = message;
}
/**
* Set the shortCircuit flag.
*
* @param shortCircuit the shortCircuit flag.
*/
public void setShortCircuit(boolean shortCircuit) {
this.shortCircuit = shortCircuit;
}
public void setSimpleValidator(boolean simpleValidator) {
this.simpleValidator = simpleValidator;
}
public boolean isSimpleValidator() {
return simpleValidator;
}
/**
* Returns the validator XML definition.
*
* @return the validator XML definition.
*/
public String asXml() {
if ( simpleValidator) {
return asSimpleXml();
}
return asFieldXml();
}
/**
* Returns the field validator XML definition.
*
* @return the field validator XML definition.
*/
public abstract String asFieldXml();
/**
* Returns the validator XML definition.
*
* @return the validator XML definition.
*/
public abstract String asSimpleXml();
}
@@ -1,118 +0,0 @@
/*
* Copyright 2002-2006,2009 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.opensymphony.xwork2.validator.metadata;
import java.io.PrintWriter;
import java.io.StringWriter;
/**
* <code>ConversionErrorFieldValidatorDescription</code>
*
* @author Rainer Hermanns
* @version $Id$
*/
public class ConversionErrorFieldValidatorDescription extends AbstractFieldValidatorDescription {
public ConversionErrorFieldValidatorDescription() {
super();
}
/**
* Creates an AbstractFieldValidatorDescription with the specified field name.
*
* @param fieldName
*/
public ConversionErrorFieldValidatorDescription(String fieldName) {
super(fieldName);
}
/**
* Returns the field validator XML definition.
*
* @return the field validator XML definition.
*/
@Override
public String asFieldXml() {
StringWriter sw = new StringWriter();
PrintWriter writer = null;
try {
writer = new PrintWriter(sw);
if (shortCircuit) {
writer.println("\t\t<field-validator type=\"conversion\">");
} else {
writer.println("\t\t<field-validator type=\"conversion\" short-circuit=\"true\">");
}
if (!"".equals(key)) {
writer.println("\t\t\t<message key=\"" + key + "\">" + message + "</message>");
} else {
writer.println("\t\t\t<message>" + message + "</message>");
}
writer.println("\t\t</field-validator>");
} finally {
if (writer != null) {
writer.flush();
writer.close();
}
}
return sw.toString();
}
/**
* Returns the validator XML definition.
*
* @return the validator XML definition.
*/
@Override
public String asSimpleXml() {
StringWriter sw = new StringWriter();
PrintWriter writer = null;
try {
writer = new PrintWriter(sw);
if (shortCircuit) {
writer.println("\t<validator type=\"conversion\">");
} else {
writer.println("\t<validator type=\"conversion\" short-circuit=\"true\">");
}
writer.println("\t\t<param name=\"fieldName\">" + fieldName + "</param>");
if (!"".equals(key)) {
writer.println("\t\t<message key=\"" + key + "\">" + message + "</message>");
} else {
writer.println("\t\t<message>" + message + "</message>");
}
writer.println("\t</validator>");
} finally {
if (writer != null) {
writer.flush();
writer.close();
}
}
return sw.toString();
}
}
@@ -1,140 +0,0 @@
/*
* Copyright 2002-2006,2009 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.opensymphony.xwork2.validator.metadata;
import java.io.PrintWriter;
import java.io.StringWriter;
/**
* <code>DateRangeFieldValidatorDescription</code>
*
* @author Rainer Hermanns
* @version $Id$
*/
public class DateRangeFieldValidatorDescription extends AbstractFieldValidatorDescription {
public String min;
public String max;
public DateRangeFieldValidatorDescription() {
}
/**
* Creates an AbstractFieldValidatorDescription with the specified field name.
*
* @param fieldName
*/
public DateRangeFieldValidatorDescription(String fieldName) {
super(fieldName);
}
public void setMin(String min) {
this.min = min;
}
public void setMax(String max) {
this.max = max;
}
/**
* Returns the field validator XML definition.
*
* @return the field validator XML definition.
*/
@Override
public String asFieldXml() {
StringWriter sw = new StringWriter();
PrintWriter writer = null;
try {
writer = new PrintWriter(sw);
if ( shortCircuit) {
writer.println("\t\t<field-validator type=\"date\">");
} else {
writer.println("\t\t<field-validator type=\"date\" short-circuit=\"true\">");
}
if ( min != null && min.length() > 0) {
writer.println("\t\t\t<param name=\"min\">" + min + "</param>");
}
if ( max != null && max.length() > 0) {
writer.println("\t\t\t<param name=\"max\">" + max + "</param>");
}
if ( !"".equals(key)) {
writer.println("\t\t\t<message key=\"" + key + "\">" + message + "</message>");
} else {
writer.println("\t\t\t<message>" + message + "</message>");
}
writer.println("\t\t</field-validator>");
} finally {
if (writer != null) {
writer.flush();
writer.close();
}
}
return sw.toString();
}
/**
* Returns the validator XML definition.
*
* @return the validator XML definition.
*/
@Override
public String asSimpleXml() {
StringWriter sw = new StringWriter();
PrintWriter writer = null;
try {
writer = new PrintWriter(sw);
if ( shortCircuit) {
writer.println("\t<validator type=\"date\">");
} else {
writer.println("\t<validator type=\"date\" short-circuit=\"true\">");
}
writer.println("\t\t<param name=\"fieldName\">" + fieldName+ "</param>");
if ( min != null && min.length() > 0) {
writer.println("\t\t<param name=\"min\">" + min + "</param>");
}
if ( max != null && max.length() > 0) {
writer.println("\t\t<param name=\"max\">" + max + "</param>");
}
if ( !"".equals(key)) {
writer.println("\t\t<message key=\"" + key + "\">" + message + "</message>");
} else {
writer.println("\t\t<message>" + message + "</message>");
}
writer.println("\t</validator>");
} finally {
if (writer != null) {
writer.flush();
writer.close();
}
}
return sw.toString();
}
}
@@ -1,142 +0,0 @@
/*
* Copyright 2002-2006,2009 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.opensymphony.xwork2.validator.metadata;
import java.io.PrintWriter;
import java.io.StringWriter;
/**
* <code>DoubleRangeFieldValidatorDescription</code>
*
* @author <a href="mailto:hermanns@aixcept.de">Rainer Hermanns</a>
* @version $Id$
*/
public class DoubleRangeFieldValidatorDescription extends AbstractFieldValidatorDescription {
public String min;
public String max;
public DoubleRangeFieldValidatorDescription() {
}
/**
* Creates an DoubleRangeFieldValidatorDescription with the specified field name.
*
* @param fieldName
*/
public DoubleRangeFieldValidatorDescription(String fieldName) {
super(fieldName);
}
public void setMin(String min) {
this.min = min;
}
public void setMax(String max) {
this.max = max;
}
/**
* Returns the field validator XML definition.
*
* @return the field validator XML definition.
*/
@Override
public String asFieldXml() {
StringWriter sw = new StringWriter();
PrintWriter writer = null;
try {
writer = new PrintWriter(sw);
if ( shortCircuit) {
writer.println("\t\t<field-validator type=\"double\">");
} else {
writer.println("\t\t<field-validator type=\"double\" short-circuit=\"true\">");
}
if ( min != null && min.length() > 0) {
writer.println("\t\t\t<param name=\"min\">" + min + "</param>");
}
if ( max != null && max.length() > 0) {
writer.println("\t\t\t<param name=\"max\">" + max + "</param>");
}
if ( !"".equals(key)) {
writer.println("\t\t\t<message key=\"" + key + "\">" + message + "</message>");
} else {
writer.println("\t\t\t<message>" + message + "</message>");
}
writer.println("\t\t</field-validator>");
} finally {
if (writer != null) {
writer.flush();
writer.close();
}
}
return sw.toString();
}
/**
* Returns the validator XML definition.
*
* @return the validator XML definition.
*/
@Override
public String asSimpleXml() {
StringWriter sw = new StringWriter();
PrintWriter writer = null;
try {
writer = new PrintWriter(sw);
if ( shortCircuit) {
writer.println("\t<validator type=\"double\">");
} else {
writer.println("\t<validator type=\"double\" short-circuit=\"true\">");
}
writer.println("\t\t<param name=\"fieldName\">" + fieldName+ "</param>");
if ( min != null && min.length() > 0) {
writer.println("\t\t<param name=\"min\">" + min + "</param>");
}
if ( max != null && max.length() > 0) {
writer.println("\t\t<param name=\"max\">" + max + "</param>");
}
if ( !"".equals(key)) {
writer.println("\t\t<message key=\"" + key + "\">" + message + "</message>");
} else {
writer.println("\t\t<message>" + message + "</message>");
}
writer.println("\t</validator>");
} finally {
if (writer != null) {
writer.flush();
writer.close();
}
}
return sw.toString();
}
}

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