mirror of
https://github.com/apache/struts.git
synced 2026-08-08 08:07:17 +00:00
Compare commits
223 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f0c159d871 | |||
| 859ff1af30 | |||
| 394470e190 | |||
| 8b2df4e019 | |||
| ea96d18d0f | |||
| 978afa48eb | |||
| 61da6900d9 | |||
| fed4f8e8a4 | |||
| d7804297e3 | |||
| 486b1479ae | |||
| 732472bd6e | |||
| 3acccdecca | |||
| abe07c22c2 | |||
| 8e0c17e607 | |||
| 535b610848 | |||
| 1f030bfde0 | |||
| dfa3073690 | |||
| 038ddb4663 | |||
| f152e7fa70 | |||
| 7e6f641ebb | |||
| 9fbb0d92b9 | |||
| 9df00b0a86 | |||
| 07fca85b08 | |||
| a1e8c628f5 | |||
| 3d19149866 | |||
| d1635c5c9e | |||
| 4eee1f4747 | |||
| e5a217a891 | |||
| 90cd4fc717 | |||
| aa991b14b0 | |||
| b9ebe65738 | |||
| 3bf95951bc | |||
| 3ae920e5a3 | |||
| 00ce58a3d6 | |||
| 8ca0e87d35 | |||
| 01fd6750a0 | |||
| f7594cf03f | |||
| 8c7db9d2b0 | |||
| 359bcdbe48 | |||
| 2c13925b49 | |||
| 6e33b77ad8 | |||
| 1815a9925b | |||
| 48394634f5 | |||
| eaa423dc71 | |||
| b4f49eed47 | |||
| fc7ee40bd6 | |||
| cee2b773b1 | |||
| 6b98b9d33d | |||
| aaa27dc380 | |||
| e091eb41f3 | |||
| b56b9b9ff4 | |||
| f1a2affae1 | |||
| b68257de96 | |||
| 878d7e55cb | |||
| cff4d773b4 | |||
| 4460ddae65 | |||
| 9122aff601 | |||
| a4eb0803dc | |||
| 34a10bae06 | |||
| 8a4c6f9376 | |||
| 62d20e0302 | |||
| 80df6b3065 | |||
| c20ed48c44 | |||
| ae90857f11 | |||
| eb988a4b15 | |||
| 7e61564f82 | |||
| 07c8e20161 | |||
| 762cc86714 | |||
| 42d24e190f | |||
| 16fade2857 | |||
| 9d10ca7a9b | |||
| c66877c460 | |||
| 34af1cd8a2 | |||
| da6fa05ed9 | |||
| 0de4b61ff2 | |||
| 41eb4c2444 | |||
| 9220708b59 | |||
| d89ac943b4 | |||
| 8daf1db8d9 | |||
| 8cefc26601 | |||
| df8f62bb50 | |||
| 890e62bcf8 | |||
| fb161f5535 | |||
| fe36e8bf08 | |||
| 66e95042ec | |||
| 9d20642ccc | |||
| 94c0a6cfdf | |||
| 1c55798977 | |||
| e6e1976f39 | |||
| 44615af72b | |||
| 0aefd0a8c1 | |||
| feafa63d71 | |||
| fc57c2c242 | |||
| 0c00c11d0b | |||
| a34bb460f5 | |||
| 77d51c4222 | |||
| 2e19fc6670 | |||
| 98ec0ea1bb | |||
| 8a8c193fde | |||
| 596858143f | |||
| 97ae65c7a3 | |||
| 504c86ead7 | |||
| 12afffe7c3 | |||
| f852cacfee | |||
| c9f2977902 | |||
| 6493648cc1 | |||
| 30bc4bacc0 | |||
| 7fe363aee4 | |||
| 2d7564c05b | |||
| ebc33bc718 | |||
| 3f1f9a133b | |||
| 7010dd2f56 | |||
| 4f98e9148d | |||
| 2d91d4598f | |||
| bacefffda4 | |||
| e1da75d1bc | |||
| aba3b61670 | |||
| 62ee2636af | |||
| 9b951fcd73 | |||
| 96c99ce061 | |||
| 32ea57d925 | |||
| 186d2c1346 | |||
| 6d5c38bea2 | |||
| 02dbb86205 | |||
| bbdaff9c0a | |||
| c4bc382de5 | |||
| 85cfb8ba76 | |||
| adf10c07bb | |||
| 37025bc7b6 | |||
| 9389ae248a | |||
| bb5694b855 | |||
| 09302facda | |||
| 2db92f7040 | |||
| a8966a383d | |||
| dfe1d7c672 | |||
| 6f110d8939 | |||
| f81e5ac903 | |||
| 52dba6bc29 | |||
| 42c487bbca | |||
| b63c5086ba | |||
| f6a3d59df7 | |||
| 5f083d4b23 | |||
| d59aac13f2 | |||
| e3602c0992 | |||
| 551e66d11e | |||
| fab92fb0f2 | |||
| ec4d64a308 | |||
| a77303e4bf | |||
| dadb24ef47 | |||
| ed155d05fe | |||
| f5b8031de5 | |||
| de18aca845 | |||
| 837f85931e | |||
| 8ba1848ecd | |||
| 6a5a17f639 | |||
| 204a6f544f | |||
| 673873c0c6 | |||
| 159829bd5b | |||
| e65442f874 | |||
| a7a7d1297c | |||
| bc81e66e91 | |||
| 5d1edd6cc6 | |||
| daf5567a58 | |||
| 6517e330d0 | |||
| aa9de79979 | |||
| 542b68666b | |||
| 3a0454129e | |||
| d3624cbfbd | |||
| 612e6f6611 | |||
| 23d2fbba65 | |||
| bd01d1525a | |||
| 40b7bfbe25 | |||
| 27f8976f3a | |||
| c76e84572a | |||
| bbb710b49f | |||
| 33a2e74ac4 | |||
| 0ad2b155e2 | |||
| fdc6b27e68 | |||
| 6368033118 | |||
| 036c5e77d4 | |||
| ab427ca043 | |||
| 640437c48b | |||
| 992bc8c641 | |||
| 3ac5711ef3 | |||
| eb43cfc9c8 | |||
| 1f1d855086 | |||
| a4f1a77b2d | |||
| b86d3d13fe | |||
| 0d93ceedf3 | |||
| 6bd836ee2a | |||
| b87e82b1c9 | |||
| b72d2a08c4 | |||
| adacc6741a | |||
| 21d624697d | |||
| 147a391cb6 | |||
| f437838f39 | |||
| b312f1e7a0 | |||
| 225921477b | |||
| 3b8f2023c2 | |||
| 35897a3c6c | |||
| 58c919c5cb | |||
| 87feb01fd6 | |||
| d5108840a5 | |||
| 5c25eab9ef | |||
| cbe1d02cc5 | |||
| c7eb0be7bf | |||
| 64c1753893 | |||
| 0f2c049ef2 | |||
| 948cbd8679 | |||
| 0802b09ea1 | |||
| edbfa6716c | |||
| 7f83250dc3 | |||
| 6a0abf4387 | |||
| b2428dbe78 | |||
| 7e3f60601b | |||
| 1011732ee2 | |||
| 60afb3aa82 | |||
| ac46437f21 | |||
| 68b0ac243d | |||
| f619eaefbf | |||
| 2f465f8daf | |||
| e0609a5fe8 | |||
| a7443f0693 |
+8
-9
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/apps/blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/apps/jboss-blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/jboss-blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/apps/jboss-blank</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
+30
-6
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/apps/mailreader</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/mailreader</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/apps/mailreader</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
@@ -68,11 +68,35 @@
|
||||
<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>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>log4j.configuration</name>
|
||||
<value>file:${basedir}/src/main/resources/log4j.properties</value>
|
||||
</systemProperty>
|
||||
<systemProperty>
|
||||
<name>slf4j</name>
|
||||
<value>false</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppConfig>
|
||||
<contextPath>/struts2-mailreader</contextPath>
|
||||
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
|
||||
</webAppConfig>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
|
||||
#
|
||||
# The five logging levels used by Log are (in order):
|
||||
#
|
||||
# 1. DEBUG (the least serious)
|
||||
# 2. INFO
|
||||
# 3. WARN
|
||||
# 4. ERROR
|
||||
# 5. FATAL (the most serious)
|
||||
|
||||
|
||||
# Set root logger level to WARN and append to stdout
|
||||
log4j.rootLogger=INFO, stdout
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.Target=System.out
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
|
||||
# Pattern to output the caller's file name and line number.
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
|
||||
|
||||
# Print only messages of level ERROR or above in the package noModule.
|
||||
log4j.logger.noModule=FATAL
|
||||
|
||||
# OpenSymphony Stuff
|
||||
log4j.logger.freemarker=INFO
|
||||
log4j.logger.com.opensymphony=INFO
|
||||
log4j.logger.com.opensymphony.xwork2.ognl=ERROR
|
||||
log4j.logger.org.apache.struts2=WARN
|
||||
log4j.logger.org.apache.struts2.components=WARN
|
||||
log4j.logger.org.apache.struts2.dispatcher=WARN
|
||||
log4j.logger.org.apache.struts2.convention=INFO
|
||||
|
||||
# Spring Stuff
|
||||
log4j.logger.org.springframework=WARN
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
<?xml version='1.0'?>
|
||||
<database>
|
||||
<user username="user" fromAddress="John.User@somewhere.com"
|
||||
fullName="John Q. User" password="pass">
|
||||
<subscription host="mail.hotmail.com" autoConnect="false"
|
||||
password="bar" type="pop3" username="user1234">
|
||||
</subscription>
|
||||
<subscription host="mail.yahoo.com" autoConnect="false" password="foo"
|
||||
type="imap" username="jquser">
|
||||
</subscription>
|
||||
</user>
|
||||
<user username="user" fromAddress="John.User@somewhere.com" fullName="John Q. User" password="pass">
|
||||
<subscription host="mail.yahoo.com" autoConnect="false" password="foo" type="imap" username="jquser">
|
||||
</subscription>
|
||||
<subscription host="mail.hotmail.com" autoConnect="false" password="bar" type="pop3" username="user1234">
|
||||
</subscription>
|
||||
</user>
|
||||
</database>
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/apps</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/apps</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
|
||||
+11
-19
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/apps/portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/portlet</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/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>
|
||||
@@ -193,6 +179,12 @@
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>xerces</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/>
|
||||
<validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/>
|
||||
<validator name="int" class="com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator"/>
|
||||
<validator name="short" class="com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator"/>
|
||||
<validator name="double" class="com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator"/>
|
||||
<validator name="date" class="com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator"/>
|
||||
<validator name="expression" class="com.opensymphony.xwork2.validator.validators.ExpressionValidator"/>
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-rest-showcase</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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>
|
||||
@@ -96,8 +101,10 @@
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.0.0.M2</version>
|
||||
<version>8.1.7.v20120910</version>
|
||||
<configuration>
|
||||
<stopKey>CTRL+C</stopKey>
|
||||
<stopPort>8999</stopPort>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>log4j.configuration</name>
|
||||
@@ -119,7 +126,7 @@
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.16</version>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
||||
+8
-22
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/apps/showcase</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/showcase</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/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>
|
||||
@@ -164,7 +149,6 @@
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
@@ -219,8 +203,10 @@
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.0.0.M2</version>
|
||||
<version>8.1.7.v20120910</version>
|
||||
<configuration>
|
||||
<stopKey>CTRL+C</stopKey>
|
||||
<stopPort>8999</stopPort>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>log4j.configuration</name>
|
||||
@@ -242,7 +228,7 @@
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.16</version>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
|
||||
@@ -44,19 +44,19 @@ public class Skill implements IdEntity {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
return StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(name));
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(name));
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
return StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(description));
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(description));
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Serializable getId() {
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@
|
||||
</field>
|
||||
<field name="regexValidatorField">
|
||||
<field-validator type="regex">
|
||||
<param name="expression">.*\.txt</param>
|
||||
<param name="regex">.*\.txt</param>
|
||||
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
+1
-1
@@ -52,7 +52,7 @@
|
||||
</field>
|
||||
<field name="regexValidatorField">
|
||||
<field-validator type="regex">
|
||||
<param name="expression">.*\.txt</param>
|
||||
<param name="regex"><![CDATA[ [^<>]+ ]]></param>
|
||||
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
|
||||
</field-validator>
|
||||
</field>
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/archetypes</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes</url>
|
||||
</scm>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-blank</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/archetypes/struts2-archetype-blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-blank</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-blank</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
|
||||
+64
-57
@@ -1,61 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archetype-descriptor name="struts2-archetype-blank">
|
||||
<fileSets>
|
||||
<fileSet filtered="true" packaged="true">
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.java</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="true" packaged="true">
|
||||
<directory>src/test/java</directory>
|
||||
<includes>
|
||||
<include>**/*.java</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="true">
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*package*.properties</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="true">
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*-validation.xml</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="true" packaged="false">
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/struts.xml</include>
|
||||
<include>**/example.xml</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSets>
|
||||
<fileSet filtered="true" packaged="true">
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*.java</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="false">
|
||||
<directory>src/main/webapp/example</directory>
|
||||
<includes>
|
||||
<include>**/*.jsp</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="false">
|
||||
<directory>src/main/webapp</directory>
|
||||
<includes>
|
||||
<include>**/index.html</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="false">
|
||||
<directory>src/main/webapp/WEB-INF</directory>
|
||||
<includes>
|
||||
<include>**/web.xml</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<fileSet filtered="true" packaged="true">
|
||||
<directory>src/test/java</directory>
|
||||
<includes>
|
||||
<include>**/*.java</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="true">
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*package*.properties</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="false">
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>log4j.properties</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="true">
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*-validation.xml</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="true" packaged="false">
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/struts.xml</include>
|
||||
<include>**/example.xml</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="false">
|
||||
<directory>src/main/webapp/example</directory>
|
||||
<includes>
|
||||
<include>**/*.jsp</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="false">
|
||||
<directory>src/main/webapp</directory>
|
||||
<includes>
|
||||
<include>**/index.html</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="false">
|
||||
<directory>src/main/webapp/WEB-INF</directory>
|
||||
<includes>
|
||||
<include>**/web.xml</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</archetype-descriptor>
|
||||
|
||||
@@ -66,17 +66,35 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.1.21</version>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.1.7.v20120910</version>
|
||||
<configuration>
|
||||
<stopKey>CTRL+C</stopKey>
|
||||
<stopPort>8999</stopPort>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>log4j.configuration</name>
|
||||
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
|
||||
</systemProperty>
|
||||
<systemProperty>
|
||||
<name>slf4j</name>
|
||||
<value>false</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<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>
|
||||
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppConfig>
|
||||
<contextPath>/struts2-blank</contextPath>
|
||||
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
|
||||
</webAppConfig>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
|
||||
#
|
||||
# The five logging levels used by Log are (in order):
|
||||
#
|
||||
# 1. DEBUG (the least serious)
|
||||
# 2. INFO
|
||||
# 3. WARN
|
||||
# 4. ERROR
|
||||
# 5. FATAL (the most serious)
|
||||
|
||||
|
||||
# Set root logger level to WARN and append to stdout
|
||||
log4j.rootLogger=WARN, stdout
|
||||
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
|
||||
# Pattern to output the caller's file name and line number.
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
|
||||
|
||||
# Print only messages of level ERROR or above in the package noModule.
|
||||
log4j.logger.noModule=ERROR
|
||||
|
||||
# OpenSymphony Stuff
|
||||
log4j.logger.com.opensymphony=INFO
|
||||
|
||||
# Struts2 Stuff
|
||||
log4j.logger.org.apache.struts2=INFO
|
||||
@@ -2,19 +2,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-convention</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/archetypes/struts2-archetype-convention</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-convention</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-convention</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
|
||||
+7
@@ -23,6 +23,13 @@
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="false">
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>log4j.properties</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="false">
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
|
||||
+26
-7
@@ -80,16 +80,35 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.1.21</version>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.1.7.v20120910</version>
|
||||
<configuration>
|
||||
<stopKey>CTRL+C</stopKey>
|
||||
<stopPort>8999</stopPort>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>log4j.configuration</name>
|
||||
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
|
||||
</systemProperty>
|
||||
<systemProperty>
|
||||
<name>slf4j</name>
|
||||
<value>false</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<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>
|
||||
</scanTargets>
|
||||
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppConfig>
|
||||
<contextPath>/struts2-convention</contextPath>
|
||||
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
|
||||
</webAppConfig>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
|
||||
#
|
||||
# The five logging levels used by Log are (in order):
|
||||
#
|
||||
# 1. DEBUG (the least serious)
|
||||
# 2. INFO
|
||||
# 3. WARN
|
||||
# 4. ERROR
|
||||
# 5. FATAL (the most serious)
|
||||
|
||||
|
||||
# Set root logger level to WARN and append to stdout
|
||||
log4j.rootLogger=WARN, stdout
|
||||
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
|
||||
# Pattern to output the caller's file name and line number.
|
||||
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
|
||||
|
||||
# Print only messages of level ERROR or above in the package noModule.
|
||||
log4j.logger.noModule=ERROR
|
||||
|
||||
# OpenSymphony Stuff
|
||||
log4j.logger.com.opensymphony=INFO
|
||||
|
||||
# Struts2 Stuff
|
||||
log4j.logger.org.apache.struts2=INFO
|
||||
@@ -2,19 +2,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-dbportlet</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/archetypes/struts2-archetype-dbportlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-dbportlet</developerConnection>
|
||||
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-dbportlet</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.14.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-plugin</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/archetypes/struts2-archetype-plugin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-plugin</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-plugin</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -1,42 +1,38 @@
|
||||
INFORMATION
|
||||
===========
|
||||
- This is Struts 2's "Portlet" Maven Archetype
|
||||
- To be used to create a simple portlet that can be deployed as a webapp or JSR168 portlet.
|
||||
- To be used to create a simple portlet that can be deployed as JSR286 portlet.
|
||||
- There is a maven profile in order to test this portlet on Pluto Portal.
|
||||
|
||||
|
||||
USAGE
|
||||
=====
|
||||
|
||||
- change directory to where the portlet template is to be created,
|
||||
for example, a 'projects' directory (which you may need to create):
|
||||
|
||||
cd /home/tmjee/projects
|
||||
|
||||
- run the following command to generate the sample portlet template, assuming :-
|
||||
- root java package -> com.myCompany.myPortlet
|
||||
1- Generate your archetype
|
||||
- mvn archetype:generate -DartifactId=struts2-portlet-helloworld -DgroupId=com.mycompany.struts2.portlet -Dversion=1.0.0-SNAPSHOT -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-portlet -DarchetypeVersion=2.3.8
|
||||
|
||||
- the portlet war name -> myWebApp
|
||||
2- Build your portlet project for Pluto Portal
|
||||
- cd struts2-portlet-helloworld
|
||||
- mvn clean package -Ppluto-embedded
|
||||
|
||||
3- Download and install Pluto Portal
|
||||
- cd ..
|
||||
- curl -v -H "Accept-Encoding: gzip" "http://apache.opensourcemirror.com/portals/pluto/pluto-2.0.3-bundle.zip" > pluto-2.0.3.zip
|
||||
- unzip pluto-2.0.3.zip -d .
|
||||
|
||||
4- Deploy your portlet app
|
||||
- cp struts2-portlet-helloworld/target/struts2-portlet-helloworld-1.0.0-SNAPSHOT.war pluto-2.0.3/webapps
|
||||
|
||||
5- Start Pluto Portal and create a page for your portlet
|
||||
- ./pluto-2.0.3/bin/startup.sh
|
||||
- Go to http://localhost:8080/pluto/portal (login: pluto / pwd: pluto)
|
||||
- Click on "Pluto Admin" (http://localhost:8080/pluto/portal/Pluto%20Admin)
|
||||
- On "Portal Pages" section : Add page "Struts2"
|
||||
- On "Portlet Applications" section : select "/struts2-portlet-helloworld" and "HelloPortlet" then click "Add Portlet"
|
||||
|
||||
6- Test your portlet app
|
||||
- Go to your Struts2 page http://localhost:8080/pluto/portal/Struts2 and play with your portlet !!
|
||||
|
||||
|
||||
mvn archetype:create -DgroupId=com.myCompany.myPortlet \
|
||||
-DartifactId=myWebApp \
|
||||
-DarchetypeGroupId=org.apache.struts \
|
||||
-DarchetypeArtifactId=struts2-archetype-portlet \
|
||||
-DarchetypeVersion=2.0.9-SNAPSHOT \
|
||||
-DremoteRepositories=http://people.apache.org/maven-snapshot-repository
|
||||
|
||||
- to compile, execute
|
||||
mvn compile
|
||||
|
||||
- to run test cases execute
|
||||
mvn test
|
||||
|
||||
- to clean execute
|
||||
mvn clean
|
||||
|
||||
- to package execute
|
||||
mvn package
|
||||
|
||||
- to start it with jetty execute as a servlet
|
||||
mvn jetty:run
|
||||
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-portlet</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/archetypes/struts2-archetype-portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-portlet</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-portlet</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
@@ -25,13 +25,6 @@
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources/archetype-resources/src</directory>
|
||||
<filtering>false</filtering>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
</includes>
|
||||
</fileSet>
|
||||
|
||||
<fileSet filtered="false" packaged="false">
|
||||
<fileSet filtered="true" packaged="false">
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
|
||||
+49
-90
@@ -3,14 +3,20 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>\${groupId}</groupId>
|
||||
<artifactId>\${artifactId}</artifactId>
|
||||
<version>\${version}</version>
|
||||
<groupId>${groupId}</groupId>
|
||||
<artifactId>${artifactId}</artifactId>
|
||||
<version>${version}</version>
|
||||
<packaging>war</packaging>
|
||||
<name>\${artifactId}</name>
|
||||
<name>${artifactId}</name>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<struts2.version>${project.version}</struts2.version>
|
||||
<portlet.api.version>2.0</portlet.api.version>
|
||||
<!-- plugins -->
|
||||
<plugin.compiler.version>3.0</plugin.compiler.version>
|
||||
<plugin.war.version>2.3</plugin.war.version>
|
||||
<plugin.pluto.version>2.0.3</plugin.pluto.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
@@ -19,114 +25,67 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>\${struts2.version}</version>
|
||||
<version>${struts2.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet-plugin</artifactId>
|
||||
<version>\${struts2.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-config-browser-plugin</artifactId>
|
||||
<version>\${struts2.version}</version>
|
||||
<version>${struts2.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.portlet</groupId>
|
||||
<artifactId>portlet-api</artifactId>
|
||||
<version>2.0</version>
|
||||
<version>${portlet.api.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.bekk.boss</groupId>
|
||||
<artifactId>maven-jetty-pluto-embedded</artifactId>
|
||||
<version>1.0.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jetty</artifactId>
|
||||
<version>6.1.21</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jsp-2.1</artifactId>
|
||||
<version>6.1.14</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>${plugin.compiler.version}</version>
|
||||
<configuration>
|
||||
<source>1.5</source>
|
||||
<target>1.5</target>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>pluto-embedded</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.pluto</groupId>
|
||||
<artifactId>maven-pluto-plugin</artifactId>
|
||||
<version>1.1.6</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>assemble</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.1.21</version>
|
||||
<configuration>
|
||||
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
|
||||
<webAppConfig>
|
||||
<contextPath>/${project.artifactId}</contextPath>
|
||||
<defaultsDescriptor>/WEB-INF/jetty-pluto-web-default.xml</defaultsDescriptor>
|
||||
</webAppConfig>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>org.apache.pluto.embedded.portletIds</name>
|
||||
<value>HelloPortlet</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<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>
|
||||
</scanTargets>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.bekk.boss</groupId>
|
||||
<artifactId>maven-jetty-pluto-embedded</artifactId>
|
||||
<version>1.0.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>pluto-embedded</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- configure maven-war-plugin to use updated web.xml -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>${plugin.war.version}</version>
|
||||
<configuration>
|
||||
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- bind 'pluto2:assemble' goal to 'generate-resources' lifecycle -->
|
||||
<plugin>
|
||||
<groupId>org.apache.portals.pluto</groupId>
|
||||
<artifactId>maven-pluto-plugin</artifactId>
|
||||
<version>${plugin.pluto.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>assemble</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
||||
|
||||
+1
-3
@@ -1,12 +1,10 @@
|
||||
package ${packageName};
|
||||
package ${package};
|
||||
|
||||
import javax.portlet.PortletPreferences;
|
||||
|
||||
import org.apache.struts2.dispatcher.DefaultActionSupport;
|
||||
import org.apache.struts2.portlet.interceptor.PortletPreferencesAware;
|
||||
|
||||
import com.opensymphony.xwork2.Preparable;
|
||||
|
||||
public class HelloAction extends DefaultActionSupport implements PortletPreferencesAware {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package ${packageName};
|
||||
package ${package};
|
||||
|
||||
import javax.portlet.PortletPreferences;
|
||||
|
||||
|
||||
+2
-2
@@ -5,14 +5,14 @@
|
||||
|
||||
<struts>
|
||||
<package name="default" extends="struts-portlet-default" namespace="/view">
|
||||
<action name="index" class="${packageName}.HelloAction">
|
||||
<action name="index" class="${package}.HelloAction">
|
||||
<result>/WEB-INF/jsp/view/index.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
|
||||
<package name="edit" extends="struts-portlet-default" namespace="/edit">
|
||||
|
||||
<action name="index" class="${packageName}.UpdateNameAction">
|
||||
<action name="index" class="${package}.UpdateNameAction">
|
||||
<result type="redirectAction">
|
||||
<param name="actionName">index</param>
|
||||
<param name="portletMode">view</param>
|
||||
|
||||
+11
-7
@@ -1,19 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<portlet-app
|
||||
version="1.0"
|
||||
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
|
||||
id="${artifactId}">
|
||||
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
|
||||
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
|
||||
id="\${artifactId}">
|
||||
|
||||
<portlet id="HelloPortlet">
|
||||
<description xml:lang="EN">Simple hello world portlet</description>
|
||||
<portlet-name>HelloPortlet</portlet-name>
|
||||
<display-name xml:lang="EN">${artifactId}</display-name>
|
||||
<display-name xml:lang="EN">\${artifactId}</display-name>
|
||||
|
||||
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class>
|
||||
|
||||
<init-param>
|
||||
<name>actionPackages</name>
|
||||
<value>${package}</value>
|
||||
</init-param>
|
||||
|
||||
<!-- The namespace for the actions configured for view mode -->
|
||||
<init-param>
|
||||
<name>viewNamespace</name>
|
||||
|
||||
+18
-2
@@ -1,5 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
|
||||
<web-app id="${artifactId}">
|
||||
<!-- Empty -->
|
||||
<web-app id="\${artifactId}">
|
||||
<display-name>Struts2 Hello World Portlet</display-name>
|
||||
|
||||
<filter>
|
||||
<filter-name>struts2</filter-name>
|
||||
<filter-class>
|
||||
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
|
||||
</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>struts2</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
</welcome-file-list>
|
||||
</web-app>
|
||||
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
package ${packageName};
|
||||
|
||||
import org.apache.pluto.core.PortletServlet;
|
||||
import org.mortbay.jetty.Server;
|
||||
import org.mortbay.jetty.servlet.ServletHolder;
|
||||
import org.mortbay.jetty.webapp.WebAppContext;
|
||||
|
||||
public class JettyPlutoLauncher {
|
||||
public static void main(String[] args) throws Exception {
|
||||
System.setProperty("org.apache.pluto.embedded.portletIds", "HelloPortlet");
|
||||
Server server = new Server(8080);
|
||||
WebAppContext webapp = new WebAppContext("src/main/webapp", "/${artifactId}");
|
||||
webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
|
||||
ServletHolder portletServlet = new ServletHolder(new PortletServlet());
|
||||
portletServlet.setInitParameter("portlet-name", "HelloPortlet");
|
||||
portletServlet.setInitOrder(1);
|
||||
webapp.addServlet(portletServlet, "/PlutoInvoker/HelloPortlet");
|
||||
server.addHandler(webapp);
|
||||
server.start();
|
||||
}
|
||||
}
|
||||
@@ -4,19 +4,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-starter</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/archetypes/struts2-archetype-starter</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-starter</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-starter</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
|
||||
+28
-10
@@ -88,19 +88,37 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.1.21</version>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.1.7.v20120910</version>
|
||||
<configuration>
|
||||
<stopKey>CTRL+C</stopKey>
|
||||
<stopPort>8999</stopPort>
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>log4j.configuration</name>
|
||||
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
|
||||
</systemProperty>
|
||||
<systemProperty>
|
||||
<name>slf4j</name>
|
||||
<value>false</value>
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<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/applicationContext.xml</scanTarget>
|
||||
</scanTargets>
|
||||
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppConfig>
|
||||
<contextPath>/struts2-showcase</contextPath>
|
||||
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
|
||||
</webAppConfig>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
||||
+4
-4
@@ -11,13 +11,13 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/assembly</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/assembly</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/assembly</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/bundles/admin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/bundles/admin</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/bundles/admin</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
+4
-10
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/bundles/demo</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/bundles/demo</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/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
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/bundles</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/bundles</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/bundles</url>
|
||||
</scm>
|
||||
|
||||
<modules>
|
||||
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.7</version>
|
||||
<version>2.3.14.2</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_14_2/core</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/core</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/core</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -125,11 +125,6 @@ public final class StrutsConstants {
|
||||
/** The directory to use for storing uploaded files */
|
||||
public static final String STRUTS_MULTIPART_SAVEDIR = "struts.multipart.saveDir";
|
||||
|
||||
/**
|
||||
* The name of the bean that will handle multipart requests
|
||||
*/
|
||||
public static final String STRUTS_MULTIPART_HANDLER = "struts.multipart.handler";
|
||||
|
||||
/**
|
||||
* The org.apache.struts2.dispatcher.multipart.MultiPartRequest parser implementation
|
||||
* for a multipart request (file upload)
|
||||
@@ -233,6 +228,9 @@ public final class StrutsConstants {
|
||||
/** Enables caching of parsed OGNL expressions **/
|
||||
public static final String STRUTS_ENABLE_OGNL_EXPRESSION_CACHE = "struts.ognl.enableExpressionCache";
|
||||
|
||||
/** Enables evaluation of OGNL expressions **/
|
||||
public static final String STRUTS_ENABLE_OGNL_EVAL_EXPRESSION = "struts.ognl.enableOGNLEvalExpression";
|
||||
|
||||
/** The{@link org.apache.struts2.views.util.UrlHelper} implementation class **/
|
||||
public static final String STRUTS_URL_HELPER = "struts.view.urlHelper";
|
||||
|
||||
@@ -246,4 +244,12 @@ public final class StrutsConstants {
|
||||
/** Enable handling exceptions by Dispatcher - true by default **/
|
||||
public static final String STRUTS_HANDLE_EXCEPTION = "struts.handle.exception";
|
||||
|
||||
public static final String STRUTS_CONVERTER_PROPERTIES_PROCESSOR = "struts.converter.properties.processor";
|
||||
public static final String STRUTS_CONVERTER_FILE_PROCESSOR = "struts.converter.file.processor";
|
||||
public static final String STRUTS_CONVERTER_ANNOTATION_PROCESSOR = "struts.converter.annotation.processor";
|
||||
public static final String STRUTS_CONVERTER_CREATOR = "struts.converter.creator";
|
||||
public static final String STRUTS_CONVERTER_HOLDER = "struts..converter.holder";
|
||||
|
||||
public static final String STRUTS_EXPRESSION_PARSER = "struts.expression.parser";
|
||||
|
||||
}
|
||||
|
||||
@@ -21,16 +21,14 @@
|
||||
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
* ClosingUIBean is the standard superclass for UI components such as div etc.
|
||||
@@ -59,7 +57,6 @@ public abstract class ClosingUIBean extends UIBean {
|
||||
mergeTemplate(writer, buildTemplateName(openTemplate, getDefaultOpenTemplate()));
|
||||
} catch (Exception e) {
|
||||
LOG.error("Could not open template", e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -275,21 +275,19 @@ public class Date extends ContextBean {
|
||||
}
|
||||
|
||||
public boolean end(Writer writer, String body) {
|
||||
String msg = null;
|
||||
String msg;
|
||||
java.util.Date date = null;
|
||||
// find the name on the valueStack
|
||||
try {
|
||||
//suport Calendar also
|
||||
Object dateObject = findValue(name);
|
||||
if (dateObject instanceof java.util.Date)
|
||||
if (dateObject instanceof java.util.Date) {
|
||||
date = (java.util.Date) dateObject;
|
||||
else if(dateObject instanceof Calendar)
|
||||
} else if(dateObject instanceof Calendar){
|
||||
date = ((Calendar) dateObject).getTime();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.error("Could not convert object with key '" + name
|
||||
+ "' to a java.util.Date instance");
|
||||
// bad date, return a blank instead ?
|
||||
msg = "";
|
||||
LOG.error("Could not convert object with key '#0' to a java.util.Date instance", name);
|
||||
}
|
||||
|
||||
//try to find the format on the stack
|
||||
|
||||
@@ -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 -->
|
||||
* <s:set name="personName" value="person.name"/>
|
||||
* Hello, <s:property value="#personName"/>. How are you?
|
||||
* <s:set var="personName" value="person.name"/>
|
||||
* Hello, <s:property value="#personName"/>
|
||||
*
|
||||
* <s:set var="janesName">Jane Doe</s:set>
|
||||
* <s:property value="#janesName"/>
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
|
||||
@@ -49,9 +49,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
/**
|
||||
* UIBean is the standard superclass of all Struts UI componentns.
|
||||
* UIBean is the standard superclass of all Struts UI components.
|
||||
* It defines common Struts and html properties all UI components should present for usage.
|
||||
*
|
||||
* <!-- START SNIPPET: templateRelatedAttributes -->
|
||||
@@ -156,6 +157,12 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
* <td>xhtml</td>
|
||||
* <td>String</td>
|
||||
* <td>define required label position of form element (left/right), default to right</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>errorPosition</td>
|
||||
* <td>xhtml</td>
|
||||
* <td>String</td>
|
||||
* <td>define error position of form element (top|bottom), default to top</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>name</td>
|
||||
@@ -453,9 +460,10 @@ public abstract class UIBean extends Component {
|
||||
protected String label;
|
||||
protected String labelPosition;
|
||||
protected String labelSeparator;
|
||||
protected String requiredposition;
|
||||
protected String requiredPosition;
|
||||
protected String errorPosition;
|
||||
protected String name;
|
||||
protected String required;
|
||||
protected String requiredLabel;
|
||||
protected String tabindex;
|
||||
protected String value;
|
||||
protected String title;
|
||||
@@ -495,7 +503,7 @@ public abstract class UIBean extends Component {
|
||||
protected TemplateEngineManager templateEngineManager;
|
||||
|
||||
// dynamic attributes support for tags used with FreeMarker templates
|
||||
protected static Map<Class, Set<String>> standardAttributesMap = new ConcurrentHashMap<Class, Set<String>>();
|
||||
protected static ConcurrentMap<Class, Set<String>> standardAttributesMap = new ConcurrentHashMap<Class, Set<String>>();
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_UI_TEMPLATEDIR)
|
||||
public void setDefaultTemplateDir(String dir) {
|
||||
@@ -662,12 +670,16 @@ public abstract class UIBean extends Component {
|
||||
addParameter("labelposition", findString(labelPosition));
|
||||
}
|
||||
|
||||
if (requiredposition != null) {
|
||||
addParameter("requiredposition", findString(requiredposition));
|
||||
if (requiredPosition != null) {
|
||||
addParameter("requiredposition", findString(requiredPosition));
|
||||
}
|
||||
|
||||
if (required != null) {
|
||||
addParameter("required", findValue(required, Boolean.class));
|
||||
if (errorPosition != null) {
|
||||
addParameter("errorposition", findString(errorPosition));
|
||||
}
|
||||
|
||||
if (requiredLabel != null) {
|
||||
addParameter("required", findValue(requiredLabel, Boolean.class));
|
||||
}
|
||||
|
||||
if (disabled != null) {
|
||||
@@ -869,7 +881,7 @@ public abstract class UIBean extends Component {
|
||||
if (name != null) {
|
||||
return name.replaceAll("[\\/\\.\\[\\]]", "_");
|
||||
} else {
|
||||
return "";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -883,7 +895,7 @@ public abstract class UIBean extends Component {
|
||||
if (val != null) {
|
||||
return val.replaceAll("\"", """);
|
||||
} else {
|
||||
return "";
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1066,18 +1078,23 @@ public abstract class UIBean extends Component {
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Define required position of required form element (left|right)")
|
||||
public void setRequiredposition(String requiredposition) {
|
||||
this.requiredposition = requiredposition;
|
||||
public void setRequiredPosition(String requiredPosition) {
|
||||
this.requiredPosition = requiredPosition;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Define error position of form element (top|bottom)")
|
||||
public void setErrorPosition(String errorPosition) {
|
||||
this.errorPosition = errorPosition;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The name to set for element")
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="If set to true, the rendered element will indicate that input is required", type="Boolean", defaultValue="false")
|
||||
public void setRequired(String required) {
|
||||
this.required = required;
|
||||
public void setRequiredLabel(String requiredLabel) {
|
||||
this.requiredLabel = requiredLabel;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Set the html tabindex attribute on rendered html element")
|
||||
@@ -1227,7 +1244,6 @@ public abstract class UIBean extends Component {
|
||||
Set<String> standardAttributes = standardAttributesMap.get(clz);
|
||||
if (standardAttributes == null) {
|
||||
standardAttributes = new HashSet<String>();
|
||||
standardAttributesMap.put(clz, standardAttributes);
|
||||
while (clz != null) {
|
||||
for (Field f : clz.getDeclaredFields()) {
|
||||
if (Modifier.isProtected(f.getModifiers())
|
||||
@@ -1241,8 +1257,9 @@ public abstract class UIBean extends Component {
|
||||
clz = clz.getSuperclass();
|
||||
}
|
||||
}
|
||||
standardAttributesMap.putIfAbsent(clz, standardAttributes);
|
||||
}
|
||||
return standardAttributes;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,12 @@ import com.opensymphony.xwork2.XWorkConstants;
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.config.ConfigurationProvider;
|
||||
import com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor;
|
||||
import com.opensymphony.xwork2.conversion.ConversionFileProcessor;
|
||||
import com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor;
|
||||
import com.opensymphony.xwork2.conversion.ObjectTypeDeterminer;
|
||||
import com.opensymphony.xwork2.conversion.TypeConverterCreator;
|
||||
import com.opensymphony.xwork2.conversion.TypeConverterHolder;
|
||||
import com.opensymphony.xwork2.conversion.impl.ArrayConverter;
|
||||
import com.opensymphony.xwork2.conversion.impl.CollectionConverter;
|
||||
import com.opensymphony.xwork2.conversion.impl.DateConverter;
|
||||
@@ -44,10 +49,7 @@ import com.opensymphony.xwork2.inject.ContainerBuilder;
|
||||
import com.opensymphony.xwork2.inject.Context;
|
||||
import com.opensymphony.xwork2.inject.Factory;
|
||||
import com.opensymphony.xwork2.inject.Scope;
|
||||
import com.opensymphony.xwork2.util.ClassLoaderUtil;
|
||||
import com.opensymphony.xwork2.util.LocalizedTextUtil;
|
||||
import com.opensymphony.xwork2.util.PatternMatcher;
|
||||
import com.opensymphony.xwork2.util.ValueStackFactory;
|
||||
import com.opensymphony.xwork2.util.*;
|
||||
import com.opensymphony.xwork2.util.location.LocatableProperties;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
@@ -241,6 +243,43 @@ import java.util.StringTokenizer;
|
||||
* <td>singleton</td>
|
||||
* <td>Converter used to convert any object to String and back</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor</td>
|
||||
* <td>struts.conversion.properties.processor</td>
|
||||
* <td>singleton</td>
|
||||
* <td>Process Properties to create converters</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor</td>
|
||||
* <td>struts.converter.file.processor</td>
|
||||
* <td>singleton</td>
|
||||
* <td>Process <class>-conversion.properties file create converters</class></td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor</td>
|
||||
* <td>struts.converter.annotation.processor</td>
|
||||
* <td>singleton</td>
|
||||
* <td>Process TypeConversion annotation to create converters</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>com.opensymphony.xwork2.conversion.TypeConverterCreator</td>
|
||||
* <td>struts.converter.creator</td>
|
||||
* <td>singleton</td>
|
||||
* <td>Creates user converters</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>com.opensymphony.xwork2.conversion.TypeConverterHolder</td>
|
||||
* <td>struts.converter.holder</td>
|
||||
* <td>singleton</td>
|
||||
* <td>Holds user converters' instances</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>com.opensymphony.xwork2.util.TextParser</td>
|
||||
* <td>struts.expression.parser</td>
|
||||
* <td>singleton</td>
|
||||
* <td>Used to parse expressions like ${foo.bar} or %{bar.foo} but it is up tp the TextParser's
|
||||
* implementation what kind of opening char to use (#, $, %, etc)</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* <!-- END SNIPPET: extensionPoints -->
|
||||
@@ -287,8 +326,22 @@ public class BeanSelectionProvider implements ConfigurationProvider {
|
||||
public void register(ContainerBuilder builder, LocatableProperties props) {
|
||||
alias(ObjectFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY, builder, props);
|
||||
alias(FileManagerFactory.class, StrutsConstants.STRUTS_FILE_MANAGER_FACTORY, builder, props, Scope.SINGLETON);
|
||||
|
||||
alias(XWorkConverter.class, StrutsConstants.STRUTS_XWORKCONVERTER, builder, props);
|
||||
alias(CollectionConverter.class, StrutsConstants.STRUTS_CONVERTER_COLLECTION, builder, props);
|
||||
alias(ArrayConverter.class, StrutsConstants.STRUTS_CONVERTER_ARRAY, builder, props);
|
||||
alias(DateConverter.class, StrutsConstants.STRUTS_CONVERTER_DATE, builder, props);
|
||||
alias(NumberConverter.class, StrutsConstants.STRUTS_CONVERTER_NUMBER, builder, props);
|
||||
alias(StringConverter.class, StrutsConstants.STRUTS_CONVERTER_STRING, builder, props);
|
||||
|
||||
alias(ConversionPropertiesProcessor.class, StrutsConstants.STRUTS_CONVERTER_PROPERTIES_PROCESSOR, builder, props);
|
||||
alias(ConversionFileProcessor.class, StrutsConstants.STRUTS_CONVERTER_FILE_PROCESSOR, builder, props);
|
||||
alias(ConversionAnnotationProcessor.class, StrutsConstants.STRUTS_CONVERTER_ANNOTATION_PROCESSOR, builder, props);
|
||||
alias(TypeConverterCreator.class, StrutsConstants.STRUTS_CONVERTER_CREATOR, builder, props);
|
||||
alias(TypeConverterHolder.class, StrutsConstants.STRUTS_CONVERTER_HOLDER, builder, props);
|
||||
|
||||
alias(TextProvider.class, StrutsConstants.STRUTS_XWORKTEXTPROVIDER, builder, props, Scope.DEFAULT);
|
||||
|
||||
alias(LocaleProvider.class, StrutsConstants.STRUTS_LOCALE_PROVIDER, builder, props);
|
||||
alias(ActionProxyFactory.class, StrutsConstants.STRUTS_ACTIONPROXYFACTORY, builder, props);
|
||||
alias(ObjectTypeDeterminer.class, StrutsConstants.STRUTS_OBJECTTYPEDETERMINER, builder, props);
|
||||
@@ -306,11 +359,7 @@ public class BeanSelectionProvider implements ConfigurationProvider {
|
||||
alias(UnknownHandlerManager.class, StrutsConstants.STRUTS_UNKNOWN_HANDLER_MANAGER, builder, props);
|
||||
alias(UrlHelper.class, StrutsConstants.STRUTS_URL_HELPER, builder, props);
|
||||
|
||||
alias(CollectionConverter.class, StrutsConstants.STRUTS_CONVERTER_COLLECTION, builder, props);
|
||||
alias(ArrayConverter.class, StrutsConstants.STRUTS_CONVERTER_ARRAY, builder, props);
|
||||
alias(DateConverter.class, StrutsConstants.STRUTS_CONVERTER_DATE, builder, props);
|
||||
alias(NumberConverter.class, StrutsConstants.STRUTS_CONVERTER_NUMBER, builder, props);
|
||||
alias(StringConverter.class, StrutsConstants.STRUTS_CONVERTER_STRING, builder, props);
|
||||
alias(TextParser.class, StrutsConstants.STRUTS_EXPRESSION_PARSER, builder, props);
|
||||
|
||||
if ("true".equalsIgnoreCase(props.getProperty(StrutsConstants.STRUTS_DEVMODE))) {
|
||||
props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD, "true");
|
||||
@@ -326,6 +375,7 @@ public class BeanSelectionProvider implements ConfigurationProvider {
|
||||
// Convert Struts properties into XWork properties
|
||||
convertIfExist(props, StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES, XWorkConstants.LOG_MISSING_PROPERTIES);
|
||||
convertIfExist(props, StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE, XWorkConstants.ENABLE_OGNL_EXPRESSION_CACHE);
|
||||
convertIfExist(props, StrutsConstants.STRUTS_ENABLE_OGNL_EVAL_EXPRESSION, XWorkConstants.ENABLE_OGNL_EVAL_EXPRESSION);
|
||||
convertIfExist(props, StrutsConstants.STRUTS_ALLOW_STATIC_METHOD_ACCESS, XWorkConstants.ALLOW_STATIC_METHOD_ACCESS);
|
||||
convertIfExist(props, StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, XWorkConstants.RELOAD_XML_CONFIGURATION);
|
||||
|
||||
@@ -348,11 +398,11 @@ public class BeanSelectionProvider implements ConfigurationProvider {
|
||||
String name = customBundles.nextToken();
|
||||
try {
|
||||
if (LOG.isInfoEnabled()) {
|
||||
LOG.info("Loading global messages from " + name);
|
||||
LOG.info("Loading global messages from [#0]", name);
|
||||
}
|
||||
LocalizedTextUtil.addDefaultResourceBundle(name);
|
||||
} catch (Exception e) {
|
||||
LOG.error("Could not find messages file " + name + ".properties. Skipping");
|
||||
LOG.error("Could not find messages file #0.properties. Skipping", name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
/**
|
||||
* Simple class to hold Container instance per thread to minimise number of attempts
|
||||
* to read configuration and build each time a new configuration.
|
||||
*
|
||||
* Thus depends on {@link StrutsConstants#STRUTS_CONFIGURATION_XML_RELOAD} flag,
|
||||
* if set to false just use stored container, configuration will do not change.
|
||||
*/
|
||||
class ContainerHolder {
|
||||
|
||||
private static ThreadLocal<Container> instance = new ThreadLocal<Container>();
|
||||
|
||||
public static void store(Container instance) {
|
||||
boolean reloadConfigs = Boolean.valueOf(instance.getInstance(String.class, StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD));
|
||||
if (!reloadConfigs) {
|
||||
// reloadConfigs is false, configuration will do not change, just keep it
|
||||
ContainerHolder.instance.set(instance);
|
||||
}
|
||||
}
|
||||
|
||||
public static Container get() {
|
||||
return ContainerHolder.instance.get();
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
ContainerHolder.instance.set(null);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -37,19 +37,41 @@ 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.
|
||||
*/
|
||||
private Logger log;
|
||||
private Logger LOG = LoggerFactory.getLogger(DefaultStaticContentLoader.class);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -116,7 +138,6 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
|
||||
packages = param + " " + packages;
|
||||
}
|
||||
this.pathPrefixes = parse(packages);
|
||||
initLogging(filterConfig);
|
||||
}
|
||||
|
||||
protected String getAdditionalPackages() {
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -192,8 +213,9 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
|
||||
try {
|
||||
ifModifiedSince = request.getDateHeader("If-Modified-Since");
|
||||
} catch (Exception e) {
|
||||
log.warn("Invalid If-Modified-Since header value: '"
|
||||
+ request.getHeader("If-Modified-Since") + "', ignoring");
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("Invalid If-Modified-Since header value: '#0', ignoring", request.getHeader("If-Modified-Since"));
|
||||
}
|
||||
}
|
||||
long lastModifiedMillis = lastModifiedCal.getTimeInMillis();
|
||||
long now = cal.getTimeInMillis();
|
||||
@@ -233,33 +255,9 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
|
||||
} finally {
|
||||
is.close();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void initLogging(HostConfig filterConfig) {
|
||||
String factoryName = filterConfig.getInitParameter("loggerFactory");
|
||||
if (factoryName != null) {
|
||||
try {
|
||||
Class cls = ClassLoaderUtil.loadClass(factoryName, this.getClass());
|
||||
LoggerFactory fac = (LoggerFactory)cls.newInstance();
|
||||
LoggerFactory.setLoggerFactory(fac);
|
||||
} catch (InstantiationException e) {
|
||||
System.err.println("Unable to instantiate logger factory: "+factoryName+", using default");
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
System.err.println("Unable to access logger factory: "+factoryName+", using default");
|
||||
e.printStackTrace();
|
||||
} catch (ClassNotFoundException e) {
|
||||
System.err.println("Unable to locate logger factory class: "+factoryName+", using default");
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
log = LoggerFactory.getLogger(FilterDispatcher.class);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Look for a static resource in the classpath.
|
||||
*
|
||||
@@ -276,7 +274,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;
|
||||
|
||||
@@ -252,7 +252,7 @@ public class Dispatcher {
|
||||
multipartSaveDir = val;
|
||||
}
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_MULTIPART_HANDLER)
|
||||
@Inject(StrutsConstants.STRUTS_MULTIPART_PARSER)
|
||||
public void setMultipartHandler(String val) {
|
||||
multipartHandlerName = val;
|
||||
}
|
||||
@@ -285,7 +285,7 @@ public class Dispatcher {
|
||||
}
|
||||
catch(Exception e) {
|
||||
// catch any exception that may occurred during destroy() and log it
|
||||
LOG.error("exception occurred while destroying ObjectFactory ["+objectFactory+"]", e);
|
||||
LOG.error("exception occurred while destroying ObjectFactory [#0]", e, objectFactory.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -432,6 +432,8 @@ public class Dispatcher {
|
||||
boolean reloadi18n = Boolean.valueOf(container.getInstance(String.class, StrutsConstants.STRUTS_I18N_RELOAD));
|
||||
LocalizedTextUtil.setReloadBundles(reloadi18n);
|
||||
|
||||
ContainerHolder.store(container);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
@@ -679,21 +681,20 @@ public class Dispatcher {
|
||||
File multipartSaveDir = new File(saveDir);
|
||||
|
||||
if (!multipartSaveDir.exists()) {
|
||||
if (!multipartSaveDir.mkdir()) {
|
||||
if (!multipartSaveDir.mkdirs()) {
|
||||
String logMessage;
|
||||
try {
|
||||
logMessage = "Could not find create multipart save directory '"+multipartSaveDir.getCanonicalPath()+"'.";
|
||||
} catch (IOException e) {
|
||||
logMessage = "Could not find create multipart save directory '"+multipartSaveDir.toString()+"'.";
|
||||
}
|
||||
if(devMode) {
|
||||
try {
|
||||
logMessage = "Could not find create multipart save directory '" + multipartSaveDir.getCanonicalPath() + "'.";
|
||||
} catch (IOException e) {
|
||||
logMessage = "Could not find create multipart save directory '" + multipartSaveDir.toString() + "'.";
|
||||
}
|
||||
if (devMode) {
|
||||
LOG.error(logMessage);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn(logMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -773,17 +774,7 @@ public class Dispatcher {
|
||||
|
||||
String content_type = request.getContentType();
|
||||
if (content_type != null && content_type.contains("multipart/form-data")) {
|
||||
MultiPartRequest mpr = null;
|
||||
//check for alternate implementations of MultiPartRequest
|
||||
Set<String> multiNames = getContainer().getInstanceNames(MultiPartRequest.class);
|
||||
for (String multiName : multiNames) {
|
||||
if (multiName.equals(multipartHandlerName)) {
|
||||
mpr = getContainer().getInstance(MultiPartRequest.class, multiName);
|
||||
}
|
||||
}
|
||||
if (mpr == null ) {
|
||||
mpr = getContainer().getInstance(MultiPartRequest.class);
|
||||
}
|
||||
MultiPartRequest mpr = getMultiPartRequest();
|
||||
LocaleProvider provider = getContainer().getInstance(LocaleProvider.class);
|
||||
request = new MultiPartRequestWrapper(mpr, request, getSaveDir(servletContext), provider);
|
||||
} else {
|
||||
@@ -793,6 +784,27 @@ public class Dispatcher {
|
||||
return request;
|
||||
}
|
||||
|
||||
/**
|
||||
* On each request it must return a new instance as implementation could be not thread safe
|
||||
* and thus ensure of resource clean up
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected MultiPartRequest getMultiPartRequest() {
|
||||
MultiPartRequest mpr = null;
|
||||
//check for alternate implementations of MultiPartRequest
|
||||
Set<String> multiNames = getContainer().getInstanceNames(MultiPartRequest.class);
|
||||
for (String multiName : multiNames) {
|
||||
if (multiName.equals(multipartHandlerName)) {
|
||||
mpr = getContainer().getInstance(MultiPartRequest.class, multiName);
|
||||
}
|
||||
}
|
||||
if (mpr == null ) {
|
||||
mpr = getContainer().getInstance(MultiPartRequest.class);
|
||||
}
|
||||
return mpr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes all the files created by MultiPartRequestWrapper.
|
||||
*
|
||||
@@ -908,8 +920,10 @@ public class Dispatcher {
|
||||
* Modify the ConfigurationManager instance
|
||||
*
|
||||
* @param mgr The configuration manager
|
||||
* @deprecated should be removed as is used only in tests
|
||||
*/
|
||||
public void setConfigurationManager(ConfigurationManager mgr) {
|
||||
ContainerHolder.clear();
|
||||
this.configurationManager = mgr;
|
||||
}
|
||||
|
||||
@@ -918,6 +932,9 @@ public class Dispatcher {
|
||||
* @return Our dependency injection container
|
||||
*/
|
||||
public Container getContainer() {
|
||||
if (ContainerHolder.get() != null) {
|
||||
return ContainerHolder.get();
|
||||
}
|
||||
ConfigurationManager mgr = getConfigurationManager();
|
||||
if (mgr == null) {
|
||||
throw new IllegalStateException("The configuration manager shouldn't be null");
|
||||
@@ -926,8 +943,11 @@ public class Dispatcher {
|
||||
if (config == null) {
|
||||
throw new IllegalStateException("Unable to load configuration");
|
||||
} else {
|
||||
return config.getContainer();
|
||||
Container container = config.getContainer();
|
||||
ContainerHolder.store(container);
|
||||
return container;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.Result;
|
||||
import com.opensymphony.xwork2.util.TextParseUtil;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -35,64 +37,65 @@ import java.util.Map;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
*
|
||||
* <p/>
|
||||
* A custom Result type for setting HTTP headers and status by optionally evaluating against the ValueStack.
|
||||
* This result can also be used to send and error to the client.
|
||||
*
|
||||
* This result can also be used to send and error to the client. All the parameters can be evaluated against the ValueStack.
|
||||
* <p/>
|
||||
* <!-- END SNIPPET: description -->
|
||||
* <p/>
|
||||
* <b>This result type takes the following parameters:</b>
|
||||
*
|
||||
* <p/>
|
||||
* <!-- START SNIPPET: params -->
|
||||
*
|
||||
* <p/>
|
||||
* <ul>
|
||||
*
|
||||
* <p/>
|
||||
* <li><b>status</b> - the http servlet response status code that should be set on a response.</li>
|
||||
*
|
||||
* <p/>
|
||||
* <li><b>parse</b> - true by default. If set to false, the headers param will not be parsed for Ognl expressions.</li>
|
||||
*
|
||||
* <p/>
|
||||
* <li><b>headers</b> - header values.</li>
|
||||
*
|
||||
* <p/>
|
||||
* <li><b>error</b> - the http servlet response error code that should be set on a response.</li>
|
||||
*
|
||||
* <p/>
|
||||
* <li><b>errorMessage</b> - error message to be set on response if 'error' is set.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p/>
|
||||
* <!-- END SNIPPET: params -->
|
||||
*
|
||||
* <p/>
|
||||
* <b>Example:</b>
|
||||
*
|
||||
* <p/>
|
||||
* <pre><!-- START SNIPPET: example -->
|
||||
* <result name="success" type="httpheader">
|
||||
* <param name="status">204</param>
|
||||
* <param name="headers.a">a custom header value</param>
|
||||
* <param name="headers.b">another custom header value</param>
|
||||
* </result>
|
||||
*
|
||||
* <p/>
|
||||
* <result name="proxyRequired" type="httpheader">
|
||||
* <param name="error">305</param>
|
||||
* <param name="errorMessage">this action must be accessed through a prozy</param>
|
||||
* </result>
|
||||
* <!-- END SNIPPET: example --></pre>
|
||||
*
|
||||
*/
|
||||
public class HttpHeaderResult implements Result {
|
||||
|
||||
private static final long serialVersionUID = 195648957144219214L;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(HttpHeaderResult.class);
|
||||
|
||||
/** The default parameter */
|
||||
public static final String DEFAULT_PARAM = "status";
|
||||
|
||||
/**
|
||||
* This result type doesn't have a default param, null is ok to reduce noice in logs
|
||||
*/
|
||||
public static final String DEFAULT_PARAM = null;
|
||||
|
||||
private boolean parse = true;
|
||||
private Map<String,String> headers;
|
||||
private Map<String, String> headers;
|
||||
private int status = -1;
|
||||
private int error = -1;
|
||||
private String error = null;
|
||||
private String errorMessage;
|
||||
|
||||
|
||||
public HttpHeaderResult() {
|
||||
super();
|
||||
headers = new HashMap<String,String>();
|
||||
headers = new HashMap<String, String>();
|
||||
}
|
||||
|
||||
public HttpHeaderResult(int status) {
|
||||
@@ -101,20 +104,19 @@ public class HttpHeaderResult implements Result {
|
||||
this.parse = false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the http servlet error code that should be set on the reponse
|
||||
*
|
||||
* Sets the http servlet error code that should be set on the response
|
||||
*
|
||||
* @param error the Http error code
|
||||
* @see javax.servlet.http.HttpServletResponse#sendError(int)
|
||||
*/
|
||||
public void setError(int error) {
|
||||
public void setError(String error) {
|
||||
this.error = error;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the error message that should be set on the reponse
|
||||
*
|
||||
*
|
||||
* @param errorMessage error message send to the client
|
||||
* @see javax.servlet.http.HttpServletResponse#sendError(int, String)
|
||||
*/
|
||||
@@ -134,7 +136,7 @@ public class HttpHeaderResult implements Result {
|
||||
/**
|
||||
* Sets whether or not the HTTP header values should be evaluated against the ValueStack (by default they are).
|
||||
*
|
||||
* @param parse <tt>true</tt> if HTTP header values should be evaluated agains the ValueStack, <tt>false</tt>
|
||||
* @param parse <tt>true</tt> if HTTP header values should be evaluated against the ValueStack, <tt>false</tt>
|
||||
* otherwise.
|
||||
*/
|
||||
public void setParse(boolean parse) {
|
||||
@@ -157,7 +159,8 @@ public class HttpHeaderResult implements Result {
|
||||
|
||||
/**
|
||||
* Adds an HTTP header to the response
|
||||
* @param name header name
|
||||
*
|
||||
* @param name header name
|
||||
* @param value header value
|
||||
*/
|
||||
public void addHeader(String name, String value) {
|
||||
@@ -174,24 +177,35 @@ public class HttpHeaderResult implements Result {
|
||||
public void execute(ActionInvocation invocation) throws Exception {
|
||||
HttpServletResponse response = ServletActionContext.getResponse();
|
||||
ValueStack stack = ActionContext.getContext().getValueStack();
|
||||
|
||||
|
||||
if (status != -1) {
|
||||
response.setStatus(status);
|
||||
} else if (error != -1) {
|
||||
if (errorMessage != null) {
|
||||
String finalMessage = parse ? TextParseUtil.translateVariables(
|
||||
errorMessage, stack) : errorMessage;
|
||||
response.sendError(error, finalMessage);
|
||||
} else
|
||||
response.sendError(error);
|
||||
}
|
||||
|
||||
if (headers != null) {
|
||||
for (Map.Entry<String, String> stringStringEntry : headers.entrySet()) {
|
||||
Map.Entry entry = (Map.Entry) stringStringEntry;
|
||||
String value = (String) entry.getValue();
|
||||
for (Map.Entry<String, String> entry : headers.entrySet()) {
|
||||
String value = entry.getValue();
|
||||
String finalValue = parse ? TextParseUtil.translateVariables(value, stack) : value;
|
||||
response.addHeader((String) entry.getKey(), finalValue);
|
||||
response.addHeader(entry.getKey(), finalValue);
|
||||
}
|
||||
}
|
||||
|
||||
if (status == -1 && error != null) {
|
||||
int errorCode = -1;
|
||||
try {
|
||||
errorCode = Integer.parseInt(parse ? TextParseUtil.translateVariables(error, stack) : error);
|
||||
} catch (Exception e) {
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error("Cannot parse errorCode [#0] value as Integer!", e, error);
|
||||
}
|
||||
}
|
||||
if (errorCode != -1) {
|
||||
if (errorMessage != null) {
|
||||
String finalMessage = parse ? TextParseUtil.translateVariables(errorMessage, stack) : errorMessage;
|
||||
response.sendError(errorCode, finalMessage);
|
||||
} else {
|
||||
response.sendError(errorCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,8 +198,9 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
|
||||
if (resultConfig != null) {
|
||||
Map<String, String> resultConfigParams = resultConfig.getParams();
|
||||
|
||||
List<String> prohibitedResultParams = getProhibitedResultParams();
|
||||
for (Map.Entry<String, String> e : resultConfigParams.entrySet()) {
|
||||
if (!getProhibitedResultParams().contains(e.getKey())) {
|
||||
if (!prohibitedResultParams.contains(e.getKey())) {
|
||||
String potentialValue = e.getValue() == null ? "" : conditionalParse(e.getValue(), invocation);
|
||||
if (!suppressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0))) {
|
||||
requestParameters.put(e.getKey(), potentialValue);
|
||||
@@ -227,7 +228,18 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
|
||||
}
|
||||
|
||||
protected List<String> getProhibitedResultParams() {
|
||||
return Arrays.asList(DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location", "prependServletContext", "suppressEmptyParameters", "anchor");
|
||||
return Arrays.asList(
|
||||
DEFAULT_PARAM,
|
||||
"namespace",
|
||||
"method",
|
||||
"encode",
|
||||
"parse",
|
||||
"location",
|
||||
"prependServletContext",
|
||||
"suppressEmptyParameters",
|
||||
"anchor",
|
||||
"statusCode"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
* <bean name="myContentLoader" type="org.apache.struts2.dispatcher" class="com.company.struts.MyContentLoader"/>
|
||||
* <constant name="struts.staticContentLoader" value="myContentLoader"/>
|
||||
*
|
||||
* Check {@link org.apache.struts2.config.BeanSelectionProvider} for more details.
|
||||
*/
|
||||
public interface StaticContentLoader {
|
||||
|
||||
|
||||
@@ -197,13 +197,13 @@ public abstract class StrutsResultSupport implements Result, StrutsStatics {
|
||||
if (parse && param != null && invocation != null) {
|
||||
return TextParseUtil.translateVariables(param, invocation.getStack(),
|
||||
new TextParseUtil.ParsedValueEvaluator() {
|
||||
public Object evaluate(Object parsedValue) {
|
||||
public Object evaluate(String parsedValue) {
|
||||
if (encode) {
|
||||
if (parsedValue != null) {
|
||||
try {
|
||||
// use UTF-8 as this is the recommended encoding by W3C to
|
||||
// avoid incompatibilities.
|
||||
return URLEncoder.encode(parsedValue.toString(), "UTF-8");
|
||||
return URLEncoder.encode(parsedValue, "UTF-8");
|
||||
}
|
||||
catch(UnsupportedEncodingException e) {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
|
||||
@@ -159,15 +159,15 @@ public class VelocityResult extends StrutsResultSupport {
|
||||
// to do it all the time (WW-829). Since Velocity support is being deprecated, we'll oblige :)
|
||||
writer.flush();
|
||||
} catch (Exception e) {
|
||||
LOG.error("Unable to render Velocity Template, '" + finalLocation + "'", e);
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error("Unable to render Velocity Template, '#0'", e, finalLocation);
|
||||
}
|
||||
throw e;
|
||||
} finally {
|
||||
if (usedJspFactory) {
|
||||
jspFactory.releasePageContext(pageContext);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,18 +21,16 @@
|
||||
|
||||
package org.apache.struts2.dispatcher.mapper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import com.opensymphony.xwork2.config.ConfigurationManager;
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
@@ -88,12 +86,11 @@ public class CompositeActionMapper implements ActionMapper {
|
||||
protected Container container;
|
||||
|
||||
protected List<ActionMapper> actionMappers = new ArrayList<ActionMapper>();
|
||||
|
||||
@Inject
|
||||
public void setContainer(Container container) {
|
||||
|
||||
public CompositeActionMapper(@Inject Container container) {
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_MAPPER_COMPOSITE)
|
||||
public void setActionMappers(String list) {
|
||||
if (list != null) {
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.opensymphony.xwork2.config.ConfigurationManager;
|
||||
import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.struts2.RequestUtils;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
@@ -37,7 +38,6 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -163,19 +163,13 @@ import java.util.Set;
|
||||
public class DefaultActionMapper implements ActionMapper {
|
||||
|
||||
protected static final String METHOD_PREFIX = "method:";
|
||||
|
||||
protected static final String ACTION_PREFIX = "action:";
|
||||
|
||||
protected static final String REDIRECT_PREFIX = "redirect:";
|
||||
|
||||
protected static final String REDIRECT_ACTION_PREFIX = "redirectAction:";
|
||||
|
||||
protected boolean allowDynamicMethodCalls = true;
|
||||
|
||||
protected boolean allowSlashesInActionNames = false;
|
||||
|
||||
protected boolean alwaysSelectFullNamespace = false;
|
||||
|
||||
protected PrefixTrie prefixTrie = null;
|
||||
|
||||
protected List<String> extensions = new ArrayList<String>() {{
|
||||
@@ -292,14 +286,16 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
return parseActionName(mapping);
|
||||
}
|
||||
|
||||
public boolean isSlashesInActionNames() {
|
||||
return allowSlashesInActionNames;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.apache.struts2.dispatcher.mapper.ActionMapper#getMapping(javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
|
||||
public ActionMapping getMapping(HttpServletRequest request,
|
||||
ConfigurationManager configManager) {
|
||||
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
|
||||
ActionMapping mapping = new ActionMapping();
|
||||
String uri = getUri(request);
|
||||
|
||||
@@ -312,21 +308,13 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
}
|
||||
|
||||
parseNameAndNamespace(uri, mapping, configManager);
|
||||
|
||||
handleSpecialParameters(request, mapping);
|
||||
|
||||
if (mapping.getName() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
parseActionName(mapping);
|
||||
|
||||
return mapping;
|
||||
return parseActionName(mapping);
|
||||
}
|
||||
|
||||
protected ActionMapping parseActionName(ActionMapping mapping) {
|
||||
if (mapping.getName() == null) {
|
||||
return mapping;
|
||||
return null;
|
||||
}
|
||||
if (allowDynamicMethodCalls) {
|
||||
// handle "name!method" convention.
|
||||
@@ -348,14 +336,12 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
* @param request The request
|
||||
* @param mapping The action mapping
|
||||
*/
|
||||
public void handleSpecialParameters(HttpServletRequest request,
|
||||
ActionMapping mapping) {
|
||||
public void handleSpecialParameters(HttpServletRequest request, ActionMapping mapping) {
|
||||
// handle special parameter prefixes.
|
||||
Set<String> uniqueParameters = new HashSet<String>();
|
||||
Map parameterMap = request.getParameterMap();
|
||||
for (Iterator iterator = parameterMap.keySet().iterator(); iterator
|
||||
.hasNext();) {
|
||||
String key = (String) iterator.next();
|
||||
for (Object o : parameterMap.keySet()) {
|
||||
String key = (String) o;
|
||||
|
||||
// Strip off the image button location info, if found
|
||||
if (key.endsWith(".x") || key.endsWith(".y")) {
|
||||
@@ -364,8 +350,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
|
||||
// Ensure a parameter doesn't get processed twice
|
||||
if (!uniqueParameters.contains(key)) {
|
||||
ParameterAction parameterAction = (ParameterAction) prefixTrie
|
||||
.get(key);
|
||||
ParameterAction parameterAction = (ParameterAction) prefixTrie.get(key);
|
||||
if (parameterAction != null) {
|
||||
parameterAction.execute(key, mapping);
|
||||
uniqueParameters.add(key);
|
||||
@@ -381,8 +366,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
* @param uri The uri
|
||||
* @param mapping The action mapping to populate
|
||||
*/
|
||||
protected void parseNameAndNamespace(String uri, ActionMapping mapping,
|
||||
ConfigurationManager configManager) {
|
||||
protected void parseNameAndNamespace(String uri, ActionMapping mapping, ConfigurationManager configManager) {
|
||||
String namespace, name;
|
||||
int lastSlash = uri.lastIndexOf("/");
|
||||
if (lastSlash == -1) {
|
||||
@@ -425,7 +409,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
}
|
||||
}
|
||||
|
||||
if (!allowSlashesInActionNames && name != null) {
|
||||
if (!allowSlashesInActionNames) {
|
||||
int pos = name.lastIndexOf('/');
|
||||
if (pos > -1 && pos < name.length() - 1) {
|
||||
name = name.substring(pos + 1);
|
||||
@@ -441,7 +425,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
*
|
||||
* @param name The action name
|
||||
* @return The action name without its extension
|
||||
* @deprecated Since 2.1, use {@link #dropExtension(java.lang.String,org.apache.struts2.dispatcher.mapper.ActionMapping)} instead
|
||||
* @deprecated Since 2.1, use {@link #dropExtension(java.lang.String, org.apache.struts2.dispatcher.mapper.ActionMapping)} instead
|
||||
*/
|
||||
protected String dropExtension(String name) {
|
||||
return dropExtension(name, new ActionMapping());
|
||||
@@ -486,7 +470,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
if (extensions == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (String) extensions.get(0);
|
||||
return extensions.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -518,29 +502,64 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
*
|
||||
* @see org.apache.struts2.dispatcher.mapper.ActionMapper#getUriFromActionMapping(org.apache.struts2.dispatcher.mapper.ActionMapping)
|
||||
*/
|
||||
|
||||
public String getUriFromActionMapping(ActionMapping mapping) {
|
||||
StringBuilder uri = new StringBuilder();
|
||||
|
||||
handleNamespace(mapping, uri);
|
||||
handleName(mapping, uri);
|
||||
handleDynamicMethod(mapping, uri);
|
||||
handleExtension(mapping, uri);
|
||||
handleParams(mapping, uri);
|
||||
|
||||
return uri.toString();
|
||||
}
|
||||
|
||||
protected void handleNamespace(ActionMapping mapping, StringBuilder uri) {
|
||||
if (mapping.getNamespace() != null) {
|
||||
uri.append(mapping.getNamespace());
|
||||
if (!"/".equals(mapping.getNamespace())) {
|
||||
uri.append("/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void handleName(ActionMapping mapping, StringBuilder uri) {
|
||||
String name = mapping.getName();
|
||||
String params = "";
|
||||
if (name.indexOf('?') != -1) {
|
||||
params = name.substring(name.indexOf('?'));
|
||||
name = name.substring(0, name.indexOf('?'));
|
||||
}
|
||||
uri.append(name);
|
||||
}
|
||||
|
||||
if (null != mapping.getMethod() && !"".equals(mapping.getMethod())) {
|
||||
uri.append("!").append(mapping.getMethod());
|
||||
protected void handleDynamicMethod(ActionMapping mapping, StringBuilder uri) {
|
||||
// See WW-3965
|
||||
if (StringUtils.isNotEmpty(mapping.getMethod())) {
|
||||
if (allowDynamicMethodCalls) {
|
||||
// handle "name!method" convention.
|
||||
String name = mapping.getName();
|
||||
if (!name.contains("!")) {
|
||||
// Append the method as no bang found
|
||||
uri.append("!").append(mapping.getMethod());
|
||||
}
|
||||
} else {
|
||||
uri.append("!").append(mapping.getMethod());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String extension = mapping.getExtension();
|
||||
protected void handleExtension(ActionMapping mapping, StringBuilder uri) {
|
||||
String extension = lookupExtension(mapping.getExtension());
|
||||
|
||||
if (extension != null) {
|
||||
if (extension.length() == 0 || (extension.length() > 0 && uri.indexOf('.' + extension) == -1)) {
|
||||
if (extension.length() > 0) {
|
||||
uri.append(".").append(extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected String lookupExtension(String extension) {
|
||||
if (extension == null) {
|
||||
// Look for the current extension, if available
|
||||
ActionContext context = ActionContext.getContext();
|
||||
@@ -554,24 +573,18 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
extension = getDefaultExtension();
|
||||
}
|
||||
}
|
||||
return extension;
|
||||
}
|
||||
|
||||
if (extension != null) {
|
||||
if (extension.length() == 0 || (extension.length() > 0 && uri.indexOf('.' + extension) == -1)) {
|
||||
if (extension.length() > 0) {
|
||||
uri.append(".").append(extension);
|
||||
}
|
||||
}
|
||||
protected void handleParams(ActionMapping mapping, StringBuilder uri) {
|
||||
String name = mapping.getName();
|
||||
String params = "";
|
||||
if (name.indexOf('?') != -1) {
|
||||
params = name.substring(name.indexOf('?'));
|
||||
}
|
||||
if (params.length() > 0) {
|
||||
uri.append(params);
|
||||
}
|
||||
|
||||
return uri.toString();
|
||||
}
|
||||
|
||||
|
||||
public boolean isSlashesInActionNames() {
|
||||
return allowSlashesInActionNames;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+84
-82
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,77 +21,20 @@
|
||||
|
||||
package org.apache.struts2.dispatcher.mapper;
|
||||
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import com.opensymphony.xwork2.config.ConfigurationManager;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
*
|
||||
* Improved restful action mapper that adds several ReST-style improvements to
|
||||
* action mapping, but supports fully-customized URL's via XML. The two primary
|
||||
* ReST enhancements are:
|
||||
* <ul>
|
||||
* <li>If the method is not specified (via '!' or 'method:' prefix), the method is
|
||||
* "guessed" at using ReST-style conventions that examine the URL and the HTTP
|
||||
* method.</li>
|
||||
* <li>Parameters are extracted from the action name, if parameter name/value pairs
|
||||
* are specified using PARAM_NAME/PARAM_VALUE syntax.
|
||||
* </ul>
|
||||
* <p>
|
||||
* These two improvements allow a GET request for 'category/action/movie/Thrillers' to
|
||||
* be mapped to the action name 'movie' with an id of 'Thrillers' with an extra parameter
|
||||
* named 'category' with a value of 'action'. A single action mapping can then handle
|
||||
* all CRUD operations using wildcards, e.g.
|
||||
* </p>
|
||||
* <pre>
|
||||
* <action name="movie/*" className="app.MovieAction">
|
||||
* <param name="id">{0}</param>
|
||||
* ...
|
||||
* </action>
|
||||
* </pre>
|
||||
* <p>
|
||||
* This mapper supports the following parameters:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li><code>struts.mapper.idParameterName</code> - If set, this value will be the name
|
||||
* of the parameter under which the id is stored. The id will then be removed
|
||||
* from the action name. This allows restful actions to not require wildcards.
|
||||
* </li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* The following URL's will invoke its methods:
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li><code>GET: /movie/ => method="index"</code></li>
|
||||
* <li><code>GET: /movie/Thrillers => method="view", id="Thrillers"</code></li>
|
||||
* <li><code>GET: /movie/Thrillers!edit => method="edit", id="Thrillers"</code></li>
|
||||
* <li><code>GET: /movie/new => method="editNew"</code></li>
|
||||
* <li><code>POST: /movie/ => method="create"</code></li>
|
||||
* <li><code>PUT: /movie/Thrillers => method="update", id="Thrillers"</code></li>
|
||||
* <li><code>DELETE: /movie/Thrillers => method="remove", id="Thrillers"</code></li>
|
||||
* </ul>
|
||||
* <p>
|
||||
* To simulate the HTTP methods PUT and DELETE, since they aren't supported by HTML,
|
||||
* the HTTP parameter "__http_method" will be used.
|
||||
* </p>
|
||||
* <p>
|
||||
* The syntax and design for this feature was inspired by the ReST support in Ruby on Rails.
|
||||
* See <a href="http://ryandaigle.com/articles/2006/08/01/whats-new-in-edge-rails-simply-restful-support-and-how-to-use-it">
|
||||
* http://ryandaigle.com/articles/2006/08/01/whats-new-in-edge-rails-simply-restful-support-and-how-to-use-it
|
||||
* </a>
|
||||
* </p>
|
||||
*
|
||||
* <!-- END SNIPPET: description -->
|
||||
* Extended version of {@link RestfulActionMapper}, see documentation for more details
|
||||
* http://struts.apache.org/2.x/docs/restfulactionmapper.html
|
||||
*/
|
||||
public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
|
||||
@@ -102,7 +45,6 @@ public class Restful2ActionMapper extends DefaultActionMapper {
|
||||
public Restful2ActionMapper() {
|
||||
setSlashesInActionNames("true");
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -21,47 +21,21 @@
|
||||
|
||||
package org.apache.struts2.dispatcher.mapper;
|
||||
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.struts2.RequestUtils;
|
||||
|
||||
import com.opensymphony.xwork2.config.ConfigurationManager;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.struts2.RequestUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
*
|
||||
* A custom action mapper using the following format:
|
||||
* <p/>
|
||||
* <p/>
|
||||
* <ul><tt>http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2</tt></ul>
|
||||
* <p/>
|
||||
* You can have as many parameters you'd like to use. Alternatively the URL can be shortened to the following:
|
||||
* <p/>
|
||||
* <ul><tt>http://HOST/ACTION_NAME/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2</tt></ul>
|
||||
* <p/>
|
||||
* This is the same as:
|
||||
* <p/>
|
||||
* <ul><tt>http://HOST/ACTION_NAME/ACTION_NAME + "Id"/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2</tt></ul>
|
||||
* <p/>
|
||||
* Suppose for example we would like to display some articles by id at using the following URL sheme:
|
||||
* <p/>
|
||||
* <ul><tt>http://HOST/article/Id</tt></ul>
|
||||
* <p/>
|
||||
* <p/>
|
||||
* Your action just needs a setArticleId() method, and requests such as /article/1, /article/2, etc will all map
|
||||
* to that URL pattern.
|
||||
*
|
||||
* <!-- END SNIPPET: description -->
|
||||
*
|
||||
* Simple Restfull Action Mapper to support REST application
|
||||
* See docs for more information
|
||||
* http://struts.apache.org/2.x/docs/restfulactionmapper.html
|
||||
*/
|
||||
public class RestfulActionMapper implements ActionMapper {
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(RestfulActionMapper.class);
|
||||
|
||||
@@ -133,8 +133,7 @@ public class PrepareOperations {
|
||||
// parameters might not be accessible through before encoding (ww-1278)
|
||||
request = dispatcher.wrapRequest(request, servletContext);
|
||||
} catch (IOException e) {
|
||||
String message = "Could not wrap servlet request with MultipartRequestWrapper!";
|
||||
throw new ServletException(message, e);
|
||||
throw new ServletException("Could not wrap servlet request with MultipartRequestWrapper!", e);
|
||||
}
|
||||
return request;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -117,7 +117,9 @@ public class StrutsUtil {
|
||||
return responseWrapper.getData();
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Cannot include #0", e, aName.toString());
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -126,6 +128,9 @@ public class StrutsUtil {
|
||||
try {
|
||||
return URLEncoder.encode(s, "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Cannot encode URL [#0]", e, s);
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
|
||||
package org.apache.struts2.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* A bean that takes an iterator and outputs a subset of it.
|
||||
@@ -168,7 +168,8 @@ public class SubsetIteratorFilter extends IteratorFilterSupport implements Itera
|
||||
}
|
||||
catch(Exception e) {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("decider ["+decider+"] encountered an error while decide adding element ["+element+"], element will be ignored, it will not appeared in subseted iterator", e);
|
||||
LOG.warn("Decider [#0] encountered an error while decide adding element [#1], element will be ignored, it will not appeared in subseted iterator",
|
||||
e, decider.toString(), element.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
|
||||
package org.apache.struts2.util;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.util.LocalizedTextUtil;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* TokenHelper
|
||||
*
|
||||
@@ -90,8 +90,10 @@ public class TokenHelper {
|
||||
session.put(buildTokenSessionAttributeName(tokenName), token);
|
||||
} catch ( IllegalStateException e ) {
|
||||
// WW-1182 explain to user what the problem is
|
||||
String msg = "Error creating HttpSession due response is commited to client. You can use the CreateSessionInterceptor or create the HttpSession from your action before the result is rendered to the client: " + e.getMessage();
|
||||
LOG.error(msg, e);
|
||||
String msg = "Error creating HttpSession due response is commited to client. You can use the CreateSessionInterceptor or create the HttpSession from your action before the result is rendered to the client: " + e.getMessage();
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error(msg, e);
|
||||
}
|
||||
throw new IllegalArgumentException(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,14 @@ package org.apache.struts2.util.fs;
|
||||
|
||||
import com.opensymphony.xwork2.util.fs.DefaultFileManager;
|
||||
import com.opensymphony.xwork2.util.fs.FileRevision;
|
||||
import com.opensymphony.xwork2.util.fs.JarEntryRevision;
|
||||
import com.opensymphony.xwork2.util.fs.Revision;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
@@ -44,7 +46,9 @@ public class JBossFileManager extends DefaultFileManager {
|
||||
Class.forName(VFS_JBOSS5);
|
||||
return true;
|
||||
} catch (ClassNotFoundException e) {
|
||||
LOG.debug("Cannot load [#0] class, not a JBoss 5!", VFS_JBOSS7);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Cannot load [#0] class, not a JBoss 5!", VFS_JBOSS5);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -54,7 +58,9 @@ public class JBossFileManager extends DefaultFileManager {
|
||||
Class.forName(VFS_JBOSS7);
|
||||
return true;
|
||||
} catch (ClassNotFoundException e) {
|
||||
LOG.debug("Cannot load [#0] class, not a JBoss 7!", VFS_JBOSS7);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Cannot load [#0] class, not a JBoss 7!", VFS_JBOSS7);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -66,7 +72,18 @@ public class JBossFileManager extends DefaultFileManager {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Creating revision for URL: " + fileName);
|
||||
}
|
||||
Revision revision = FileRevision.build(normalizeToFileProtocol(fileUrl));
|
||||
URL normalizedUrl = normalizeToFileProtocol(fileUrl);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Normalized URL for [#0] is [#1]", fileName, normalizedUrl.toString());
|
||||
}
|
||||
Revision revision;
|
||||
if ("file".equals(normalizedUrl.getProtocol())) {
|
||||
revision = FileRevision.build(normalizedUrl);
|
||||
} else if ("jar".equals(normalizedUrl.getProtocol())) {
|
||||
revision = JarEntryRevision.build(normalizedUrl);
|
||||
} else {
|
||||
revision = Revision.build(normalizedUrl);
|
||||
}
|
||||
files.put(fileName, revision);
|
||||
} else {
|
||||
super.monitorFile(fileUrl);
|
||||
@@ -79,7 +96,9 @@ public class JBossFileManager extends DefaultFileManager {
|
||||
try {
|
||||
return getJBossPhysicalUrl(url);
|
||||
} catch (IOException e) {
|
||||
LOG.error(e.getMessage(), e);
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error(e.getMessage(), e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
@@ -116,46 +135,75 @@ public class JBossFileManager extends DefaultFileManager {
|
||||
*/
|
||||
protected URL getJBossPhysicalUrl(URL url) throws IOException {
|
||||
Object content = url.openConnection().getContent();
|
||||
try {
|
||||
String s = content.getClass().toString();
|
||||
if (s.startsWith("class org.jboss.vfs.VirtualFile")) { // JBoss 7 and probably 6
|
||||
File physicalFile = readJBossPhysicalFile(content);
|
||||
return physicalFile.toURI().toURL();
|
||||
} else if (s.startsWith("class org.jboss.virtual.VirtualFile")) { // JBoss 5
|
||||
String fileName = url.toExternalForm();
|
||||
return new URL("file", null, fileName.substring(fileName.indexOf(":") + 1));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Error calling getPhysicalFile() on JBoss VirtualFile.", e);
|
||||
String classContent = content.getClass().toString();
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Reading physical URL for [#0]", url.toString());
|
||||
}
|
||||
if (classContent.startsWith("class org.jboss.vfs.VirtualFile")) { // JBoss 7 and probably 6
|
||||
File physicalFile = readJBossPhysicalFile(content);
|
||||
return physicalFile.toURI().toURL();
|
||||
} else if (classContent.startsWith("class org.jboss.virtual.VirtualFile")) { // JBoss 5
|
||||
return readJBoss5Url(content);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
private File readJBossPhysicalFile(Object content) throws Exception {
|
||||
Method method = content.getClass().getDeclaredMethod("getPhysicalFile");
|
||||
return (File) method.invoke(content);
|
||||
}
|
||||
|
||||
private List<URL> getAllJBossPhysicalUrls(URL url) throws IOException {
|
||||
List<URL> urls = new ArrayList<URL>();
|
||||
Object content = url.openConnection().getContent();
|
||||
try {
|
||||
if (content.getClass().toString().startsWith("class org.jboss.vfs.VirtualFile")) {
|
||||
File physicalFile = readJBossPhysicalFile(content);
|
||||
String classContent = content.getClass().toString();
|
||||
if (classContent.startsWith("class org.jboss.vfs.VirtualFile")) {
|
||||
File physicalFile = readJBossPhysicalFile(content);
|
||||
if (physicalFile != null) {
|
||||
readFile(urls, physicalFile);
|
||||
readFile(urls, physicalFile.getParentFile());
|
||||
} else {
|
||||
urls.add(url);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOG.warn("Error calling getPhysicalFile() on JBoss VirtualFile!", e);
|
||||
} else if (classContent.startsWith("class org.jboss.virtual.VirtualFile")) {
|
||||
URL physicalUrl = readJBoss5Url(content);
|
||||
if (physicalUrl != null) {
|
||||
urls.add(physicalUrl);
|
||||
}
|
||||
} else {
|
||||
urls.add(url);
|
||||
}
|
||||
return urls;
|
||||
}
|
||||
|
||||
private File readJBossPhysicalFile(Object content) {
|
||||
try {
|
||||
Method method = content.getClass().getDeclaredMethod("getPhysicalFile");
|
||||
return (File) method.invoke(content);
|
||||
} catch (NoSuchMethodException e) {
|
||||
LOG.error("Provided class content [#0] is not a JBoss VirtualFile, getPhysicalFile() method not found!", e, content.getClass().getSimpleName());
|
||||
} catch (InvocationTargetException e) {
|
||||
LOG.error("Cannot invoke getPhysicalFile() method!", e);
|
||||
} catch (IllegalAccessException e) {
|
||||
LOG.error("Cannot access getPhysicalFile() method!", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private URL readJBoss5Url(Object content) {
|
||||
try {
|
||||
Method method = content.getClass().getDeclaredMethod("getHandler");
|
||||
method.setAccessible(true);
|
||||
Object handler = method.invoke(content);
|
||||
method = handler.getClass().getMethod("getRealURL");
|
||||
return (URL) method.invoke(handler);
|
||||
} catch (NoSuchMethodException e) {
|
||||
LOG.error("Provided class content [#0] is not a JBoss VirtualFile, getHandler() or getRealURL() method not found!", e, content.getClass().getSimpleName());
|
||||
} catch (InvocationTargetException e) {
|
||||
LOG.error("Cannot invoke getHandler() or getRealURL() method!", e);
|
||||
} catch (IllegalAccessException e) {
|
||||
LOG.error("Cannot access getHandler() or getRealURL() method!", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void readFile(List<URL> urls, File physicalFile) throws MalformedURLException {
|
||||
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()) {
|
||||
|
||||
@@ -253,7 +253,9 @@ public class FreemarkerManager {
|
||||
try {
|
||||
init(servletContext);
|
||||
} catch (TemplateException e) {
|
||||
LOG.error("Cannot load freemarker configuration: ",e);
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error("Cannot load freemarker configuration: ",e);
|
||||
}
|
||||
}
|
||||
// config = createConfiguration(servletContext);
|
||||
|
||||
@@ -409,7 +411,9 @@ public class FreemarkerManager {
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOG.error("Invalid template path specified: " + e.getMessage(), e);
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error("Invalid template path specified: #0", e, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// presume that most apps will require the class and webapp template loader
|
||||
@@ -459,9 +463,13 @@ public class FreemarkerManager {
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
|
||||
}
|
||||
} catch (TemplateException e) {
|
||||
LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
|
||||
}
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
|
||||
@@ -26,6 +26,8 @@ import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.LocaleProvider;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.ObjectWrapper;
|
||||
import freemarker.template.Template;
|
||||
@@ -103,6 +105,8 @@ public class FreemarkerResult extends StrutsResultSupport {
|
||||
|
||||
private static final long serialVersionUID = -3778230771704661631L;
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(FreemarkerResult.class);
|
||||
|
||||
protected ActionInvocation invocation;
|
||||
protected Configuration configuration;
|
||||
protected ObjectWrapper wrapper;
|
||||
@@ -191,6 +195,16 @@ public class FreemarkerResult extends StrutsResultSupport {
|
||||
parentCharArrayWriter.flush();
|
||||
parentCharArrayWriter.writeTo(writer);
|
||||
}
|
||||
} catch (TemplateException e) {
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error("Error processing Freemarker result!", e);
|
||||
}
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
if (LOG.isErrorEnabled()){
|
||||
LOG.error("Error processing Freemarker result!", e);
|
||||
}
|
||||
throw e;
|
||||
} finally {
|
||||
if (isTopTemplate && parentCharArrayWriter != null) {
|
||||
req.removeAttribute(PARENT_TEMPLATE_WRITER);
|
||||
|
||||
@@ -81,11 +81,11 @@ public abstract class TagModel implements TemplateTransformModel {
|
||||
// the value should ALWAYS be a decendant of TemplateModel
|
||||
if (value instanceof TemplateModel) {
|
||||
try {
|
||||
map.put(entry.getKey(), objectWrapper
|
||||
.unwrap((TemplateModel) value));
|
||||
map.put(entry.getKey(), objectWrapper.unwrap((TemplateModel) value));
|
||||
} catch (TemplateModelException e) {
|
||||
LOG.error("failed to unwrap [" + value
|
||||
+ "] it will be ignored", e);
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error("failed to unwrap [#0] it will be ignored", e, value.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
// if it doesn't, we'll do it the old way by just returning the toString() representation
|
||||
@@ -123,7 +123,9 @@ public abstract class TagModel implements TemplateTransformModel {
|
||||
try {
|
||||
map.put(entry.getKey(), ((SimpleSequence) value).toList());
|
||||
} catch (TemplateModelException e) {
|
||||
LOG.error("There was a problem converting a SimpleSequence to a list", e);
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error("There was a problem converting a SimpleSequence to a list", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,14 +21,13 @@
|
||||
|
||||
package org.apache.struts2.views.jsp;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.jsp.JspException;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.components.IteratorComponent;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.jsp.JspException;
|
||||
|
||||
/**
|
||||
* @see IteratorComponent
|
||||
@@ -93,7 +92,7 @@ public class IteratorTag extends ContextBeanTag {
|
||||
try {
|
||||
bodyContent.writeOut(bodyContent.getEnclosingWriter());
|
||||
} catch (Exception e) {
|
||||
throw new JspException(e.getMessage());
|
||||
throw new JspException(e);
|
||||
}
|
||||
}
|
||||
return SKIP_BODY;
|
||||
|
||||
@@ -46,8 +46,9 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
|
||||
protected String labelSeparator;
|
||||
protected String labelPosition;
|
||||
protected String requiredposition;
|
||||
protected String errorPosition;
|
||||
protected String name;
|
||||
protected String required;
|
||||
protected String requiredLabel;
|
||||
protected String tabindex;
|
||||
protected String value;
|
||||
protected String template;
|
||||
@@ -96,9 +97,10 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
|
||||
uiBean.setLabel(label);
|
||||
uiBean.setLabelSeparator(labelSeparator);
|
||||
uiBean.setLabelposition(labelPosition);
|
||||
uiBean.setRequiredposition(requiredposition);
|
||||
uiBean.setRequiredPosition(requiredposition);
|
||||
uiBean.setErrorPosition(errorPosition);
|
||||
uiBean.setName(name);
|
||||
uiBean.setRequired(required);
|
||||
uiBean.setRequiredLabel(requiredLabel);
|
||||
uiBean.setTabindex(tabindex);
|
||||
uiBean.setValue(value);
|
||||
uiBean.setTemplate(template);
|
||||
@@ -171,12 +173,16 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
|
||||
this.requiredposition = requiredPosition;
|
||||
}
|
||||
|
||||
public void setErrorPosition(String errorPosition) {
|
||||
this.errorPosition = errorPosition;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setRequired(String required) {
|
||||
this.required = required;
|
||||
public void setRequiredLabel(String requiredLabel) {
|
||||
this.requiredLabel = requiredLabel;
|
||||
}
|
||||
|
||||
public void setTabindex(String tabindex) {
|
||||
|
||||
@@ -183,8 +183,9 @@ public class DefaultUrlHelper implements UrlHelper {
|
||||
try {
|
||||
result = encodeResult ? response.encodeURL(result) : result;
|
||||
} catch (Exception ex) {
|
||||
// Could not encode the URL for some reason
|
||||
// Use it unchanged
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Could not encode the URL for some reason, use it unchanged", ex);
|
||||
}
|
||||
result = link.toString();
|
||||
}
|
||||
|
||||
@@ -240,47 +241,45 @@ public class DefaultUrlHelper implements UrlHelper {
|
||||
|
||||
private String buildParameterSubstring(String name, String value) {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append(translateAndEncode(name));
|
||||
builder.append(encode(name));
|
||||
builder.append('=');
|
||||
builder.append(translateAndEncode(value));
|
||||
builder.append(encode(value));
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Translates any script expressions using {@link com.opensymphony.xwork2.util.TextParseUtil#translateVariables} and
|
||||
* encodes the URL using {@link java.net.URLEncoder#encode} with the encoding specified in the configuration.
|
||||
*
|
||||
* @param input
|
||||
* @return the translated and encoded string
|
||||
*/
|
||||
public String translateAndEncode(String input) {
|
||||
String translatedInput = translateVariable(input);
|
||||
try {
|
||||
return URLEncoder.encode(translatedInput, encoding);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("Could not encode URL parameter '" + input + "', returning value un-encoded");
|
||||
}
|
||||
return translatedInput;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Encodes the URL using {@link java.net.URLEncoder#encode} with the encoding specified in the configuration.
|
||||
*
|
||||
* @param input the input to encode
|
||||
* @return the encoded string
|
||||
*/
|
||||
public String encode( String input ) {
|
||||
try {
|
||||
return URLEncoder.encode(input, encoding);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("Could not encode URL parameter '#0', returning value un-encoded", input);
|
||||
}
|
||||
return input;
|
||||
}
|
||||
}
|
||||
|
||||
public String translateAndDecode(String input) {
|
||||
String translatedInput = translateVariable(input);
|
||||
try {
|
||||
return URLDecoder.decode(translatedInput, encoding);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("Could not encode URL parameter '" + input + "', returning value un-encoded");
|
||||
}
|
||||
return translatedInput;
|
||||
}
|
||||
}
|
||||
|
||||
private String translateVariable(String input) {
|
||||
ValueStack valueStack = ServletActionContext.getContext().getValueStack();
|
||||
return TextParseUtil.translateVariables(input, valueStack);
|
||||
}
|
||||
/**
|
||||
* Decodes the URL using {@link java.net.URLDecoder#decode(String, String)} with the encoding specified in the configuration.
|
||||
*
|
||||
* @param input the input to decode
|
||||
* @return the encoded string
|
||||
*/
|
||||
public String decode( String input ) {
|
||||
try {
|
||||
return URLDecoder.decode(input, encoding);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("Could not decode URL parameter '#0', returning value un-decoded", input);
|
||||
}
|
||||
return input;
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Object> parseQueryString(String queryString, boolean forceValueArray) {
|
||||
Map<String, Object> queryParams = new LinkedHashMap<String, Object>();
|
||||
@@ -298,8 +297,8 @@ public class DefaultUrlHelper implements UrlHelper {
|
||||
paramValue = tmpParams[1];
|
||||
}
|
||||
if (paramName != null) {
|
||||
paramName = translateAndDecode(paramName);
|
||||
String translatedParamValue = translateAndDecode(paramValue);
|
||||
paramName = decode(paramName);
|
||||
String translatedParamValue = decode(paramValue);
|
||||
|
||||
if (queryParams.containsKey(paramName) || forceValueArray) {
|
||||
// WW-1619 append new param value to existing value(s)
|
||||
|
||||
@@ -46,7 +46,7 @@ public class StrutsResourceLoader extends ClasspathResourceLoader {
|
||||
try {
|
||||
return ClassLoaderUtil.getResourceAsStream(name, StrutsResourceLoader.class);
|
||||
} catch (Exception e) {
|
||||
throw new ResourceNotFoundException(e.getMessage());
|
||||
throw new ResourceNotFoundException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,9 @@ public class VelocityManager {
|
||||
ctx = ServletActionContext.getServletContext();
|
||||
} catch (NullPointerException npe) {
|
||||
// in case this was used outside the lifecycle of struts servlet
|
||||
LOG.debug("internal toolbox context ignored");
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("internal toolbox context ignored");
|
||||
}
|
||||
}
|
||||
|
||||
if (toolboxManager != null && ctx != null) {
|
||||
@@ -454,8 +456,7 @@ public class VelocityManager {
|
||||
try {
|
||||
velocityEngine.init(p);
|
||||
} catch (Exception e) {
|
||||
String gripe = "Unable to instantiate VelocityEngine!";
|
||||
throw new StrutsException(gripe, e);
|
||||
throw new StrutsException("Unable to instantiate VelocityEngine!", e);
|
||||
}
|
||||
|
||||
return velocityEngine;
|
||||
|
||||
@@ -21,10 +21,6 @@
|
||||
|
||||
package org.apache.struts2.views.xslt;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.w3c.dom.Attr;
|
||||
import org.w3c.dom.Document;
|
||||
@@ -33,6 +29,10 @@ import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.Text;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* AdapterFactory produces Node adapters for Java object types.
|
||||
* Adapter classes are generally instantiated dynamically via a no-args constructor
|
||||
@@ -215,11 +215,9 @@ public class AdapterFactory {
|
||||
return adapterNode;
|
||||
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage());
|
||||
throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage(), e);
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage());
|
||||
throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,12 @@
|
||||
|
||||
package org.apache.struts2.views.xslt;
|
||||
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.beans.IntrospectionException;
|
||||
import java.beans.Introspector;
|
||||
import java.beans.PropertyDescriptor;
|
||||
@@ -31,13 +37,6 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.struts2.StrutsException;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
|
||||
|
||||
/**
|
||||
* This class is the most general type of adapter, utilizing reflective introspection to present a DOM view of all of
|
||||
@@ -123,7 +122,9 @@ public class BeanAdapter extends AbstractAdapterElement {
|
||||
} catch (Exception e) {
|
||||
if (e instanceof InvocationTargetException)
|
||||
e = (Exception) ((InvocationTargetException) e).getTargetException();
|
||||
log.error("Cannot access bean property: "+propertyName, e);
|
||||
if (log.isErrorEnabled()) {
|
||||
log.error("Cannot access bean property: #0", e, propertyName);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,17 @@
|
||||
|
||||
package org.apache.struts2.views.xslt;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Writer;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.Result;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.TextParseUtil;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.StrutsException;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.xml.transform.ErrorListener;
|
||||
@@ -40,19 +45,11 @@ import javax.xml.transform.URIResolver;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.StrutsException;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.Result;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.TextParseUtil;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
@@ -398,7 +395,9 @@ public class XSLTResult implements Result {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
LOG.error("Unable to render XSLT Template, '" + location + "'", e);
|
||||
if (LOG.isErrorEnabled()) {
|
||||
LOG.error("Unable to render XSLT Template, '#0'", e, location);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="struts" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default"/>
|
||||
<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="jakarta" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default" />
|
||||
<constant name="struts.multipart.handler" value="jakarta" />
|
||||
<constant name="struts.multipart.parser" value="jakarta" />
|
||||
|
||||
<bean type="org.apache.struts2.views.TagLibrary" name="s" class="org.apache.struts2.views.DefaultTagLibrary" />
|
||||
|
||||
@@ -65,6 +65,12 @@
|
||||
<bean type="org.apache.struts2.components.template.TemplateEngine" name="jsp" class="org.apache.struts2.components.template.JspTemplateEngine" />
|
||||
|
||||
<bean type="com.opensymphony.xwork2.conversion.impl.XWorkConverter" name="struts" class="com.opensymphony.xwork2.conversion.impl.XWorkConverter" />
|
||||
<bean type="com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor" name="struts" class="com.opensymphony.xwork2.conversion.impl.DefaultConversionPropertiesProcessor" />
|
||||
<bean type="com.opensymphony.xwork2.conversion.ConversionFileProcessor" name="struts" class="com.opensymphony.xwork2.conversion.impl.DefaultConversionFileProcessor" />
|
||||
<bean type="com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor" name="struts" class="com.opensymphony.xwork2.conversion.impl.DefaultConversionAnnotationProcessor" />
|
||||
<bean type="com.opensymphony.xwork2.conversion.TypeConverterCreator" name="struts" class="com.opensymphony.xwork2.conversion.impl.DefaultTypeConverterCreator" />
|
||||
<bean type="com.opensymphony.xwork2.conversion.TypeConverterHolder" name="struts" class="com.opensymphony.xwork2.conversion.impl.DefaultTypeConverterHolder" />
|
||||
|
||||
<bean class="com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter" />
|
||||
|
||||
<bean type="com.opensymphony.xwork2.conversion.impl.CollectionConverter" name="struts" class="com.opensymphony.xwork2.conversion.impl.CollectionConverter" scope="singleton"/>
|
||||
@@ -94,6 +100,8 @@
|
||||
|
||||
<bean class="com.opensymphony.xwork2.ognl.OgnlUtil" />
|
||||
|
||||
<bean type="com.opensymphony.xwork2.util.TextParser" name="struts" class="com.opensymphony.xwork2.util.OgnlTextParser" scope="singleton"/>
|
||||
|
||||
<bean type="ognl.PropertyAccessor" name="com.opensymphony.xwork2.util.CompoundRoot" class="com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor" />
|
||||
<bean type="ognl.PropertyAccessor" name="java.lang.Object" class="com.opensymphony.xwork2.ognl.accessor.ObjectAccessor" />
|
||||
<bean type="ognl.PropertyAccessor" name="java.util.Iterator" class="com.opensymphony.xwork2.ognl.accessor.XWorkIteratorPropertyAccessor" />
|
||||
|
||||
@@ -27,4 +27,20 @@ ${parameters.after?if_exists}<#t/>
|
||||
<#else>
|
||||
</span> <#rt/>
|
||||
</#if>
|
||||
</div>
|
||||
<#if parameters.errorposition?default("top") == 'bottom'>
|
||||
<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/>
|
||||
<#if hasFieldErrors>
|
||||
<div <#rt/><#if parameters.id??>id="wwerr_${parameters.id}"<#rt/></#if> class="wwerr">
|
||||
<#list fieldErrors[parameters.name] as error>
|
||||
<div<#rt/>
|
||||
<#if parameters.id??>
|
||||
errorFor="${parameters.id}"<#rt/>
|
||||
</#if>
|
||||
class="errorMessage">
|
||||
${error?html}
|
||||
</div><#t/>
|
||||
</#list>
|
||||
</div><#t/>
|
||||
</#if>
|
||||
</#if>
|
||||
</div>
|
||||
@@ -27,6 +27,7 @@
|
||||
<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/>
|
||||
<div <#rt/><#if parameters.id??>id="wwgrp_${parameters.id}"<#rt/></#if> class="wwgrp">
|
||||
|
||||
<#if parameters.errorposition?default("top") == 'top'>
|
||||
<#if hasFieldErrors>
|
||||
<div <#rt/><#if parameters.id??>id="wwerr_${parameters.id}"<#rt/></#if> class="wwerr">
|
||||
<#list fieldErrors[parameters.name] as error>
|
||||
@@ -40,6 +41,7 @@
|
||||
</#list>
|
||||
</div><#t/>
|
||||
</#if>
|
||||
</#if>
|
||||
|
||||
<#if parameters.label??>
|
||||
<#if parameters.labelposition?default("top") == 'top'>
|
||||
|
||||
@@ -23,3 +23,16 @@
|
||||
${parameters.after?if_exists}<#t/>
|
||||
</td><#lt/>
|
||||
</tr>
|
||||
<#if parameters.errorposition?default("top") == 'bottom'>
|
||||
<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/>
|
||||
<#if hasFieldErrors>
|
||||
<#list fieldErrors[parameters.name] as error>
|
||||
<tr errorFor="${parameters.id}">
|
||||
<td align="center" valign="top" colspan="2"><#rt/>
|
||||
<span class="errorMessage">${error?html}</span><#t/>
|
||||
</td><#lt/>
|
||||
</tr>
|
||||
</#list>
|
||||
</#if>
|
||||
</#if>
|
||||
|
||||
|
||||
@@ -25,19 +25,17 @@
|
||||
This will be done if ActionSupport is used.
|
||||
-->
|
||||
<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/>
|
||||
<#if parameters.errorposition?default("top") == 'top'>
|
||||
<#if hasFieldErrors>
|
||||
<#list fieldErrors[parameters.name] as error>
|
||||
<tr errorFor="${parameters.id}">
|
||||
<#if parameters.labelposition?default("") == 'top'>
|
||||
<td align="left" valign="top" colspan="2"><#rt/>
|
||||
<#else>
|
||||
<td align="center" valign="top" colspan="2"><#rt/>
|
||||
</#if>
|
||||
<span class="errorMessage">${error?html}</span><#t/>
|
||||
</td><#lt/>
|
||||
</tr>
|
||||
</#list>
|
||||
</#if>
|
||||
</#if>
|
||||
<#--
|
||||
if the label position is top,
|
||||
then give the label it's own row in the table
|
||||
|
||||
@@ -85,7 +85,7 @@ END SNIPPET: supported-validators
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
}
|
||||
<#elseif validator.validatorType = "email">
|
||||
if (continueValidation && field.value != null && field.value.length > 0 && field.value.match(/\b^['_a-z0-9-\+]+(\.['_a-z0-9-\+]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx)$\b/gi)==null) {
|
||||
if (continueValidation && field.value != null && field.value.length > 0 && field.value.match("${validator.expression?js_string}")==null) {
|
||||
addError(field, error);
|
||||
errors = true;
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
@@ -99,9 +99,9 @@ END SNIPPET: supported-validators
|
||||
<#elseif validator.validatorType = "int">
|
||||
if (continueValidation && field.value != null) {
|
||||
if (<#if validator.min??>parseInt(field.value) <
|
||||
${validator.min}<#else>false</#if> ||
|
||||
${validator.min?c}<#else>false</#if> ||
|
||||
<#if validator.max??>parseInt(field.value) >
|
||||
${validator.max}<#else>false</#if>) {
|
||||
${validator.max?c}<#else>false</#if>) {
|
||||
addError(field, error);
|
||||
errors = true;
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
@@ -110,10 +110,10 @@ END SNIPPET: supported-validators
|
||||
<#elseif validator.validatorType = "double">
|
||||
if (continueValidation && field.value != null) {
|
||||
var value = parseFloat(field.value);
|
||||
if (<#if validator.minInclusive??>value < ${validator.minInclusive}<#else>false</#if> ||
|
||||
<#if validator.maxInclusive??>value > ${validator.maxInclusive}<#else>false</#if> ||
|
||||
<#if validator.minExclusive??>value <= ${validator.minExclusive}<#else>false</#if> ||
|
||||
<#if validator.maxExclusive??>value >= ${validator.maxExclusive}<#else>false</#if>) {
|
||||
if (<#if validator.minInclusive??>value < ${validator.minInclusive?c}<#else>false</#if> ||
|
||||
<#if validator.maxInclusive??>value > ${validator.maxInclusive?c}<#else>false</#if> ||
|
||||
<#if validator.minExclusive??>value <= ${validator.minExclusive?c}<#else>false</#if> ||
|
||||
<#if validator.maxExclusive??>value >= ${validator.maxExclusive?c}<#else>false</#if>) {
|
||||
addError(field, error);
|
||||
errors = true;
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
|
||||
@@ -105,6 +105,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Boolean</td>
|
||||
<td align="left" valign="top">Whether to encode parameters</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<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">Define error position of form element (top|bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">escapeAmp</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -354,7 +362,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Specifies if this should be a portlet render or action URL. Default is "render". To create an action URL, use "action".</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">required</td>
|
||||
<td align="left" valign="top">requiredLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -362,7 +370,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">requiredposition</td>
|
||||
<td align="left" valign="top">requiredPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -81,6 +81,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set the html disabled attribute on rendered html element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<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">Define error position of form element (top|bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">escape</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -258,7 +266,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Set the html onselect attribute on rendered html element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">required</td>
|
||||
<td align="left" valign="top">requiredLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -266,7 +274,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">requiredposition</td>
|
||||
<td align="left" valign="top">requiredPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -81,6 +81,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set the html disabled attribute on rendered html element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<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">Define error position of form element (top|bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">escape</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -258,7 +266,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Set the html onselect attribute on rendered html element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">required</td>
|
||||
<td align="left" valign="top">requiredLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -266,7 +274,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">requiredposition</td>
|
||||
<td align="left" valign="top">requiredPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -113,6 +113,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Comma delimmited list of topics that will published after the request(if the request fails)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<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">Define error position of form element (top|bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorText</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -394,7 +402,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Parse returned HTML for Dojo widgets</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">required</td>
|
||||
<td align="left" valign="top">requiredLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -402,7 +410,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">requiredposition</td>
|
||||
<td align="left" valign="top">requiredPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -153,6 +153,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Comma delimmited list of topics that will published after the request(if the request fails)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<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">Define error position of form element (top|bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">forceValidOption</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -490,7 +498,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Whether the input is readonly</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">required</td>
|
||||
<td align="left" valign="top">requiredLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -498,7 +506,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">requiredposition</td>
|
||||
<td align="left" valign="top">requiredPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -121,6 +121,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Date</td>
|
||||
<td align="left" valign="top">Last available date in the calendar set</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<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">Define error position of form element (top|bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">formatLength</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -314,7 +322,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Set the html onselect attribute on rendered html element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">required</td>
|
||||
<td align="left" valign="top">requiredLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -322,7 +330,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">requiredposition</td>
|
||||
<td align="left" valign="top">requiredPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -129,6 +129,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Comma delimmited list of topics that will published after the request(if the request fails)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<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">Define error position of form element (top|bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorText</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -426,7 +434,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Content will be loaded when div becomes visible, used only inside the tabbedpanel tag</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">required</td>
|
||||
<td align="left" valign="top">requiredLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -434,7 +442,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">requiredposition</td>
|
||||
<td align="left" valign="top">requiredPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -121,6 +121,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Comma delimmited list of topics that will published after the request(if the request fails)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<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">Define error position of form element (top|bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorText</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -410,7 +418,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Parse returned HTML for Dojo widgets</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">required</td>
|
||||
<td align="left" valign="top">requiredLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -418,7 +426,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">requiredposition</td>
|
||||
<td align="left" valign="top">requiredPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -121,6 +121,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Boolean</td>
|
||||
<td align="left" valign="top">If doLayout is false, the tab container's height equals the height of the currently selected tab</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<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">Define error position of form element (top|bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">id</td>
|
||||
<td align="left" valign="top"><strong>true</strong></td>
|
||||
@@ -298,7 +306,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Set template to use for opening the rendered html.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">required</td>
|
||||
<td align="left" valign="top">requiredLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -306,7 +314,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">requiredposition</td>
|
||||
<td align="left" valign="top">requiredPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -89,6 +89,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Set the html disabled attribute on rendered html element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<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">Define error position of form element (top|bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">id</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -266,7 +274,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Whether the textarea is readonly</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">required</td>
|
||||
<td align="left" valign="top">requiredLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -274,7 +282,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">requiredposition</td>
|
||||
<td align="left" valign="top">requiredPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
@@ -113,6 +113,14 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">String</td>
|
||||
<td align="left" valign="top">Comma delimmited list of topics that will published after the request(if the request fails).Only valid if 'href' is set</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">errorPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<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">Define error position of form element (top|bottom)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">expandIconSrcMinus</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -402,7 +410,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">Set template to use for opening the rendered html.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">required</td>
|
||||
<td align="left" valign="top">requiredLabel</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
@@ -410,7 +418,7 @@ Please do not edit it directly.
|
||||
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left" valign="top">requiredposition</td>
|
||||
<td align="left" valign="top">requiredPosition</td>
|
||||
<td align="left" valign="top">false</td>
|
||||
<td align="left" valign="top"></td>
|
||||
<td align="left" valign="top">false</td>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user