mirror of
https://github.com/apache/struts.git
synced 2026-08-08 08:07:17 +00:00
Compare commits
156 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fd206c1386 | |||
| d82ebc3a41 | |||
| 93dacd1074 | |||
| d901ee3d55 | |||
| 58947c3f85 | |||
| 52feec5b14 | |||
| 2e313cfc29 | |||
| a3e8dee846 | |||
| e2d9d87e53 | |||
| c5dbe134f4 | |||
| ef438411af | |||
| 4fb4a6b5c0 | |||
| 3cfe34fefe | |||
| ad8ff3d6a9 | |||
| bc1625e3c7 | |||
| 42c615c826 | |||
| ba2d9b7400 | |||
| f4bcb9da2e | |||
| 680b54631e | |||
| 795abf4663 | |||
| ecc21d9fa3 | |||
| 3e9095eaac | |||
| 1ee86bcad4 | |||
| 5563088d85 | |||
| 2339f7b109 | |||
| 1920411684 | |||
| 33228b9f3b | |||
| f225e108fd | |||
| 025c0397f1 | |||
| 86009d9dd4 | |||
| e26c86e1ff | |||
| edb9c5e120 | |||
| b98c2d3c17 | |||
| 9b93e5e050 | |||
| d7ad759995 | |||
| bbe2a3b81b | |||
| 89cd538a53 | |||
| 5c7868f0d8 | |||
| 0f5a74b983 | |||
| 508dd0b6a1 | |||
| 58f3b578e7 | |||
| af961bd888 | |||
| 2ed79d7b02 | |||
| 041206d2a6 | |||
| 711cf0201c | |||
| 66d71be669 | |||
| c4d9d7d3ce | |||
| 8d209daa76 | |||
| 2382586b85 | |||
| 26778533ef | |||
| bde077ee0a | |||
| ac30ce247b | |||
| 4aca911cb0 | |||
| f6a07e63e6 | |||
| d934c6e743 | |||
| eb2a9eb8ff | |||
| af74f78050 | |||
| 95238ac73e | |||
| 644dd2ed1c | |||
| 9d6e6a6b0f | |||
| b7907fa602 | |||
| 6ed1fdf3d8 | |||
| 86d081bd4e | |||
| b238ba7efb | |||
| 62cb4575c3 | |||
| 26728639ec | |||
| 46e0da8058 | |||
| d72ae0cffa | |||
| 07f97efcfd | |||
| 6c5b9adc8a | |||
| e5754488c0 | |||
| ce1530b280 | |||
| 1c5b931cfb | |||
| 7df4af2deb | |||
| 01d979b039 | |||
| f3dc60ac8a | |||
| 150088f79d | |||
| 294d380398 | |||
| 7caf810099 | |||
| 57ee122ab8 | |||
| 8d2c5ce474 | |||
| 64328943bd | |||
| bcaa26597e | |||
| 2580daa903 | |||
| 369063406d | |||
| 143fa76ddb | |||
| 944b163887 | |||
| b9636fd721 | |||
| e2c26e3f74 | |||
| 7e6f641ebb | |||
| ab70a51baf | |||
| 9fbb0d92b9 | |||
| f5464877a0 | |||
| 8cef213cec | |||
| 2ce8c73d8e | |||
| ced6f3568c | |||
| 791665dd2a | |||
| 1d64a3e75d | |||
| 23bd008add | |||
| 341140426c | |||
| 2d02e2c7ae | |||
| 4db60a88a9 | |||
| e82957c5eb | |||
| 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 |
+15
-6
@@ -26,17 +26,17 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
|
||||
<artifactId>struts2-blank</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>Blank Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps/blank</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps/blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps/blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_2/apps/blank</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
@@ -53,10 +53,19 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>struts2-junit-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# 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
|
||||
|
||||
log4j.logger.com.opensymphony.xwork2=DEBUG
|
||||
log4j.logger.org.apache.struts2=DEBUG
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
@@ -26,17 +26,17 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
|
||||
<artifactId>struts2-jboss-blank</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>JBoss Blank Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/jboss-blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/jboss-blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps/jboss-blank</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps/jboss-blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps/jboss-blank</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_2/apps/jboss-blank</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
@@ -57,7 +57,6 @@
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>struts2-junit-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
@@ -26,17 +26,17 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
|
||||
<artifactId>struts2-mailreader</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>Mail Reader Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/mailreader</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/mailreader</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps/mailreader</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps/mailreader</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps/mailreader</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_2/apps/mailreader</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.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_12/apps</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_2/apps</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
|
||||
@@ -26,17 +26,17 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
|
||||
<artifactId>struts2-portlet</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>Portlet Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/portlet</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps/portlet</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps/portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps/portlet</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_2/apps/portlet</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
@@ -26,13 +26,12 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-rest-showcase</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
<name>Struts 2 Rest Showcase Example</name>
|
||||
<description>Struts 2 Rest Showcase Example</description>
|
||||
|
||||
@@ -40,17 +39,14 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-rest-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<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>
|
||||
@@ -71,7 +67,6 @@
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.jwebunit</groupId>
|
||||
<artifactId>jwebunit-htmlunit-plugin</artifactId>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
+5
-18
@@ -26,20 +26,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-apps</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
|
||||
<artifactId>struts2-showcase</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>Showcase Webapp</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/showcase</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/apps/showcase</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/apps/showcase</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps/showcase</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/apps/showcase</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_2/apps/showcase</url>
|
||||
</scm>
|
||||
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>hostedqa</id>
|
||||
@@ -56,49 +55,41 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-struts1-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-dojo-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-jsf-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>org.apache.struts</groupId>
|
||||
<artifactId>struts2-sitemesh-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-tiles-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-dwr-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-json-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -110,13 +101,11 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-convention-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-spring-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -139,12 +128,10 @@
|
||||
<dependency>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>sitemesh</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>uk.ltd.getahead</groupId>
|
||||
<artifactId>dwr</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
|
||||
+17
-1
@@ -39,7 +39,23 @@ public class FileDownloadAction implements Action {
|
||||
}
|
||||
|
||||
public void setInputPath(String value) {
|
||||
inputPath = value;
|
||||
inputPath = sanitizeInputPath(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* As the user modifiable parameter inputPath will be used to access server side resources, we want the path to be
|
||||
* sanitized - in this case it is demonstrated to disallow inputPath parameter values containing "WEB-INF". Consider to
|
||||
* use even stricter rules in production environments.
|
||||
*
|
||||
* @param value the raw parameter input value to sanitize
|
||||
*
|
||||
* @return the sanitized value; <tt>null</tt> if value contains an invalid path segment like WEB-INF
|
||||
*/
|
||||
String sanitizeInputPath( String value ) {
|
||||
if (value != null && value.toUpperCase().contains("WEB-INF")) {
|
||||
return null;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public InputStream getInputStream() throws Exception {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
# Set root logger level to WARN and append to stdout
|
||||
log4j.rootLogger=DEBUG, 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
|
||||
@@ -20,17 +20,14 @@ log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
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
|
||||
log4j.logger.noModule=INFO
|
||||
|
||||
# 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
|
||||
log4j.logger.com.opensymphony.xwork2.ognl=INFO
|
||||
log4j.logger.org.apache.struts2=INFO
|
||||
|
||||
# Spring Stuff
|
||||
log4j.logger.org.springframework=WARN
|
||||
log4j.logger.org.springframework=INFO
|
||||
|
||||
|
||||
+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>
|
||||
|
||||
@@ -37,17 +37,13 @@
|
||||
|
||||
<@s.textfield label="Enter Some Text" name="text" />
|
||||
|
||||
<@s.submit name="action:actionPrefix" value="%{'action prefix'}" cssClass="btn" />
|
||||
<@s.submit action="actionPrefix" value="%{'action prefix'}" cssClass="btn" />
|
||||
|
||||
<@s.submit name="method:alternateMethod" value="%{'method prefix'}" cssClass="btn" />
|
||||
|
||||
<@s.submit name="redirect:http://www.google.com" value="%{'redirect prefix'}" cssClass="btn" />
|
||||
|
||||
<@s.submit name="redirect-action:redirectActionPrefix" value="%{'redirect-action prefix'}" cssClass="btn" />
|
||||
<@s.submit method="alternateMethod" value="%{'method prefix'}" cssClass="btn" />
|
||||
|
||||
<@s.submit value="Normal Submit" cssClass="btn" />
|
||||
|
||||
<@s.submit name="action:redirectActionPrefixAction" value="%{'redirect-action without prefix'}" cssClass="btn" />
|
||||
<@s.submit action="redirectActionPrefixAction" value="%{'redirectAction without prefix'}" cssClass="btn" />
|
||||
|
||||
</@s.form>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package org.apache.struts2.showcase.filedownload;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
import static junit.framework.Assert.assertNull;
|
||||
|
||||
public class FileDownloadActionTest {
|
||||
|
||||
private FileDownloadAction fileDownloadAction;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
this.fileDownloadAction = new FileDownloadAction();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSanitizeInputPathShouldAllowSimpleParameter() throws Exception {
|
||||
assertEquals("foo", fileDownloadAction.sanitizeInputPath("foo"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSanitizeInputPathShouldReturnNullForNullInput() throws Exception {
|
||||
assertNull(fileDownloadAction.sanitizeInputPath(null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSanitizeInputPathShouldReturnNullForLeadingWebInf() throws Exception {
|
||||
assertNull(fileDownloadAction.sanitizeInputPath("WEB-INF/foo"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSanitizeInputPathShouldReturnNullForNonLeadingWebInf() throws Exception {
|
||||
assertNull(fileDownloadAction.sanitizeInputPath("./WEB-INF/foo"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSanitizeInputPathShouldReturnNullForNonUppercaseWebInf() throws Exception {
|
||||
assertNull(fileDownloadAction.sanitizeInputPath("./wEB-Inf/foo"));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="modules"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
+4
-4
@@ -26,7 +26,7 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.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_12/archetypes</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes</url>
|
||||
</scm>
|
||||
|
||||
<modules>
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="modules"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
@@ -3,19 +3,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-blank</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.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_12/archetypes/struts2-archetype-blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-blank</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-blank</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-blank</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-blank</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_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>
|
||||
|
||||
@@ -36,7 +36,13 @@
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<version>1.1.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -74,7 +80,7 @@
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>log4j.configuration</name>
|
||||
<value>file:${basedir}/src/main/resources/log4j.properties</value>
|
||||
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
|
||||
</systemProperty>
|
||||
<systemProperty>
|
||||
<name>slf4j</name>
|
||||
@@ -82,10 +88,10 @@
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppConfig>
|
||||
<contextPath>/struts2-blank</contextPath>
|
||||
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
|
||||
<contextPath>\${artifactId}</contextPath>
|
||||
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
|
||||
</webAppConfig>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
|
||||
+20
-17
@@ -1,27 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
<!--
|
||||
- This file is included by the struts.xml file as an example
|
||||
- of how to break up the configuration file into multiple files.
|
||||
-->
|
||||
<struts>
|
||||
<package name="example" namespace="/example" extends="struts-default">
|
||||
<action name="HelloWorld" class="${package}.example.HelloWorld">
|
||||
<result>/example/HelloWorld.jsp</result>
|
||||
</action>
|
||||
<package name="example" namespace="/example" extends="struts-default">
|
||||
|
||||
<action name="Login_*" method="{1}" class="${package}.example.Login">
|
||||
<result name="input">/example/Login.jsp</result>
|
||||
<result type="redirectAction">Menu</result>
|
||||
</action>
|
||||
<default-action-ref name="HelloWorld" />
|
||||
|
||||
<action name="*" class="${package}.example.ExampleSupport">
|
||||
<result>/example/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
<!-- Add additional "example" package actions here. -->
|
||||
|
||||
</package>
|
||||
<action name="HelloWorld" class="${package}.example.HelloWorld">
|
||||
<result>/example/HelloWorld.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="Login_*" method="{1}" class="${package}.example.Login">
|
||||
<result name="input">/example/Login.jsp</result>
|
||||
<result type="redirectAction">Menu</result>
|
||||
</action>
|
||||
|
||||
<action name="*" class="${package}.example.ExampleSupport">
|
||||
<result>/example/{1}.jsp</result>
|
||||
</action>
|
||||
|
||||
<!-- Add additional "example" package actions here. -->
|
||||
|
||||
</package>
|
||||
</struts>
|
||||
|
||||
+21
-8
@@ -1,12 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
<struts>
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
|
||||
<constant name="struts.devMode" value="true"/>
|
||||
|
||||
<include file="example.xml"/>
|
||||
|
||||
<!-- Add addition packages and configuration here. -->
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
|
||||
<constant name="struts.devMode" value="true"/>
|
||||
|
||||
<include file="example.xml"/>
|
||||
|
||||
<package name="default" namespace="/" extends="struts-default">
|
||||
|
||||
<default-action-ref name="index"/>
|
||||
|
||||
<action name="index">
|
||||
<result type="redirectAction">
|
||||
<param name="actionName">HelloWorld</param>
|
||||
<param name="namespace">/example</param>
|
||||
</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
|
||||
<!-- Add addition packages and configuration here. -->
|
||||
</struts>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
@@ -2,19 +2,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-convention</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.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_12/archetypes/struts2-archetype-convention</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-convention</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-convention</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-convention</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-convention</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_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>
|
||||
|
||||
+11
-5
@@ -42,7 +42,13 @@
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.1</version>
|
||||
<version>1.1.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -88,7 +94,7 @@
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>log4j.configuration</name>
|
||||
<value>file:${basedir}/src/main/resources/log4j.properties</value>
|
||||
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
|
||||
</systemProperty>
|
||||
<systemProperty>
|
||||
<name>slf4j</name>
|
||||
@@ -96,10 +102,10 @@
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppConfig>
|
||||
<contextPath>/struts2-showcase</contextPath>
|
||||
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
|
||||
<contextPath>\${artifactId}</contextPath>
|
||||
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
|
||||
</webAppConfig>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
@@ -2,19 +2,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-dbportlet</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.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_12/archetypes/struts2-archetype-dbportlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-dbportlet</developerConnection>
|
||||
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-dbportlet</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-dbportlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-dbportlet</developerConnection>
|
||||
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-dbportlet</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
@@ -2,19 +2,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-plugin</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.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_12/archetypes/struts2-archetype-plugin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-plugin</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-plugin</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-plugin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-plugin</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-plugin</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
@@ -2,19 +2,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-portlet</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.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_12/archetypes/struts2-archetype-portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-portlet</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-portlet</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-portlet</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-portlet</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-portlet</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
@@ -4,19 +4,19 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-archetypes</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-archetype-starter</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.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_12/archetypes/struts2-archetype-starter</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-starter</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/archetypes/struts2-archetype-starter</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-starter</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-starter</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/archetypes/struts2-archetype-starter</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
|
||||
+17
-5
@@ -66,9 +66,21 @@
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.1.1</version>
|
||||
<version>1.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.1.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Dwr -->
|
||||
<dependency>
|
||||
<groupId>uk.ltd.getahead</groupId>
|
||||
@@ -97,7 +109,7 @@
|
||||
<systemProperties>
|
||||
<systemProperty>
|
||||
<name>log4j.configuration</name>
|
||||
<value>file:${basedir}/src/main/resources/log4j.properties</value>
|
||||
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
|
||||
</systemProperty>
|
||||
<systemProperty>
|
||||
<name>slf4j</name>
|
||||
@@ -105,10 +117,10 @@
|
||||
</systemProperty>
|
||||
</systemProperties>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
|
||||
<webAppConfig>
|
||||
<contextPath>/struts2-showcase</contextPath>
|
||||
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
|
||||
<contextPath>\${artifactId}</contextPath>
|
||||
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
|
||||
</webAppConfig>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
|
||||
+17
-11
@@ -1,19 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
|
||||
<struts>
|
||||
|
||||
<constant name="struts.enable.DynamicMethodInvocation" value="false"/>
|
||||
|
||||
<package name="myPackage" extends="struts-default">
|
||||
<action name="index" class="${package}.IndexAction">
|
||||
<result>/jsp/index.jsp</result>
|
||||
</action>
|
||||
<action name="helloWorld" class="helloWorldAction">
|
||||
<result name="input">/jsp/index.jsp</result>
|
||||
<result>/jsp/helloWorld.jsp</result>
|
||||
</action>
|
||||
</package>
|
||||
<package name="myPackage" extends="struts-default">
|
||||
|
||||
<default-action-ref name="index" />
|
||||
|
||||
<action name="index" class="${package}.IndexAction">
|
||||
<result>/jsp/index.jsp</result>
|
||||
</action>
|
||||
|
||||
<action name="helloWorld" class="helloWorldAction">
|
||||
<result name="input">/jsp/index.jsp</result>
|
||||
<result>/jsp/helloWorld.jsp</result>
|
||||
</action>
|
||||
|
||||
</package>
|
||||
|
||||
</struts>
|
||||
|
||||
+6
-6
@@ -14,20 +14,20 @@
|
||||
|
||||
<!-- Filters -->
|
||||
<filter>
|
||||
<filter-name>action2-cleanup</filter-name>
|
||||
<filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
|
||||
<filter-name>struts2-prepare</filter-name>
|
||||
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</filter-class>
|
||||
</filter>
|
||||
<filter>
|
||||
<filter-name>sitemesh</filter-name>
|
||||
<filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
|
||||
</filter>
|
||||
<filter>
|
||||
<filter-name>action2</filter-name>
|
||||
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
|
||||
<filter-name>struts2-execute</filter-name>
|
||||
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>action2-cleanup</filter-name>
|
||||
<filter-name>struts2-prepare</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
<filter-mapping>
|
||||
@@ -35,7 +35,7 @@
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
<filter-mapping>
|
||||
<filter-name>action2</filter-name>
|
||||
<filter-name>struts2-execute</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
+44
-239
@@ -1,207 +1,31 @@
|
||||
<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>org.apache.struts</groupId>
|
||||
<artifactId>struts2-assembly</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Struts 2 Assembly</name>
|
||||
<description>
|
||||
Struts 2 Assembly
|
||||
</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>struts2-assembly</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Struts 2 Assembly</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/assembly</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/assembly</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/assembly</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/assembly</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/assembly</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_2/assembly</url>
|
||||
</scm>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>j4</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>attached</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/all.xml</descriptor>
|
||||
<descriptor>src/main/assembly/lib.xml</descriptor>
|
||||
<descriptor>src/main/assembly/lib-jdk14.xml</descriptor>
|
||||
<descriptor>src/main/assembly/apps.xml</descriptor>
|
||||
<descriptor>src/main/assembly/src.xml</descriptor>
|
||||
<descriptor>src/main/assembly/docs.xml</descriptor>
|
||||
</descriptors>
|
||||
<finalName>struts-${project.version}</finalName>
|
||||
<outputDirectory>target/assembly/out</outputDirectory>
|
||||
<workDirectory>target/assembly/work</workDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
<!-- Backported JDK 1.4 jars -->
|
||||
<dependency>
|
||||
<groupId>net.sf.retrotranslator</groupId>
|
||||
<artifactId>retrotranslator-runtime</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>backport-util-concurrent</groupId>
|
||||
<artifactId>backport-util-concurrent</artifactId>
|
||||
<version>3.0</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts.xwork</groupId>
|
||||
<artifactId>xwork-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<type>jar</type>
|
||||
<classifier>jdk14</classifier>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-config-browser-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-jasperreports-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-jfreechart-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-jsf-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-pell-multipart-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plexus-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-sitegraph-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-sitemesh-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-struts1-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-tiles-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-rest-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-oval-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-json-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-embeddedjsp-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-gxp-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<classifier>jdk14</classifier>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<configuration>
|
||||
<generateReports>false</generateReports>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>dependency-maven-plugin</artifactId>
|
||||
@@ -259,31 +83,29 @@
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>cwiki-docs</id>
|
||||
<phase>prepare-package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
<goal>java</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<tasks>
|
||||
<mkdir dir="${project.build.directory}/cwiki" />
|
||||
<exec executable="wget">
|
||||
<arg value="-erobots=off" />
|
||||
<arg value="-nH" />
|
||||
<arg value="-nv" />
|
||||
<arg value="-E" />
|
||||
<arg value="-L" />
|
||||
<arg value="-l 0" />
|
||||
<arg value="-np" />
|
||||
<arg value="--directory-prefix=${project.build.directory}/cwiki" />
|
||||
<arg value="--no-check-certificate" />
|
||||
<arg value="-r" />
|
||||
<arg value="https://cwiki.apache.org/WW/" />
|
||||
</exec>
|
||||
</tasks>
|
||||
<classpathScope>runtime</classpathScope>
|
||||
<includeProjectDependencies>true</includeProjectDependencies>
|
||||
<mainClass>org.apache.cxf.cwiki.SiteExporter</mainClass>
|
||||
<arguments>
|
||||
<argument>-d</argument>
|
||||
<argument>${project.build.directory}/cwiki/WW</argument>
|
||||
<argument>-password</argument>
|
||||
<argument>${confluence.password}</argument>
|
||||
<argument>-user</argument>
|
||||
<argument>${confluence.user}</argument>
|
||||
<argument>${basedir}/src/main/resources/docs.cfg</argument>
|
||||
</arguments>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
@@ -291,7 +113,6 @@
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
@@ -319,168 +140,152 @@
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.cxf.site-export</groupId>
|
||||
<artifactId>cxf-site-export</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-codebehind-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-convention-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-javatemplates-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>org.apache.struts</groupId>
|
||||
<artifactId>struts2-dojo-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-dwr-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-jasperreports-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-jfreechart-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-jsf-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-junit-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-pell-multipart-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plexus-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-portlet-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-rest-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-sitegraph-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-sitemesh-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-spring-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-struts1-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-testng-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-tiles-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-tiles3-plugin</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-oval-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-json-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-embeddedjsp-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-gxp-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-admin-bundle</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-demo-bundle</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -31,10 +31,8 @@
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
<scope>runtime</scope>
|
||||
<excludes>
|
||||
<exclude>net.sf.retrotranslator:retrotranslator-runtime</exclude>
|
||||
<exclude>backport-util-concurrent:backport-util-concurrent</exclude>
|
||||
<exclude>junit:junit</exclude>
|
||||
<exclude>*:jdk14</exclude>
|
||||
<exclude>org.testng:testng</exclude>
|
||||
</excludes>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
|
||||
@@ -47,8 +47,8 @@
|
||||
|
||||
<!-- Include the Confluence docs in the assembly -->
|
||||
<fileSet>
|
||||
<directory>target/cwiki/WW</directory>
|
||||
<outputDirectory>docs/docs</outputDirectory>
|
||||
<directory>target/cwiki/WW/docs</directory>
|
||||
<outputDirectory>docs</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
<!-- Plugins -->
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<assembly>
|
||||
<id>lib-jdk14</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<dependencySets>
|
||||
<dependencySet useTransitiveFiltering="true">
|
||||
<outputDirectory>jdk14</outputDirectory>
|
||||
<outputFileNameMapping>${artifactId}-${version}.${extension}</outputFileNameMapping>
|
||||
<includes>
|
||||
<include>net.sf.retrotranslator:retrotranslator-runtime</include>
|
||||
<include>backport-util-concurrent:backport-util-concurrent</include>
|
||||
</includes>
|
||||
</dependencySet>
|
||||
<dependencySet>
|
||||
<useTransitiveFiltering>true</useTransitiveFiltering>
|
||||
<outputDirectory>jdk14</outputDirectory>
|
||||
<outputFileNameMapping>${artifactId}-${version}-jdk14.${extension}</outputFileNameMapping>
|
||||
<includes>
|
||||
<include>org.apache.struts:*:jar:jdk14</include>
|
||||
<include>com.opensymphony:xwork:jar:jdk14</include>
|
||||
</includes>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>src/main/resources/backport</directory>
|
||||
<outputDirectory></outputDirectory>
|
||||
<includes>
|
||||
<include>*LICENSE*</include>
|
||||
<include>NOTICE*</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
@@ -31,10 +31,8 @@
|
||||
<outputDirectory>lib</outputDirectory>
|
||||
<scope>runtime</scope>
|
||||
<excludes>
|
||||
<exclude>net.sf.retrotranslator:retrotranslator-runtime</exclude>
|
||||
<exclude>backport-util-concurrent:backport-util-concurrent</exclude>
|
||||
<exclude>junit:junit</exclude>
|
||||
<exclude>*:jdk14</exclude>
|
||||
<exclude>org.testng:testng</exclude>
|
||||
</excludes>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
spaceKey: WW
|
||||
pageCacheFile:/cache/docs.pageCache
|
||||
templateName:assembly/src/main/resources/template.vm
|
||||
outputDir:/docs
|
||||
globalPages:Navigation,Banner,QuickLinks
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
#set ($stylebase = "https://struts.apache.org/css")
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--
|
||||
Licensed to the Apache Software Foundation (ASF) under one
|
||||
or more contributor license agreements. See the NOTICE file
|
||||
distributed with this work for additional information
|
||||
regarding copyright ownership. The ASF licenses this file
|
||||
to you under the Apache License, Version 2.0 (the
|
||||
"License"); you may not use this file except in compliance
|
||||
with the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the License is distributed on an
|
||||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
KIND, either express or implied. See the License for the
|
||||
specific language governing permissions and limitations
|
||||
under the License.
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<LINK type="text/css" rel="stylesheet" href="$stylebase/default.css">
|
||||
<style type="text/css">
|
||||
.dp-highlighter {
|
||||
width:95% !important;
|
||||
}
|
||||
</style>
|
||||
<style type="text/css">
|
||||
.footer {
|
||||
background-image: url('$confluenceUri/images/border/border_bottom.gif');
|
||||
background-repeat: repeat-x;
|
||||
background-position: left top;
|
||||
padding-top: 4px;
|
||||
color: #666;
|
||||
}
|
||||
</style>
|
||||
#if($page.hasCode)
|
||||
<link href='http://struts.apache.org/highlighter/styles/shCoreStruts.css' rel='stylesheet' type='text/css' />
|
||||
<link href='http://struts.apache.org/highlighter/styles/shThemeStruts.css' rel='stylesheet' type='text/css' />
|
||||
<script src='http://struts.apache.org/highlighter/js/shCore.js' type='text/javascript'></script>
|
||||
#foreach ($hscript in $page.CodeScripts)
|
||||
<script src='http://struts.apache.org/highlighter/js/$hscript' type='text/javascript'></script>
|
||||
#end
|
||||
|
||||
<script type="text/javascript">
|
||||
SyntaxHighlighter.defaults['toolbar'] = false;
|
||||
SyntaxHighlighter.all();
|
||||
</script>
|
||||
#end
|
||||
<script type="text/javascript" language="javascript">
|
||||
var hide = null;
|
||||
var show = null;
|
||||
var children = null;
|
||||
|
||||
function init() {
|
||||
/* Search form initialization */
|
||||
var form = document.forms['search'];
|
||||
if (form != null) {
|
||||
form.elements['domains'].value = location.hostname;
|
||||
form.elements['sitesearch'].value = location.hostname;
|
||||
}
|
||||
|
||||
/* Children initialization */
|
||||
hide = document.getElementById('hide');
|
||||
show = document.getElementById('show');
|
||||
children = document.all != null ?
|
||||
document.all['children'] :
|
||||
document.getElementById('children');
|
||||
if (children != null) {
|
||||
children.style.display = 'none';
|
||||
show.style.display = 'inline';
|
||||
hide.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function showChildren() {
|
||||
children.style.display = 'block';
|
||||
show.style.display = 'none';
|
||||
hide.style.display = 'inline';
|
||||
}
|
||||
|
||||
function hideChildren() {
|
||||
children.style.display = 'none';
|
||||
show.style.display = 'inline';
|
||||
hide.style.display = 'none';
|
||||
}
|
||||
</script>
|
||||
<title>$page.title</title>
|
||||
</head>
|
||||
<body onload="init()">
|
||||
<table border="0" cellpadding="2" cellspacing="0" width="100%">
|
||||
<tr class="topBar">
|
||||
<td align="left" valign="middle" class="topBarDiv" align="left" nowrap>
|
||||
$exporter.breadcrumbs($page)
|
||||
</td>
|
||||
<td align="right" valign="middle" nowrap>
|
||||
<form name="search" action="http://www.google.com/search" method="get">
|
||||
<input type="hidden" name="ie" value="UTF-8" />
|
||||
<input type="hidden" name="oe" value="UTF-8" />
|
||||
<input type="hidden" name="domains" value="" />
|
||||
<input type="hidden" name="sitesearch" value="" />
|
||||
<input type="text" name="q" maxlength="255" value="" />
|
||||
<input type="submit" name="btnG" value="Google Search" />
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div id="PageContent">
|
||||
<div class="pageheader" style="padding: 6px 0px 0px 0px;">
|
||||
<!-- We'll enable this once we figure out how to access (and save) the logo resource -->
|
||||
<!--img src="/wiki/images/confluence_logo.gif" style="float: left; margin: 4px 4px 4px 10px;" border="0"-->
|
||||
<div style="margin: 0px 10px 0px 10px" class="smalltext">$page.space.name</div>
|
||||
<div style="margin: 0px 10px 8px 10px" class="pagetitle">$page.title</div>
|
||||
|
||||
<div class="greynavbar" align="right" style="padding: 2px 10px; margin: 0px;">
|
||||
<a href="$confluenceUri/pages/editpage.action?pageId=$page.id">
|
||||
<img src="$confluenceUri/images/icons/notep_16.gif"
|
||||
height="16" width="16" border="0" align="absmiddle" title="Edit Page"></a>
|
||||
<a href="$confluenceUri/pages/editpage.action?pageId=$page.id">Edit Page</a>
|
||||
|
||||
<a href="$confluenceUri/pages/listpages.action?key=$page.spaceKey">
|
||||
<img src="$confluenceUri/images/icons/browse_space.gif"
|
||||
height="16" width="16" border="0" align="absmiddle" title="Browse Space"></a>
|
||||
<a href="$confluenceUri/pages/listpages.action?key=$page.spaceKey">Browse Space</a>
|
||||
|
||||
<a href="$confluenceUri/pages/createpage.action?spaceKey=$page.spaceKey&fromPageId=$page.id">
|
||||
<img src="$confluenceUri/images/icons/add_page_16.gif"
|
||||
height="16" width="16" border="0" align="absmiddle" title="Add Page"></a>
|
||||
<a href="$confluenceUri/pages/createpage.action?spaceKey=$page.spaceKey&fromPageId=$page.id">Add Page</a>
|
||||
|
||||
<a href="$confluenceUri/pages/createblogpost.action?spaceKey=$page.spaceKey&fromPageId=$page.id">
|
||||
<img src="$confluenceUri/images/icons/add_blogentry_16.gif"
|
||||
height="16" width="16" border="0" align="absmiddle" title="Add News"></a>
|
||||
<a href="$confluenceUri/pages/createblogpost.action?spaceKey=$page.spaceKey&fromPageId=$page.id">Add News</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pagecontent">
|
||||
<div class="wiki-content">
|
||||
$body
|
||||
</div>
|
||||
|
||||
#if ($page.hasChildren())
|
||||
<div class="tabletitle">
|
||||
Children
|
||||
<span class="smalltext" id="show" style="display: inline;">
|
||||
<a href="javascript:showChildren()">Show Children</a></span>
|
||||
<span class="smalltext" id="hide" style="display: none;">
|
||||
<a href="javascript:hideChildren()">Hide Children</a></span>
|
||||
</div>
|
||||
<div class="greybox" id="children" style="display: none;">
|
||||
#set ($children = $page.children)
|
||||
#foreach ($child in $children)
|
||||
$page.link($child)
|
||||
<span class="smalltext">($child.space.name)</span>
|
||||
<br>
|
||||
#end
|
||||
</div>
|
||||
#end
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
Generated by CXF SiteExporter
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -4,25 +4,24 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-admin-bundle</artifactId>
|
||||
|
||||
<artifactId>struts2-osgi-admin-bundle</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>Struts 2 OSGi Admin Bundle</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles/admin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles/admin</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/bundles/admin</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/bundles/admin</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/bundles/admin</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_2/bundles/admin</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
@@ -31,7 +30,6 @@
|
||||
<groupId>org.apache.felix</groupId>
|
||||
<artifactId>maven-bundle-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<version>2.1.0</version>
|
||||
<configuration>
|
||||
<instructions>
|
||||
<manifestLocation>META-INF</manifestLocation>
|
||||
|
||||
+1
-6
@@ -26,9 +26,8 @@ import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import org.apache.struts2.osgi.BundleAccessor;
|
||||
import org.apache.struts2.osgi.OsgiHost;
|
||||
import org.apache.struts2.osgi.host.OsgiHost;
|
||||
import org.apache.struts2.osgi.StrutsOsgiListener;
|
||||
import org.apache.struts2.osgi.OsgiConfigurationProvider;
|
||||
import org.apache.struts2.util.ServletContextAware;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.BundleException;
|
||||
@@ -40,10 +39,6 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Dictionary;
|
||||
|
||||
public class BundlesAction extends ActionSupport implements ServletContextAware {
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
+5
-13
@@ -4,17 +4,17 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
|
||||
<artifactId>struts2-osgi-demo-bundle</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
<name>Struts 2 OSGi Demo Bundle</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles/demo</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles/demo</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/bundles/demo</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/bundles/demo</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/bundles/demo</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_2/bundles/demo</url>
|
||||
</scm>
|
||||
|
||||
<dependencies>
|
||||
@@ -35,22 +35,14 @@
|
||||
<artifactId>commons-digester</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-convention-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-osgi-plugin</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
+5
-6
@@ -26,17 +26,17 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
|
||||
<artifactId>struts2-osgi-bundles</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>Struts OSGi Bundles</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/bundles</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/bundles</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/bundles</developerConnection>
|
||||
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/bundles</url>
|
||||
</scm>
|
||||
|
||||
<modules>
|
||||
@@ -49,7 +49,6 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Test dependencies -->
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id: site.xml 1082279 2011-03-16 19:43:51Z lukaszlenart $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache"
|
||||
href="http://www.apache.org/"/>
|
||||
<item name="Struts"
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="modules"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
+4
-7
@@ -26,17 +26,16 @@
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-parent</artifactId>
|
||||
<version>2.3.12</version>
|
||||
<version>2.3.15.2</version>
|
||||
</parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-core</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Struts 2 Core</name>
|
||||
|
||||
<scm>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/core</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_12/core</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_12/core</url>
|
||||
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/core</connection>
|
||||
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_2/core</developerConnection>
|
||||
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_2/core</url>
|
||||
</scm>
|
||||
|
||||
<properties>
|
||||
@@ -87,7 +86,6 @@
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>rat-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>pom.xml</include>
|
||||
@@ -112,7 +110,6 @@
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-source</id>
|
||||
|
||||
@@ -228,6 +228,12 @@ 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";
|
||||
|
||||
/** Disables {@link org.apache.struts2.dispatcher.StrutsRequestWrapper} request attribute value stack lookup (JSTL accessibility) **/
|
||||
public static final String STRUTS_DISABLE_REQUEST_ATTRIBUTE_VALUE_STACK_LOOKUP = "struts.disableRequestAttributeValueStackLookup";
|
||||
|
||||
/** The{@link org.apache.struts2.views.util.UrlHelper} implementation class **/
|
||||
public static final String STRUTS_URL_HELPER = "struts.view.urlHelper";
|
||||
|
||||
@@ -247,4 +253,9 @@ public final class StrutsConstants {
|
||||
public static final String STRUTS_CONVERTER_CREATOR = "struts.converter.creator";
|
||||
public static final String STRUTS_CONVERTER_HOLDER = "struts..converter.holder";
|
||||
|
||||
public static final String STRUTS_EXPRESSION_PARSER = "struts.expression.parser";
|
||||
|
||||
/** actions names' whitelist **/
|
||||
public static final String STRUTS_ALLOWED_ACTION_NAMES = "struts.allowed.action.names";
|
||||
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class Component {
|
||||
public static final String COMPONENT_STACK = "__component_stack";
|
||||
|
||||
protected ValueStack stack;
|
||||
protected Map parameters;
|
||||
protected Map<String, Object> parameters;
|
||||
protected ActionMapper actionMapper;
|
||||
protected boolean throwExceptionOnELFailure;
|
||||
private UrlHelper urlHelper;
|
||||
@@ -65,7 +65,7 @@ public class Component {
|
||||
*/
|
||||
public Component(ValueStack stack) {
|
||||
this.stack = stack;
|
||||
this.parameters = new LinkedHashMap();
|
||||
this.parameters = new LinkedHashMap<String, Object>();
|
||||
getComponentStack().push(this);
|
||||
}
|
||||
|
||||
@@ -107,10 +107,10 @@ public class Component {
|
||||
* Gets the component stack of this component.
|
||||
* @return the component stack of this component, never <tt>null</tt>.
|
||||
*/
|
||||
public Stack getComponentStack() {
|
||||
Stack componentStack = (Stack) stack.getContext().get(COMPONENT_STACK);
|
||||
public Stack<Component> getComponentStack() {
|
||||
Stack<Component> componentStack = (Stack<Component>) stack.getContext().get(COMPONENT_STACK);
|
||||
if (componentStack == null) {
|
||||
componentStack = new Stack();
|
||||
componentStack = new Stack<Component>();
|
||||
stack.getContext().put(COMPONENT_STACK, componentStack);
|
||||
}
|
||||
return componentStack;
|
||||
@@ -449,7 +449,7 @@ public class Component {
|
||||
* Gets the parameters.
|
||||
* @return the parameters. Is never <tt>null</tt>.
|
||||
*/
|
||||
public Map getParameters() {
|
||||
public Map<String, Object> getParameters() {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
@@ -457,7 +457,7 @@ public class Component {
|
||||
* Adds all the given parameters to this component's own parameters.
|
||||
* @param params the parameters to add.
|
||||
*/
|
||||
public void addAllParameters(Map params) {
|
||||
public void addAllParameters(Map<String, Object> params) {
|
||||
parameters.putAll(params);
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ public class Component {
|
||||
*/
|
||||
public void addParameter(String key, Object value) {
|
||||
if (key != null) {
|
||||
Map params = getParameters();
|
||||
Map<String, Object> params = getParameters();
|
||||
|
||||
if (value == null) {
|
||||
params.remove(key);
|
||||
|
||||
@@ -31,16 +31,22 @@ import com.opensymphony.xwork2.interceptor.MethodFilterInterceptorUtil;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.validator.ActionValidatorManager;
|
||||
import com.opensymphony.xwork2.validator.FieldValidator;
|
||||
import com.opensymphony.xwork2.validator.ValidationException;
|
||||
import com.opensymphony.xwork2.validator.ValidationInterceptor;
|
||||
import com.opensymphony.xwork2.validator.Validator;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import com.opensymphony.xwork2.validator.ValidatorContext;
|
||||
import com.opensymphony.xwork2.validator.validators.VisitorFieldValidator;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -116,14 +122,17 @@ public class Form extends ClosingUIBean {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean evaluateNameValue() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultOpenTemplate() {
|
||||
return OPEN_TEMPLATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
@@ -153,6 +162,7 @@ public class Form extends ClosingUIBean {
|
||||
* Revised for Portlet actionURL as form action, and add wwAction as hidden
|
||||
* field. Refer to template.simple/form.vm
|
||||
*/
|
||||
@Override
|
||||
protected void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
if (validate != null) {
|
||||
@@ -210,6 +220,7 @@ public class Form extends ClosingUIBean {
|
||||
* <li>if an 'action' attribute is specified, it will be used as the id.</li>
|
||||
* </ol>
|
||||
*/
|
||||
@Override
|
||||
protected void populateComponentHtmlId(Form form) {
|
||||
if (id != null) {
|
||||
addParameter("id", escape(id));
|
||||
@@ -262,20 +273,144 @@ public class Form extends ClosingUIBean {
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
List<Validator> all = actionValidatorManager.getValidators(actionClass, (String) getParameters().get("actionName"));
|
||||
String formActionValue = findString(action);
|
||||
ActionMapping mapping = actionMapper.getMappingFromActionName(formActionValue);
|
||||
String actionName = mapping.getName();
|
||||
String methodName = mapping.getMethod();
|
||||
|
||||
List<Validator> actionValidators = actionValidatorManager.getValidators(actionClass, actionName, methodName);
|
||||
List<Validator> validators = new ArrayList<Validator>();
|
||||
for (Validator validator : all) {
|
||||
if (validator instanceof FieldValidator) {
|
||||
FieldValidator fieldValidator = (FieldValidator) validator;
|
||||
if (fieldValidator.getFieldName().equals(name)) {
|
||||
validators.add(fieldValidator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
findFieldValidators(name, actionClass, actionName, actionValidators, validators, "");
|
||||
|
||||
return validators;
|
||||
}
|
||||
|
||||
private void findFieldValidators(String name, Class actionClass, String actionName,
|
||||
List<Validator> validatorList, List<Validator> retultValidators, String prefix) {
|
||||
|
||||
for (Validator validator : validatorList) {
|
||||
if (validator instanceof FieldValidator) {
|
||||
FieldValidator fieldValidator = (FieldValidator) validator;
|
||||
|
||||
if (validator instanceof VisitorFieldValidator) {
|
||||
VisitorFieldValidator vfValidator = (VisitorFieldValidator) fieldValidator;
|
||||
Class clazz = getVisitorReturnType(actionClass, vfValidator.getFieldName());
|
||||
if (clazz == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
List<Validator> visitorValidators = actionValidatorManager.getValidators(clazz, actionName);
|
||||
String vPrefix = prefix + (vfValidator.isAppendPrefix() ? vfValidator.getFieldName() + "." : "");
|
||||
findFieldValidators(name, clazz, actionName, visitorValidators, retultValidators, vPrefix);
|
||||
} else if ((prefix + fieldValidator.getFieldName()).equals(name)) {
|
||||
if (StringUtils.isNotBlank(prefix)) {
|
||||
//fixing field name for js side
|
||||
FieldVisitorValidatorWrapper wrap = new FieldVisitorValidatorWrapper(fieldValidator, prefix);
|
||||
retultValidators.add(wrap);
|
||||
} else {
|
||||
retultValidators.add(fieldValidator);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrap field validator, add visitor's field prefix to the field name.
|
||||
* Javascript side is not aware of the visitor validators
|
||||
* and does not know how to prefix the fields.
|
||||
*/
|
||||
/*
|
||||
* Class is public because Freemarker has problems accessing properties.
|
||||
*/
|
||||
public static class FieldVisitorValidatorWrapper implements FieldValidator {
|
||||
private FieldValidator fieldValidator;
|
||||
private String namePrefix;
|
||||
public FieldVisitorValidatorWrapper(FieldValidator fv, String namePrefix) {
|
||||
this.fieldValidator = fv;
|
||||
this.namePrefix = namePrefix;
|
||||
}
|
||||
public String getValidatorType() {
|
||||
return "field-visitor";
|
||||
}
|
||||
public String getFieldName() {
|
||||
return namePrefix + fieldValidator.getFieldName();
|
||||
}
|
||||
public FieldValidator getFieldValidator() {
|
||||
return fieldValidator;
|
||||
}
|
||||
public void setFieldValidator(FieldValidator fieldValidator) {
|
||||
this.fieldValidator = fieldValidator;
|
||||
}
|
||||
public String getDefaultMessage() {
|
||||
return fieldValidator.getDefaultMessage();
|
||||
}
|
||||
public String getMessage(Object object) {
|
||||
return fieldValidator.getMessage(object);
|
||||
}
|
||||
public String getMessageKey() {
|
||||
return fieldValidator.getMessageKey();
|
||||
}
|
||||
public String[] getMessageParameters() {
|
||||
return fieldValidator.getMessageParameters();
|
||||
}
|
||||
public ValidatorContext getValidatorContext() {
|
||||
return fieldValidator.getValidatorContext();
|
||||
}
|
||||
public void setDefaultMessage(String message) {
|
||||
fieldValidator.setDefaultMessage(message);
|
||||
}
|
||||
public void setFieldName(String fieldName) {
|
||||
fieldValidator.setFieldName(fieldName);
|
||||
}
|
||||
public void setMessageKey(String key) {
|
||||
fieldValidator.setMessageKey(key);
|
||||
}
|
||||
public void setMessageParameters(String[] messageParameters) {
|
||||
fieldValidator.setMessageParameters(messageParameters);
|
||||
}
|
||||
public void setValidatorContext(ValidatorContext validatorContext) {
|
||||
fieldValidator.setValidatorContext(validatorContext);
|
||||
}
|
||||
public void setValidatorType(String type) {
|
||||
fieldValidator.setValidatorType(type);
|
||||
}
|
||||
public void setValueStack(ValueStack stack) {
|
||||
fieldValidator.setValueStack(stack);
|
||||
}
|
||||
public void validate(Object object) throws ValidationException {
|
||||
fieldValidator.validate(object);
|
||||
}
|
||||
public String getNamePrefix() {
|
||||
return namePrefix;
|
||||
}
|
||||
public void setNamePrefix(String namePrefix) {
|
||||
this.namePrefix = namePrefix;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return type of visited object.
|
||||
* @param actionClass
|
||||
* @param visitorFieldName
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected Class getVisitorReturnType(Class actionClass, String visitorFieldName) {
|
||||
if (visitorFieldName == null) {
|
||||
return null;
|
||||
}
|
||||
String methodName = "get" + org.apache.commons.lang.StringUtils.capitalize(visitorFieldName);
|
||||
try {
|
||||
Method method = actionClass.getMethod(methodName, new Class[0]);
|
||||
return method.getReturnType();
|
||||
} catch (NoSuchMethodException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a incrementing sequence unique to this <code>Form</code> component.
|
||||
* It is used by <code>Form</code> component's child that might need a
|
||||
|
||||
@@ -43,7 +43,6 @@ import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -153,7 +152,7 @@ import java.util.concurrent.ConcurrentMap;
|
||||
* <td>define label position of form element (top/left), default to left</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>requiredposition</td>
|
||||
* <td>requiredPosition</td>
|
||||
* <td>xhtml</td>
|
||||
* <td>String</td>
|
||||
* <td>define required label position of form element (left/right), default to right</td>
|
||||
@@ -671,7 +670,7 @@ public abstract class UIBean extends Component {
|
||||
}
|
||||
|
||||
if (requiredPosition != null) {
|
||||
addParameter("requiredposition", findString(requiredPosition));
|
||||
addParameter("requiredPosition", findString(requiredPosition));
|
||||
}
|
||||
|
||||
if (errorPosition != null) {
|
||||
@@ -806,7 +805,7 @@ public abstract class UIBean extends Component {
|
||||
|
||||
if ( name != null ) {
|
||||
// list should have been created by the form component
|
||||
List tags = (List) form.getParameters().get("tagNames");
|
||||
List<String> tags = (List<String>) form.getParameters().get("tagNames");
|
||||
tags.add(name);
|
||||
}
|
||||
}
|
||||
@@ -829,8 +828,8 @@ public abstract class UIBean extends Component {
|
||||
Map overallTooltipConfigMap = getTooltipConfig(form);
|
||||
overallTooltipConfigMap.putAll(tooltipConfigMap); // override parent form's tooltip config
|
||||
|
||||
for (Iterator i = overallTooltipConfigMap.entrySet().iterator(); i.hasNext(); ) {
|
||||
Map.Entry entry = (Map.Entry) i.next();
|
||||
for (Object o : overallTooltipConfigMap.entrySet()) {
|
||||
Map.Entry entry = (Map.Entry) o;
|
||||
addParameter((String) entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
@@ -930,14 +929,14 @@ public abstract class UIBean extends Component {
|
||||
|
||||
protected Map getTooltipConfig(UIBean component) {
|
||||
Object tooltipConfigObj = component.getParameters().get("tooltipConfig");
|
||||
Map tooltipConfig = new LinkedHashMap();
|
||||
Map<String, String> tooltipConfig = new LinkedHashMap<String, String>();
|
||||
|
||||
if (tooltipConfigObj instanceof Map) {
|
||||
// we get this if its configured using
|
||||
// 1] UI component's tooltipConfig attribute OR
|
||||
// 2] <param name="tooltip" value="" /> param tag value attribute
|
||||
|
||||
tooltipConfig = new LinkedHashMap((Map)tooltipConfigObj);
|
||||
tooltipConfig = new LinkedHashMap<String, String>((Map)tooltipConfigObj);
|
||||
} else if (tooltipConfigObj instanceof String) {
|
||||
|
||||
// we get this if its configured using
|
||||
@@ -945,17 +944,16 @@ public abstract class UIBean extends Component {
|
||||
String tooltipConfigStr = (String) tooltipConfigObj;
|
||||
String[] tooltipConfigArray = tooltipConfigStr.split("\\|");
|
||||
|
||||
for (int a=0; a<tooltipConfigArray.length; a++) {
|
||||
String[] configEntry = ((String)tooltipConfigArray[a].trim()).split("=");
|
||||
for (String aTooltipConfigArray : tooltipConfigArray) {
|
||||
String[] configEntry = aTooltipConfigArray.trim().split("=");
|
||||
String key = configEntry[0].trim();
|
||||
String value = null;
|
||||
String value;
|
||||
if (configEntry.length > 1) {
|
||||
value = configEntry[1].trim();
|
||||
tooltipConfig.put(key, value);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("component "+component+" tooltip config param "+key+" has no value defined, skipped");
|
||||
LOG.warn("component " + component + " tooltip config param " + key + " has no value defined, skipped");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -970,7 +968,7 @@ public abstract class UIBean extends Component {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create HTML id element for the component and populate this component parmaeter
|
||||
* Create HTML id element for the component and populate this component parameter
|
||||
* map. Additionally, a parameter named escapedId is populated which contains the found id value filtered by
|
||||
* {@link #escape(String)}, needed eg. for naming Javascript identifiers based on the id value.
|
||||
*
|
||||
@@ -981,18 +979,23 @@ public abstract class UIBean extends Component {
|
||||
* <li>[this_component_name]</li>
|
||||
* </ol>
|
||||
*
|
||||
* @param form
|
||||
* @param form enclosing form tag
|
||||
*/
|
||||
protected void populateComponentHtmlId(Form form) {
|
||||
String tryId;
|
||||
String generatedId;
|
||||
if (id != null) {
|
||||
// this check is needed for backwards compatibility with 2.1.x
|
||||
tryId = findStringIfAltSyntax(id);
|
||||
} else if (null == (generatedId = escape(name != null ? findString(name) : null))) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Cannot determine id attribute for [#0], consider defining id, name or key attribute!", this);
|
||||
}
|
||||
tryId = null;
|
||||
} else if (form != null) {
|
||||
tryId = form.getParameters().get("id") + "_"
|
||||
+ escape(name != null ? findString(name) : null);
|
||||
tryId = form.getParameters().get("id") + "_" + generatedId;
|
||||
} else {
|
||||
tryId = escape(name != null ? findString(name) : null);
|
||||
tryId = generatedId;
|
||||
}
|
||||
addParameter("id", tryId);
|
||||
addParameter("escapedId", escape(tryId));
|
||||
|
||||
@@ -21,19 +21,17 @@
|
||||
|
||||
package org.apache.struts2.components;
|
||||
|
||||
import java.io.Writer;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
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 org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.Writer;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -64,15 +62,15 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
* <!-- START SNIPPET: params -->
|
||||
*
|
||||
* <ul>
|
||||
* <li>action (String) - (value or action choose either one, if both exist value takes precedence) action's name (alias) <li>
|
||||
* <li>action (String) - (value or action choose either one, if both exist value takes precedence) action's name (alias) </li>
|
||||
* <li>value (String) - (value or action choose either one, if both exist value takes precedence) the url itself</li>
|
||||
* <li>scheme (String) - http scheme (http, https) defaults to the scheme this request is in</li>
|
||||
* <li>namespace - action's namespace</li>
|
||||
* <li>method (String) - action's method name, defaults to 'execute'</li>
|
||||
* <li>encode (Boolean) - url encode the generated url. Defaults to 'true'.</li>
|
||||
* <li>includeParams (String) - The includeParams attribute may have the value 'none', 'get' or 'all'. Defaults to 'get'.
|
||||
* none - include no parameters in the URL
|
||||
* get - include only GET parameters in the URL (default)
|
||||
* <li>includeParams (String) - The includeParams attribute may have the value 'none', 'get' or 'all'. Defaults to 'none'.
|
||||
* none - include no parameters in the URL (default)
|
||||
* get - include only GET parameters in the URL
|
||||
* all - include both GET and POST parameters in the URL
|
||||
* </li>
|
||||
* <li>includeContext (Boolean) - Specifies whether to include the web app context path. Defaults to 'true'.</li>
|
||||
|
||||
@@ -49,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;
|
||||
@@ -276,6 +273,13 @@ import java.util.StringTokenizer;
|
||||
* <td>singleton</td>
|
||||
* <td>Holds user converters' instances</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>com.opensymphony.xwork2.util.TextParser</td>
|
||||
* <td>struts.expression.parser</td>
|
||||
* <td>singleton</td>
|
||||
* <td>Used to parse expressions like ${foo.bar} or %{bar.foo} but it is up tp the TextParser's
|
||||
* implementation what kind of opening char to use (#, $, %, etc)</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* <!-- END SNIPPET: extensionPoints -->
|
||||
@@ -355,6 +359,8 @@ public class BeanSelectionProvider implements ConfigurationProvider {
|
||||
alias(UnknownHandlerManager.class, StrutsConstants.STRUTS_UNKNOWN_HANDLER_MANAGER, builder, props);
|
||||
alias(UrlHelper.class, StrutsConstants.STRUTS_URL_HELPER, builder, props);
|
||||
|
||||
alias(TextParser.class, StrutsConstants.STRUTS_EXPRESSION_PARSER, builder, props);
|
||||
|
||||
if ("true".equalsIgnoreCase(props.getProperty(StrutsConstants.STRUTS_DEVMODE))) {
|
||||
props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD, "true");
|
||||
props.setProperty(StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, "true");
|
||||
@@ -369,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);
|
||||
|
||||
|
||||
+6
-7
@@ -21,22 +21,21 @@
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.config.ConfigurationProvider;
|
||||
import com.opensymphony.xwork2.inject.ContainerBuilder;
|
||||
import com.opensymphony.xwork2.inject.Context;
|
||||
import com.opensymphony.xwork2.inject.Factory;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.location.LocatableProperties;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
public class LegacyPropertiesConfigurationProvider implements ConfigurationProvider {
|
||||
|
||||
/**
|
||||
@@ -69,10 +68,10 @@ public class LegacyPropertiesConfigurationProvider implements ConfigurationProvi
|
||||
loadSettings(props, settings);
|
||||
|
||||
// Set default locale by lazily resolving the locale property as needed into a Locale object
|
||||
builder.factory(Locale.class, new Factory() {
|
||||
builder.factory(Locale.class, new Factory<Locale>() {
|
||||
private Locale locale;
|
||||
|
||||
public synchronized Object create(Context context) throws Exception {
|
||||
public synchronized Locale create(Context context) throws Exception {
|
||||
if (locale == null) {
|
||||
String loc = context.getContainer().getInstance(String.class, StrutsConstants.STRUTS_LOCALE);
|
||||
if (loc != null) {
|
||||
|
||||
@@ -21,16 +21,14 @@
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.util.location.Location;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
|
||||
|
||||
/**
|
||||
@@ -74,6 +72,11 @@ class Settings {
|
||||
*/
|
||||
static Settings defaultImpl;
|
||||
|
||||
/**
|
||||
* Guard used to protect the defaultImpl initialisation.
|
||||
*/
|
||||
private static final Object DEFAULT_LOCK = new Object();
|
||||
|
||||
/**
|
||||
* An instance of the default locale as specified by the <code>struts.locale</code> setting.
|
||||
*
|
||||
@@ -267,23 +270,27 @@ class Settings {
|
||||
*/
|
||||
private static Settings getDefaultInstance() {
|
||||
if (defaultImpl == null) {
|
||||
// Create bootstrap implementation
|
||||
defaultImpl = new DefaultSettings();
|
||||
synchronized (DEFAULT_LOCK) {
|
||||
if (defaultImpl == null) {
|
||||
// Create bootstrap implementation
|
||||
defaultImpl = new DefaultSettings();
|
||||
|
||||
// Create default implementation
|
||||
try {
|
||||
String className = get(StrutsConstants.STRUTS_CONFIGURATION);
|
||||
|
||||
if (!className.equals(defaultImpl.getClass().getName())) {
|
||||
// Create default implementation
|
||||
try {
|
||||
// singleton instances shouldn't be built accessing request or session-specific context data
|
||||
defaultImpl = (Settings) ObjectFactory.getObjectFactory().buildBean(Thread.currentThread().getContextClassLoader().loadClass(className), null);
|
||||
} catch (Exception e) {
|
||||
LOG.error("Settings: Could not instantiate the struts.configuration object, substituting the default implementation.", e);
|
||||
String className = get(StrutsConstants.STRUTS_CONFIGURATION);
|
||||
|
||||
if (!className.equals(defaultImpl.getClass().getName())) {
|
||||
try {
|
||||
// singleton instances shouldn't be built accessing request or session-specific context data
|
||||
defaultImpl = (Settings) ObjectFactory.getObjectFactory().buildBean(Thread.currentThread().getContextClassLoader().loadClass(className), null);
|
||||
} catch (Exception e) {
|
||||
LOG.error("Settings: Could not instantiate the struts.configuration object, substituting the default implementation.", e);
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException ex) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException ex) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,7 +301,10 @@ class Settings {
|
||||
* Resets the default and any plugin Setting instance to null.
|
||||
*/
|
||||
public static void reset() {
|
||||
defaultImpl = null;
|
||||
synchronized (DEFAULT_LOCK) {
|
||||
defaultImpl = null;
|
||||
}
|
||||
settingsImpl = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class ContainerHolder {
|
||||
}
|
||||
|
||||
public static void clear() {
|
||||
ContainerHolder.instance.set(null);
|
||||
ContainerHolder.instance.remove();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -119,10 +119,15 @@ public class Dispatcher {
|
||||
private ConfigurationManager configurationManager;
|
||||
|
||||
/**
|
||||
* Store state of StrutsConstants.STRUTS_DEVMODE setting.
|
||||
* Store state of StrutsConstants.STRUTS_DEVMODE setting.
|
||||
*/
|
||||
private boolean devMode;
|
||||
|
||||
/**
|
||||
* Store state of StrutsConstants.DISABLE_REQUEST_ATTRIBUTE_VALUE_STACK_LOOKUP setting.
|
||||
*/
|
||||
private boolean disableRequestAttributeValueStackLookup;
|
||||
|
||||
/**
|
||||
* Store state of StrutsConstants.STRUTS_I18N_ENCODING setting.
|
||||
*/
|
||||
@@ -225,6 +230,15 @@ public class Dispatcher {
|
||||
devMode = "true".equals(mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify state of StrutsConstants.DISABLE_REQUEST_ATTRIBUTE_VALUE_STACK_LOOKUP setting.
|
||||
* @param disableRequestAttributeValueStackLookup New setting
|
||||
*/
|
||||
@Inject(value=StrutsConstants.STRUTS_DISABLE_REQUEST_ATTRIBUTE_VALUE_STACK_LOOKUP, required=false)
|
||||
public void setDisableRequestAttributeValueStackLookup(String disableRequestAttributeValueStackLookup) {
|
||||
this.disableRequestAttributeValueStackLookup = "true".equalsIgnoreCase(disableRequestAttributeValueStackLookup);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify state of StrutsConstants.STRUTS_LOCALE setting.
|
||||
* @param val New setting
|
||||
@@ -315,6 +329,9 @@ public class Dispatcher {
|
||||
interceptor.destroy();
|
||||
}
|
||||
|
||||
// Clear container holder when application is unloaded / server shutdown
|
||||
ContainerHolder.clear();
|
||||
|
||||
//cleanup action context
|
||||
ActionContext.setContext(null);
|
||||
|
||||
@@ -778,7 +795,7 @@ public class Dispatcher {
|
||||
LocaleProvider provider = getContainer().getInstance(LocaleProvider.class);
|
||||
request = new MultiPartRequestWrapper(mpr, request, getSaveDir(servletContext), provider);
|
||||
} else {
|
||||
request = new StrutsRequestWrapper(request);
|
||||
request = new StrutsRequestWrapper(request, disableRequestAttributeValueStackLookup);
|
||||
}
|
||||
|
||||
return request;
|
||||
@@ -812,6 +829,7 @@ public class Dispatcher {
|
||||
* @see org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper
|
||||
*/
|
||||
public void cleanUpRequest(HttpServletRequest request) {
|
||||
ContainerHolder.clear();
|
||||
if (!(request instanceof MultiPartRequestWrapper)) {
|
||||
return;
|
||||
}
|
||||
@@ -892,7 +910,15 @@ public class Dispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cleanup any resources used to initialise Dispatcher
|
||||
*/
|
||||
public void cleanUpAfterInit() {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Cleaning up resources used to init Dispatcher");
|
||||
}
|
||||
ContainerHolder.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Provide an accessor class for static XWork utility.
|
||||
|
||||
@@ -82,6 +82,11 @@ public class HttpHeaderResult implements Result {
|
||||
private static final long serialVersionUID = 195648957144219214L;
|
||||
private static final Logger LOG = LoggerFactory.getLogger(HttpHeaderResult.class);
|
||||
|
||||
/**
|
||||
* This result type doesn't have a default param, null is ok to reduce noice in logs
|
||||
*/
|
||||
public static final String DEFAULT_PARAM = null;
|
||||
|
||||
private boolean parse = true;
|
||||
private Map<String, String> headers;
|
||||
private int status = -1;
|
||||
|
||||
@@ -198,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"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,11 +21,13 @@
|
||||
|
||||
package org.apache.struts2.dispatcher;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import static org.apache.commons.lang3.BooleanUtils.isTrue;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -41,49 +43,61 @@ import com.opensymphony.xwork2.util.ValueStack;
|
||||
*/
|
||||
public class StrutsRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
private static final String REQUEST_WRAPPER_GET_ATTRIBUTE = "__requestWrapper.getAttribute";
|
||||
private final boolean disableRequestAttributeValueStackLookup;
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
* @param req The request
|
||||
*/
|
||||
public StrutsRequestWrapper(HttpServletRequest req) {
|
||||
this(req, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* The constructor
|
||||
* @param req The request
|
||||
* @param disableRequestAttributeValueStackLookup flag for disabling request attribute value stack lookup (JSTL accessibility)
|
||||
*/
|
||||
public StrutsRequestWrapper(HttpServletRequest req, boolean disableRequestAttributeValueStackLookup) {
|
||||
super(req);
|
||||
this.disableRequestAttributeValueStackLookup = disableRequestAttributeValueStackLookup;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the object, looking in the value stack if not found
|
||||
*
|
||||
* @param s The attribute key
|
||||
* @param key The attribute key
|
||||
*/
|
||||
public Object getAttribute(String s) {
|
||||
if (s != null && s.startsWith("javax.servlet")) {
|
||||
public Object getAttribute(String key) {
|
||||
if (key == null) {
|
||||
throw new NullPointerException("You must specify a key value");
|
||||
}
|
||||
|
||||
if (disableRequestAttributeValueStackLookup || key.startsWith("javax.servlet")) {
|
||||
// don't bother with the standard javax.servlet attributes, we can short-circuit this
|
||||
// see WW-953 and the forums post linked in that issue for more info
|
||||
return super.getAttribute(s);
|
||||
return super.getAttribute(key);
|
||||
}
|
||||
|
||||
ActionContext ctx = ActionContext.getContext();
|
||||
Object attribute = super.getAttribute(s);
|
||||
if (ctx != null) {
|
||||
if (attribute == null) {
|
||||
boolean alreadyIn = false;
|
||||
Boolean b = (Boolean) ctx.get("__requestWrapper.getAttribute");
|
||||
if (b != null) {
|
||||
alreadyIn = b.booleanValue();
|
||||
}
|
||||
|
||||
// note: we don't let # come through or else a request for
|
||||
// #attr.foo or #request.foo could cause an endless loop
|
||||
if (!alreadyIn && s.indexOf("#") == -1) {
|
||||
try {
|
||||
// If not found, then try the ValueStack
|
||||
ctx.put("__requestWrapper.getAttribute", Boolean.TRUE);
|
||||
ValueStack stack = ctx.getValueStack();
|
||||
if (stack != null) {
|
||||
attribute = stack.findValue(s);
|
||||
}
|
||||
} finally {
|
||||
ctx.put("__requestWrapper.getAttribute", Boolean.FALSE);
|
||||
Object attribute = super.getAttribute(key);
|
||||
|
||||
if (ctx != null && attribute == null) {
|
||||
boolean alreadyIn = isTrue((Boolean) ctx.get(REQUEST_WRAPPER_GET_ATTRIBUTE));
|
||||
|
||||
// note: we don't let # come through or else a request for
|
||||
// #attr.foo or #request.foo could cause an endless loop
|
||||
if (!alreadyIn && !key.contains("#")) {
|
||||
try {
|
||||
// If not found, then try the ValueStack
|
||||
ctx.put(REQUEST_WRAPPER_GET_ATTRIBUTE, Boolean.TRUE);
|
||||
ValueStack stack = ctx.getValueStack();
|
||||
if (stack != null) {
|
||||
attribute = stack.findValue(key);
|
||||
}
|
||||
} finally {
|
||||
ctx.put(REQUEST_WRAPPER_GET_ATTRIBUTE, Boolean.FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
package org.apache.struts2.dispatcher.mapper;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.opensymphony.xwork2.Result;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Simple class that holds the action mapping information used to invoke a
|
||||
* Struts action. The name and namespace are required, but the params map
|
||||
@@ -157,4 +157,17 @@ public class ActionMapping {
|
||||
public void setExtension(String extension) {
|
||||
this.extension = extension;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ActionMapping{" +
|
||||
"name='" + name + '\'' +
|
||||
", namespace='" + namespace + '\'' +
|
||||
", method='" + method + '\'' +
|
||||
", extension='" + extension + '\'' +
|
||||
", params=" + params +
|
||||
", result=" + (result != null ? result.getClass().getName() : "null") +
|
||||
'}';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+10
-53
@@ -21,60 +21,24 @@
|
||||
|
||||
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.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
*
|
||||
* A composite action mapper that is capable of delegating to a series of {@link ActionMapper} if the former
|
||||
* failed to obtained a valid {@link ActionMapping} or uri.
|
||||
* <p/>
|
||||
* It is configured through struts.properties.
|
||||
* <p/>
|
||||
* For example, with the following entries in struts.properties
|
||||
* <p/>
|
||||
* <pre>
|
||||
* <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts"
|
||||
* class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper" />
|
||||
* <constant name="struts.mapper.composite"
|
||||
* value="org.apache.struts2.dispatcher.mapper.DefaultActionMapper,org.apache.struts2.dispatcher.mapper.RestfulActionMapper,org.apache.struts2.dispatcher.mapper.Restful2ActionMapper" />
|
||||
* </pre>
|
||||
* <p/>
|
||||
* When {@link CompositeActionMapper#getMapping(HttpServletRequest, ConfigurationManager)} or
|
||||
* {@link CompositeActionMapper#getUriFromActionMapping(ActionMapping)} is invoked,
|
||||
* {@link CompositeActionMapper} would go through these {@link ActionMapper}s in sequence
|
||||
* starting from {@link ActionMapper} identified by 'struts.mapper.composite.1', followed by
|
||||
* 'struts.mapper.composite.2' and finally 'struts.mapper.composite.3' (in this case) until either
|
||||
* one of the {@link ActionMapper} return a valid result (not null) or it runs out of {@link ActionMapper}
|
||||
* in which case it will just return null for both
|
||||
* {@link CompositeActionMapper#getMapping(HttpServletRequest, ConfigurationManager)} and
|
||||
* {@link CompositeActionMapper#getUriFromActionMapping(ActionMapping)} methods.
|
||||
* <p/>
|
||||
*
|
||||
* For example with the following in struts-*.xml :-
|
||||
* <pre>
|
||||
* <bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts"
|
||||
* class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper" />
|
||||
* <constant name="struts.mapper.composite"
|
||||
* value="org.apache.struts2.dispatcher.mapper.DefaultActionMapper,foo.bar.MyActionMapper,foo.bar.MyAnotherActionMapper" />
|
||||
* </pre>
|
||||
* <p/>
|
||||
* <code>CompositeActionMapper</code> will be configured with 3 ActionMapper, namely
|
||||
* "DefaultActionMapper", "MyActionMapper" and "MyAnotherActionMapper".
|
||||
* <code>CompositeActionMapper</code> would consult each of them in order described above.
|
||||
*
|
||||
* <!-- END SNIPPET: description -->
|
||||
* More details: http://struts.apache.org/2.x/docs/actionmapper.html
|
||||
*
|
||||
* @see ActionMapper
|
||||
* @see ActionMapping
|
||||
@@ -85,17 +49,11 @@ public class CompositeActionMapper implements ActionMapper {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(CompositeActionMapper.class);
|
||||
|
||||
protected Container container;
|
||||
|
||||
protected List<ActionMapper> actionMappers = new ArrayList<ActionMapper>();
|
||||
|
||||
protected List<ActionMapper> actionMappers = new LinkedList<ActionMapper>();
|
||||
|
||||
@Inject
|
||||
public void setContainer(Container container) {
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_MAPPER_COMPOSITE)
|
||||
public void setActionMappers(String list) {
|
||||
public CompositeActionMapper(Container container,
|
||||
@Inject(value = StrutsConstants.STRUTS_MAPPER_COMPOSITE) String list) {
|
||||
if (list != null) {
|
||||
String[] arr = list.split(",");
|
||||
for (String name : arr) {
|
||||
@@ -107,7 +65,6 @@ public class CompositeActionMapper implements ActionMapper {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
|
||||
|
||||
for (ActionMapper actionMapper : actionMappers) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/*
|
||||
* $Id$
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
@@ -27,11 +28,13 @@ 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 com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.struts2.RequestUtils;
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.dispatcher.ServletRedirectResult;
|
||||
import org.apache.struts2.dispatcher.ServletDispatcherResult;
|
||||
import org.apache.struts2.util.PrefixTrie;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -41,6 +44,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
@@ -162,15 +166,17 @@ import java.util.Set;
|
||||
*/
|
||||
public class DefaultActionMapper implements ActionMapper {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DefaultActionMapper.class);
|
||||
|
||||
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:";
|
||||
private static final String STRUTS2_ACTION_PREFIX_PARSED = "_struts2_action_prefix_parsed";
|
||||
|
||||
protected boolean allowDynamicMethodCalls = true;
|
||||
protected boolean allowDynamicMethodCalls = false;
|
||||
protected boolean allowSlashesInActionNames = false;
|
||||
protected boolean alwaysSelectFullNamespace = false;
|
||||
protected PrefixTrie prefixTrie = null;
|
||||
protected Pattern allowedActionNames = Pattern.compile("[a-zA-Z0-9._!/\\-]*");
|
||||
|
||||
protected List<String> extensions = new ArrayList<String>() {{
|
||||
add("action");
|
||||
@@ -183,53 +189,36 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
prefixTrie = new PrefixTrie() {
|
||||
{
|
||||
put(METHOD_PREFIX, new ParameterAction() {
|
||||
public void execute(String key, ActionMapping mapping) {
|
||||
public void execute(String key, ActionMapping mapping, HttpServletRequest request) {
|
||||
if (allowDynamicMethodCalls) {
|
||||
mapping.setMethod(key.substring(
|
||||
METHOD_PREFIX.length()));
|
||||
mapping.setMethod(key.substring(METHOD_PREFIX.length()));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
put(ACTION_PREFIX, new ParameterAction() {
|
||||
public void execute(String key, ActionMapping mapping) {
|
||||
String name = key.substring(ACTION_PREFIX.length());
|
||||
if (allowDynamicMethodCalls) {
|
||||
int bang = name.indexOf('!');
|
||||
if (bang != -1) {
|
||||
String method = name.substring(bang + 1);
|
||||
mapping.setMethod(method);
|
||||
name = name.substring(0, bang);
|
||||
public void execute(final String key, ActionMapping mapping, HttpServletRequest request) {
|
||||
if (request != null && request.getAttribute(STRUTS2_ACTION_PREFIX_PARSED) == null) {
|
||||
request.setAttribute(STRUTS2_ACTION_PREFIX_PARSED, true);
|
||||
String name = key.substring(ACTION_PREFIX.length());
|
||||
if (allowDynamicMethodCalls) {
|
||||
int bang = name.indexOf('!');
|
||||
if (bang != -1) {
|
||||
String method = name.substring(bang + 1);
|
||||
mapping.setMethod(method);
|
||||
name = name.substring(0, bang);
|
||||
}
|
||||
}
|
||||
String actionName = cleanupActionName(name);
|
||||
mapping.setName(actionName);
|
||||
if (getDefaultExtension() != null) {
|
||||
actionName = actionName + "." + getDefaultExtension();
|
||||
}
|
||||
mapping.setResult(new ServletDispatcherResult(actionName));
|
||||
}
|
||||
mapping.setName(name);
|
||||
}
|
||||
});
|
||||
|
||||
put(REDIRECT_PREFIX, new ParameterAction() {
|
||||
public void execute(String key, ActionMapping mapping) {
|
||||
ServletRedirectResult redirect = new ServletRedirectResult();
|
||||
container.inject(redirect);
|
||||
redirect.setLocation(key.substring(REDIRECT_PREFIX
|
||||
.length()));
|
||||
mapping.setResult(redirect);
|
||||
}
|
||||
});
|
||||
|
||||
put(REDIRECT_ACTION_PREFIX, new ParameterAction() {
|
||||
public void execute(String key, ActionMapping mapping) {
|
||||
String location = key.substring(REDIRECT_ACTION_PREFIX
|
||||
.length());
|
||||
ServletRedirectResult redirect = new ServletRedirectResult();
|
||||
container.inject(redirect);
|
||||
String extension = getDefaultExtension();
|
||||
if (extension != null && extension.length() > 0) {
|
||||
location += "." + extension;
|
||||
}
|
||||
redirect.setLocation(location);
|
||||
mapping.setResult(redirect);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -247,7 +236,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION)
|
||||
public void setAllowDynamicMethodCalls(String allow) {
|
||||
allowDynamicMethodCalls = "true".equals(allow);
|
||||
allowDynamicMethodCalls = "true".equalsIgnoreCase(allow);
|
||||
}
|
||||
|
||||
@Inject(StrutsConstants.STRUTS_ENABLE_SLASHES_IN_ACTION_NAMES)
|
||||
@@ -260,6 +249,11 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
this.alwaysSelectFullNamespace = "true".equals(val);
|
||||
}
|
||||
|
||||
@Inject(value = StrutsConstants.STRUTS_ALLOWED_ACTION_NAMES, required = false)
|
||||
public void setAllowedActionNames(String allowedActionNames) {
|
||||
this.allowedActionNames = Pattern.compile(allowedActionNames);
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setContainer(Container container) {
|
||||
this.container = container;
|
||||
@@ -295,8 +289,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
*
|
||||
* @see org.apache.struts2.dispatcher.mapper.ActionMapper#getMapping(javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
public ActionMapping getMapping(HttpServletRequest request,
|
||||
ConfigurationManager configManager) {
|
||||
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
|
||||
ActionMapping mapping = new ActionMapping();
|
||||
String uri = getUri(request);
|
||||
|
||||
@@ -309,22 +302,13 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
}
|
||||
|
||||
parseNameAndNamespace(uri, mapping, configManager);
|
||||
|
||||
handleSpecialParameters(request, mapping);
|
||||
|
||||
// if Action name is empty it can be a request to static resource, return null to handle that case
|
||||
if (StringUtils.isEmpty(mapping.getName())) {
|
||||
return null;
|
||||
}
|
||||
|
||||
parseActionName(mapping);
|
||||
|
||||
return mapping;
|
||||
return parseActionName(mapping);
|
||||
}
|
||||
|
||||
protected ActionMapping parseActionName(ActionMapping mapping) {
|
||||
if (mapping.getName() == null) {
|
||||
return mapping;
|
||||
return null;
|
||||
}
|
||||
if (allowDynamicMethodCalls) {
|
||||
// handle "name!method" convention.
|
||||
@@ -346,8 +330,7 @@ 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();
|
||||
@@ -363,7 +346,7 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
if (!uniqueParameters.contains(key)) {
|
||||
ParameterAction parameterAction = (ParameterAction) prefixTrie.get(key);
|
||||
if (parameterAction != null) {
|
||||
parameterAction.execute(key, mapping);
|
||||
parameterAction.execute(key, mapping, request);
|
||||
uniqueParameters.add(key);
|
||||
break;
|
||||
}
|
||||
@@ -377,8 +360,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) {
|
||||
@@ -421,7 +403,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);
|
||||
@@ -429,7 +411,32 @@ public class DefaultActionMapper implements ActionMapper {
|
||||
}
|
||||
|
||||
mapping.setNamespace(namespace);
|
||||
mapping.setName(name);
|
||||
mapping.setName(cleanupActionName(name));
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans up action name from suspicious characters
|
||||
*
|
||||
* @param rawActionName action name extracted from URI
|
||||
* @return safe action name
|
||||
*/
|
||||
protected String cleanupActionName(final String rawActionName) {
|
||||
if (allowedActionNames.matcher(rawActionName).matches()) {
|
||||
return rawActionName;
|
||||
} else {
|
||||
if (LOG.isWarnEnabled()) {
|
||||
LOG.warn("Action [#0] does not match allowed action names pattern [#1], cleaning it up!",
|
||||
rawActionName, allowedActionNames);
|
||||
}
|
||||
String cleanActionName = rawActionName;
|
||||
for(String chunk : allowedActionNames.split(rawActionName)) {
|
||||
cleanActionName = cleanActionName.replace(chunk, "");
|
||||
}
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Cleaned action name [#0]", cleanActionName);
|
||||
}
|
||||
return cleanActionName;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
|
||||
package org.apache.struts2.dispatcher.mapper;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* Defines a parameter action prefix. This is executed when the configured prefix key is matched in a parameter
|
||||
* name, allowing the implementation to manipulate the action mapping accordingly. For example, if the "action:foo"
|
||||
@@ -30,5 +32,5 @@ package org.apache.struts2.dispatcher.mapper;
|
||||
* @since 2.1.0
|
||||
*/
|
||||
public interface ParameterAction {
|
||||
void execute(String key, ActionMapping mapping);
|
||||
void execute(String key, ActionMapping mapping, HttpServletRequest request);
|
||||
}
|
||||
|
||||
+19
-13
@@ -22,12 +22,17 @@ package org.apache.struts2.dispatcher.ng.filter;
|
||||
|
||||
import org.apache.struts2.StrutsStatics;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import org.apache.struts2.dispatcher.ng.PrepareOperations;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.dispatcher.ng.ExecuteOperations;
|
||||
import org.apache.struts2.dispatcher.ng.InitOperations;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.dispatcher.ng.PrepareOperations;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@@ -63,15 +68,15 @@ public class StrutsExecuteFilter implements StrutsStatics, Filter {
|
||||
HttpServletRequest request = (HttpServletRequest) req;
|
||||
HttpServletResponse response = (HttpServletResponse) res;
|
||||
|
||||
if (excludeUrl(request)) {
|
||||
chain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
if (excludeUrl(request)) {
|
||||
chain.doFilter(request, response);
|
||||
return;
|
||||
}
|
||||
|
||||
// This is necessary since we need the dispatcher instance, which was created by the prepare filter
|
||||
if (execute == null) {
|
||||
lazyInit();
|
||||
}
|
||||
if (execute == null) {
|
||||
lazyInit();
|
||||
}
|
||||
|
||||
ActionMapping mapping = prepare.findActionMapping(request, response);
|
||||
|
||||
@@ -89,13 +94,14 @@ public class StrutsExecuteFilter implements StrutsStatics, Filter {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean excludeUrl(HttpServletRequest request) {
|
||||
return request.getAttribute(StrutsPrepareFilter.REQUEST_EXCLUDED_FROM_ACTION_MAPPING) != null;
|
||||
}
|
||||
private boolean excludeUrl(HttpServletRequest request) {
|
||||
return request.getAttribute(StrutsPrepareFilter.REQUEST_EXCLUDED_FROM_ACTION_MAPPING) != null;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
prepare = null;
|
||||
execute = null;
|
||||
filterConfig = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+28
-19
@@ -27,7 +27,12 @@ import org.apache.struts2.dispatcher.ng.ExecuteOperations;
|
||||
import org.apache.struts2.dispatcher.ng.InitOperations;
|
||||
import org.apache.struts2.dispatcher.ng.PrepareOperations;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@@ -41,25 +46,28 @@ import java.util.regex.Pattern;
|
||||
public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter {
|
||||
protected PrepareOperations prepare;
|
||||
protected ExecuteOperations execute;
|
||||
protected List<Pattern> excludedPatterns = null;
|
||||
protected List<Pattern> excludedPatterns = null;
|
||||
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
InitOperations init = new InitOperations();
|
||||
Dispatcher dispatcher = null;
|
||||
try {
|
||||
FilterHostConfig config = new FilterHostConfig(filterConfig);
|
||||
init.initLogging(config);
|
||||
Dispatcher dispatcher = init.initDispatcher(config);
|
||||
dispatcher = init.initDispatcher(config);
|
||||
init.initStaticContentLoader(config, dispatcher);
|
||||
|
||||
prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
|
||||
execute = new ExecuteOperations(filterConfig.getServletContext(), dispatcher);
|
||||
this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
|
||||
this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
|
||||
|
||||
postInit(dispatcher, filterConfig);
|
||||
} finally {
|
||||
if (dispatcher != null) {
|
||||
dispatcher.cleanUpAfterInit();
|
||||
}
|
||||
init.cleanup();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,20 +85,20 @@ public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter {
|
||||
prepare.setEncodingAndLocale(request, response);
|
||||
prepare.createActionContext(request, response);
|
||||
prepare.assignDispatcherToThread();
|
||||
if ( excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) {
|
||||
chain.doFilter(request, response);
|
||||
} else {
|
||||
request = prepare.wrapRequest(request);
|
||||
ActionMapping mapping = prepare.findActionMapping(request, response, true);
|
||||
if (mapping == null) {
|
||||
boolean handled = execute.executeStaticResourceRequest(request, response);
|
||||
if (!handled) {
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
} else {
|
||||
execute.executeAction(request, response, mapping);
|
||||
}
|
||||
}
|
||||
if (excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) {
|
||||
chain.doFilter(request, response);
|
||||
} else {
|
||||
request = prepare.wrapRequest(request);
|
||||
ActionMapping mapping = prepare.findActionMapping(request, response, true);
|
||||
if (mapping == null) {
|
||||
boolean handled = execute.executeStaticResourceRequest(request, response);
|
||||
if (!handled) {
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
} else {
|
||||
execute.executeAction(request, response, mapping);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
prepare.cleanupRequest(request);
|
||||
}
|
||||
@@ -99,4 +107,5 @@ public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter {
|
||||
public void destroy() {
|
||||
prepare.cleanupDispatcher();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+23
-13
@@ -25,7 +25,12 @@ import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import org.apache.struts2.dispatcher.ng.InitOperations;
|
||||
import org.apache.struts2.dispatcher.ng.PrepareOperations;
|
||||
|
||||
import javax.servlet.*;
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@@ -37,23 +42,27 @@ import java.util.regex.Pattern;
|
||||
*/
|
||||
public class StrutsPrepareFilter implements StrutsStatics, Filter {
|
||||
|
||||
protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING = StrutsPrepareFilter.class.getName() + ".REQUEST_EXCLUDED_FROM_ACTION_MAPPING";
|
||||
protected static final String REQUEST_EXCLUDED_FROM_ACTION_MAPPING = StrutsPrepareFilter.class.getName() + ".REQUEST_EXCLUDED_FROM_ACTION_MAPPING";
|
||||
|
||||
protected PrepareOperations prepare;
|
||||
protected List<Pattern> excludedPatterns = null;
|
||||
protected List<Pattern> excludedPatterns = null;
|
||||
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
public void init(FilterConfig filterConfig) throws ServletException {
|
||||
InitOperations init = new InitOperations();
|
||||
Dispatcher dispatcher = null;
|
||||
try {
|
||||
FilterHostConfig config = new FilterHostConfig(filterConfig);
|
||||
init.initLogging(config);
|
||||
Dispatcher dispatcher = init.initDispatcher(config);
|
||||
dispatcher = init.initDispatcher(config);
|
||||
|
||||
prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
|
||||
this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
|
||||
this.excludedPatterns = init.buildExcludedPatternsList(dispatcher);
|
||||
|
||||
postInit(dispatcher, filterConfig);
|
||||
} finally {
|
||||
if (dispatcher != null) {
|
||||
dispatcher.cleanUpAfterInit();
|
||||
}
|
||||
init.cleanup();
|
||||
}
|
||||
}
|
||||
@@ -73,19 +82,20 @@ public class StrutsPrepareFilter implements StrutsStatics, Filter {
|
||||
prepare.setEncodingAndLocale(request, response);
|
||||
prepare.createActionContext(request, response);
|
||||
prepare.assignDispatcherToThread();
|
||||
if ( excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) {
|
||||
request.setAttribute(REQUEST_EXCLUDED_FROM_ACTION_MAPPING, new Object());
|
||||
} else {
|
||||
request = prepare.wrapRequest(request);
|
||||
prepare.findActionMapping(request, response);
|
||||
}
|
||||
if (excludedPatterns != null && prepare.isUrlExcluded(request, excludedPatterns)) {
|
||||
request.setAttribute(REQUEST_EXCLUDED_FROM_ACTION_MAPPING, new Object());
|
||||
} else {
|
||||
request = prepare.wrapRequest(request);
|
||||
prepare.findActionMapping(request, response);
|
||||
}
|
||||
chain.doFilter(request, response);
|
||||
} finally {
|
||||
prepare.cleanupRequest(request);
|
||||
}
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
public void destroy() {
|
||||
prepare.cleanupDispatcher();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
*/
|
||||
package org.apache.struts2.dispatcher.ng.listener;
|
||||
|
||||
import org.apache.struts2.ServletActionContext;
|
||||
import org.apache.struts2.StrutsConstants;
|
||||
import org.apache.struts2.StrutsStatics;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import org.apache.struts2.dispatcher.ng.InitOperations;
|
||||
@@ -34,22 +32,26 @@ import javax.servlet.ServletContextListener;
|
||||
* Servlet listener for Struts. The preferred way to use Struts is as a filter via the
|
||||
* {@link org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter} and its variants.
|
||||
* This might be useful if Struts config information is needed from other servlet listeners, like
|
||||
* Sitemesh or OSGi
|
||||
* Sitemesh or OSGi
|
||||
*/
|
||||
public class StrutsListener implements ServletContextListener {
|
||||
private PrepareOperations prepare;
|
||||
|
||||
public void contextInitialized(ServletContextEvent sce) {
|
||||
InitOperations init = new InitOperations();
|
||||
InitOperations init = new InitOperations();
|
||||
Dispatcher dispatcher = null;
|
||||
try {
|
||||
ListenerHostConfig config = new ListenerHostConfig(sce.getServletContext());
|
||||
init.initLogging(config);
|
||||
Dispatcher dispatcher = init.initDispatcher(config);
|
||||
dispatcher = init.initDispatcher(config);
|
||||
init.initStaticContentLoader(config, dispatcher);
|
||||
|
||||
prepare = new PrepareOperations(config.getServletContext(), dispatcher);
|
||||
sce.getServletContext().setAttribute(StrutsStatics.SERVLET_DISPATCHER, dispatcher);
|
||||
} finally {
|
||||
if (dispatcher != null) {
|
||||
dispatcher.cleanUpAfterInit();
|
||||
}
|
||||
init.cleanup();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,15 +21,16 @@
|
||||
package org.apache.struts2.dispatcher.ng.servlet;
|
||||
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
import org.apache.struts2.dispatcher.ng.ExecuteOperations;
|
||||
import org.apache.struts2.dispatcher.ng.InitOperations;
|
||||
import org.apache.struts2.dispatcher.ng.PrepareOperations;
|
||||
import org.apache.struts2.dispatcher.ng.ExecuteOperations;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapping;
|
||||
|
||||
import javax.servlet.ServletConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.*;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
@@ -46,15 +47,19 @@ public class StrutsServlet extends HttpServlet {
|
||||
@Override
|
||||
public void init(ServletConfig filterConfig) throws ServletException {
|
||||
InitOperations init = new InitOperations();
|
||||
Dispatcher dispatcher = null;
|
||||
try {
|
||||
ServletHostConfig config = new ServletHostConfig(filterConfig);
|
||||
init.initLogging(config);
|
||||
Dispatcher dispatcher = init.initDispatcher(config);
|
||||
dispatcher = init.initDispatcher(config);
|
||||
init.initStaticContentLoader(config, dispatcher);
|
||||
|
||||
prepare = new PrepareOperations(filterConfig.getServletContext(), dispatcher);
|
||||
execute = new ExecuteOperations(filterConfig.getServletContext(), dispatcher);
|
||||
} finally {
|
||||
if (dispatcher != null) {
|
||||
dispatcher.cleanUpAfterInit();
|
||||
}
|
||||
init.cleanup();
|
||||
}
|
||||
}
|
||||
@@ -84,4 +89,5 @@ public class StrutsServlet extends HttpServlet {
|
||||
public void destroy() {
|
||||
prepare.cleanupDispatcher();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ import java.util.regex.Pattern;
|
||||
* If cookiesValue is left empty it will assume that all cookie that match the cookieName
|
||||
* parameter will be injected into Struts' action.<p/>
|
||||
*
|
||||
* The action could implements {@link CookiesAware} in order to have a {@link Map}
|
||||
* The action could implement {@link CookiesAware} in order to have a {@link Map}
|
||||
* of filtered cookies set into it. <p/>
|
||||
*
|
||||
* <!-- END SNIPPET: description -->
|
||||
@@ -86,10 +86,14 @@ import java.util.regex.Pattern;
|
||||
* <!-- START SNIPPET: extending -->
|
||||
*
|
||||
* <ul>
|
||||
* populateCookieValueIntoStack - this method will decide if this cookie value is qualified to be
|
||||
* populated into the value stack (hence into the action itself)
|
||||
* injectIntoCookiesAwareAction - this method will inject selected cookies (as a java.util.Map) into
|
||||
* action that implements {@link CookiesAware}.
|
||||
* <li>
|
||||
* populateCookieValueIntoStack - this method will decide if this cookie value is qualified
|
||||
* to be populated into the value stack (hence into the action itself)
|
||||
* </li>
|
||||
* <li>
|
||||
* injectIntoCookiesAwareAction - this method will inject selected cookies (as a java.util.Map)
|
||||
* into action that implements {@link CookiesAware}.
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
* <!-- END SNIPPET: extending -->
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.interceptor;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Action can create cookies which will be stored in response
|
||||
*
|
||||
* @see CookieProviderInterceptor
|
||||
*/
|
||||
public interface CookieProvider {
|
||||
|
||||
/**
|
||||
* Return cookies which should be send to client
|
||||
*
|
||||
* @return set of cookies or null
|
||||
*/
|
||||
Set<Cookie> getCookies();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.interceptor;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
|
||||
import com.opensymphony.xwork2.interceptor.PreResultListener;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.struts2.StrutsStatics;
|
||||
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: description -->
|
||||
* Allows actions to send cookies to client, action must implement {@link CookieProvider}
|
||||
* You must reference this interceptor in your default stack or in action's stack, see example below.
|
||||
*
|
||||
* <!-- END SNIPPET: description -->
|
||||
*
|
||||
* <!-- START SNIPPET: parameters -->
|
||||
*
|
||||
* none
|
||||
*
|
||||
* <!-- END SNIPPET: parameters -->
|
||||
*
|
||||
* <!-- START SNIPPET: extending -->
|
||||
*
|
||||
* <ul>
|
||||
* <li>addCookiesToResponse - this method applies cookie created by action to response</li>
|
||||
* </ul>
|
||||
*
|
||||
* <!-- END SNIPPET: extending -->
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <action ... >
|
||||
* <interceptor-ref name="defaultStack"/>
|
||||
* <interceptor-ref name="cookieProvider"/>
|
||||
* ...
|
||||
* </action>
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*/
|
||||
public class CookieProviderInterceptor extends AbstractInterceptor implements PreResultListener {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(CookieProviderInterceptor.class);
|
||||
|
||||
public String intercept(ActionInvocation invocation) throws Exception {
|
||||
invocation.addPreResultListener(this);
|
||||
return invocation.invoke();
|
||||
}
|
||||
|
||||
/**
|
||||
* Do what name suggests
|
||||
*
|
||||
* @param action {@link CookieProvider} action
|
||||
* @param response current {@link HttpServletResponse}
|
||||
*/
|
||||
protected void addCookiesToResponse(CookieProvider action, HttpServletResponse response) {
|
||||
Set<Cookie> cookies = action.getCookies();
|
||||
if (cookies != null) {
|
||||
for (Cookie cookie : cookies) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Sending cookie [#0] with value [#1] for domain [#2]",
|
||||
cookie.getName(), cookie.getValue(), (cookie.getDomain() != null ? cookie.getDomain() : "no domain"));
|
||||
}
|
||||
response.addCookie(cookie);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void beforeResult(ActionInvocation invocation, String resultCode) {
|
||||
try {
|
||||
if (LOG.isTraceEnabled()) {
|
||||
LOG.trace("beforeResult start");
|
||||
}
|
||||
ActionContext ac = invocation.getInvocationContext();
|
||||
if (invocation.getAction() instanceof CookieProvider) {
|
||||
HttpServletResponse response = (HttpServletResponse) ac.get(StrutsStatics.HTTP_RESPONSE);
|
||||
addCookiesToResponse((CookieProvider) invocation.getAction(), response);
|
||||
}
|
||||
if (LOG.isTraceEnabled()) {
|
||||
LOG.trace("beforeResult end");
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
LOG.error("Unable to setup cookies", ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,6 +23,17 @@ package org.apache.struts2.interceptor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Actions implementing the CookiesAware interface will receive
|
||||
* a Map of filtered cookies via the setCookiesMap method.
|
||||
*
|
||||
* Please note that the {@link CookieInterceptor} needs to be
|
||||
* activated to receive a cookies map.
|
||||
*/
|
||||
public interface CookiesAware {
|
||||
/**
|
||||
* Sets a map of filtered cookies.
|
||||
* @param cookies the cookies
|
||||
*/
|
||||
void setCookiesMap(Map<String, String> cookies);
|
||||
}
|
||||
@@ -137,7 +137,6 @@ public class TokenSessionStoreInterceptor extends TokenInterceptor {
|
||||
if (savedInvocation != null) {
|
||||
// set the valuestack to the request scope
|
||||
ValueStack stack = savedInvocation.getStack();
|
||||
Map context = stack.getContext();
|
||||
request.setAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY, stack);
|
||||
|
||||
ActionContext savedContext = savedInvocation.getInvocationContext();
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
|
||||
package org.apache.struts2.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ActionInvocation;
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
* InvocationSessionStore
|
||||
@@ -62,7 +62,7 @@ public class InvocationSessionStore {
|
||||
ValueStack stack = invocationContext.invocation.getStack();
|
||||
ActionContext.getContext().setValueStack(stack);
|
||||
|
||||
return invocationContext.invocation;
|
||||
return invocationContext.invocation.deserialize(ActionContext.getContext());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,7 +73,7 @@ public class InvocationSessionStore {
|
||||
* @param invocation
|
||||
*/
|
||||
public static void storeInvocation(String key, String token, ActionInvocation invocation) {
|
||||
InvocationContext invocationContext = new InvocationContext(invocation, token);
|
||||
InvocationContext invocationContext = new InvocationContext(invocation.serialize(), token);
|
||||
Map invocationMap = getInvocationMap();
|
||||
invocationMap.put(key, invocationContext);
|
||||
setInvocationMap(invocationMap);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -45,7 +45,7 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
|
||||
protected String label;
|
||||
protected String labelSeparator;
|
||||
protected String labelPosition;
|
||||
protected String requiredposition;
|
||||
protected String requiredPosition;
|
||||
protected String errorPosition;
|
||||
protected String name;
|
||||
protected String requiredLabel;
|
||||
@@ -97,7 +97,7 @@ 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.setRequiredLabel(requiredLabel);
|
||||
@@ -169,8 +169,8 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
|
||||
this.labelPosition = labelPosition;
|
||||
}
|
||||
|
||||
public void setRequiredposition(String requiredPosition) {
|
||||
this.requiredposition = requiredPosition;
|
||||
public void setRequiredPosition(String requiredPosition) {
|
||||
this.requiredPosition = requiredPosition;
|
||||
}
|
||||
|
||||
public void setErrorPosition(String errorPosition) {
|
||||
|
||||
@@ -241,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 '#0', returning value un-encoded", input);
|
||||
}
|
||||
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 '#0', returning value un-encoded", input);
|
||||
}
|
||||
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>();
|
||||
@@ -299,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)
|
||||
|
||||
@@ -238,6 +238,9 @@ public class XSLTResult implements Result {
|
||||
/** Indicates the ognl expression respresenting the bean which is to be exposed as xml. */
|
||||
private String exposedValue;
|
||||
|
||||
/** Indicates the status to return in the response */
|
||||
private int status = 200;
|
||||
|
||||
private boolean parse;
|
||||
private AdapterFactory adapterFactory;
|
||||
|
||||
@@ -307,6 +310,18 @@ public class XSLTResult implements Result {
|
||||
this.excludingPattern = excludingPattern;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return String.valueOf(status);
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
try {
|
||||
this.status = Integer.valueOf(status);
|
||||
} catch (NumberFormatException e) {
|
||||
throw new IllegalArgumentException("Status value not number " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If true, parse the stylesheet location for OGNL expressions.
|
||||
*
|
||||
@@ -328,7 +343,7 @@ public class XSLTResult implements Result {
|
||||
|
||||
try {
|
||||
HttpServletResponse response = ServletActionContext.getResponse();
|
||||
|
||||
response.setStatus(status);
|
||||
PrintWriter writer = response.getWriter();
|
||||
|
||||
// Create a transformer for the stylesheet.
|
||||
|
||||
@@ -105,7 +105,7 @@ struts.serve.static.browserCache=true
|
||||
### like method:bar (but not action:foo).
|
||||
### An alternative to implicit dynamic method invocation is to use wildcard
|
||||
### mappings, such as <action name="*/*" method="{2}" class="actions.{1}">
|
||||
struts.enable.DynamicMethodInvocation = true
|
||||
struts.enable.DynamicMethodInvocation = false
|
||||
|
||||
### Set this to true if you wish to allow slashes in your action names. If false,
|
||||
### Actions names cannot have slashes, and will be accessible via any directory
|
||||
|
||||
@@ -100,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" />
|
||||
@@ -143,6 +145,7 @@
|
||||
<interceptor name="chain" class="com.opensymphony.xwork2.interceptor.ChainingInterceptor"/>
|
||||
<interceptor name="conversionError" class="org.apache.struts2.interceptor.StrutsConversionErrorInterceptor"/>
|
||||
<interceptor name="cookie" class="org.apache.struts2.interceptor.CookieInterceptor"/>
|
||||
<interceptor name="cookieProvider" class="org.apache.struts2.interceptor.CookieProviderInterceptor"/>
|
||||
<interceptor name="clearSession" class="org.apache.struts2.interceptor.ClearSessionInterceptor" />
|
||||
<interceptor name="createSession" class="org.apache.struts2.interceptor.CreateSessionInterceptor" />
|
||||
<interceptor name="debugging" class="org.apache.struts2.interceptor.debugging.DebuggingInterceptor" />
|
||||
|
||||
@@ -25,9 +25,7 @@
|
||||
<#if parameters.get("size")??>
|
||||
size="${parameters.get("size")?html}"<#rt/>
|
||||
</#if>
|
||||
<#if parameters.nameValue??>
|
||||
value="<@s.property value="parameters.nameValue"/>"<#rt/>
|
||||
</#if>
|
||||
value=""<#rt/>
|
||||
<#if parameters.disabled?default(false)>
|
||||
disabled="disabled"<#rt/>
|
||||
</#if>
|
||||
|
||||
@@ -47,11 +47,11 @@
|
||||
class="checkboxLabel"<#rt/>
|
||||
</#if>
|
||||
>
|
||||
<#if parameters.required?default(false) && parameters.requiredposition?default("right") != 'right'>
|
||||
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") != 'right'>
|
||||
<span class="required">*</span><#t/>
|
||||
</#if>
|
||||
${parameters.label?html}<#t/>
|
||||
<#if parameters.required?default(false) && parameters.requiredposition?default("right") == 'right'>
|
||||
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") == 'right'>
|
||||
<span class="required">*</span><#t/>
|
||||
</#if>
|
||||
:<#t/>
|
||||
@@ -79,11 +79,11 @@ ${parameters.label?html}<#t/>
|
||||
class="checkboxLabel"<#rt/>
|
||||
</#if>
|
||||
>
|
||||
<#if parameters.required?default(false) && parameters.requiredposition?default("right") != 'right'>
|
||||
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") != 'right'>
|
||||
<span class="required">*</span><#t/>
|
||||
</#if>
|
||||
${parameters.label?html}<#t/>
|
||||
<#if parameters.required?default(false) && parameters.requiredposition?default("right") == 'right'>
|
||||
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") == 'right'>
|
||||
<span class="required">*</span><#t/>
|
||||
</#if>
|
||||
:<#t/>
|
||||
|
||||
@@ -57,11 +57,11 @@
|
||||
class="label"<#t/>
|
||||
</#if>
|
||||
><#t/>
|
||||
<#if parameters.required?default(false) && parameters.requiredposition?default("right") != 'right'>
|
||||
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") != 'right'>
|
||||
<span class="required">*</span><#t/>
|
||||
</#if>
|
||||
${parameters.label?html}<#t/>
|
||||
<#if parameters.required?default(false) && parameters.requiredposition?default("right") == 'right'>
|
||||
<#if parameters.required?default(false) && parameters.requiredPosition?default("right") == 'right'>
|
||||
<span class="required">*</span><#t/>
|
||||
</#if>
|
||||
${parameters.labelseparator?default(":")?html}<#t/>
|
||||
|
||||
@@ -33,9 +33,29 @@ Only the following validators are supported:
|
||||
* double validator
|
||||
END SNIPPET: supported-validators
|
||||
-->
|
||||
<#if ((parameters.validate?default(false) == true) && (parameters.performValidation?default(false) == true))>
|
||||
<#if ((parameters.validate!false == true) && (parameters.performValidation!false == true))>
|
||||
<script type="text/javascript">
|
||||
function validateForm_${parameters.id?replace('[^a-zA-Z0-9_]', '_', 'r')}() {
|
||||
<#--
|
||||
In case of multiselect fields return only the first value.
|
||||
-->
|
||||
var getFieldValue = function(field) {
|
||||
var type = field.type ? field.type : field[0].type;
|
||||
if (type == 'select-one' || type == 'select-multiple') {
|
||||
return (field.selectedIndex == -1 ? "" : field.options[field.selectedIndex].value);
|
||||
} else if (type == 'checkbox' || type == 'radio') {
|
||||
if (!field.length) {
|
||||
field = [field];
|
||||
}
|
||||
for (var i = 0; i < field.length; i++) {
|
||||
if (field[i].checked) {
|
||||
return field[i].value;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
return field.value;
|
||||
}
|
||||
form = document.getElementById("${parameters.id}");
|
||||
clearErrorMessages(form);
|
||||
clearErrorLabels(form);
|
||||
@@ -43,27 +63,36 @@ END SNIPPET: supported-validators
|
||||
var errors = false;
|
||||
var continueValidation = true;
|
||||
<#list parameters.tagNames as tagName>
|
||||
<#list tag.getValidators("${tagName}") as validator>
|
||||
// field name: ${validator.fieldName}
|
||||
// validator name: ${validator.validatorType}
|
||||
if (form.elements['${validator.fieldName}']) {
|
||||
field = form.elements['${validator.fieldName}'];
|
||||
<#list tag.getValidators("${tagName}") as aValidator>
|
||||
// field name: ${aValidator.fieldName}
|
||||
// validator name: ${aValidator.validatorType}
|
||||
if (form.elements['${aValidator.fieldName}']) {
|
||||
field = form.elements['${aValidator.fieldName}'];
|
||||
<#if aValidator.validatorType = "field-visitor">
|
||||
<#assign validator = aValidator.fieldValidator >
|
||||
//visitor validator switched to: ${validator.validatorType}
|
||||
<#else>
|
||||
<#assign validator = aValidator >
|
||||
</#if>
|
||||
|
||||
var error = "${validator.getMessage(action)?js_string}";
|
||||
var fieldValue = getFieldValue(field);
|
||||
|
||||
<#if validator.validatorType = "required">
|
||||
if (field.value == "") {
|
||||
if (fieldValue == "") {
|
||||
addError(field, error);
|
||||
errors = true;
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
}
|
||||
<#elseif validator.validatorType = "requiredstring">
|
||||
if (continueValidation && field.value != null && (field.value == "" || field.value.replace(/^\s+|\s+$/g,"").length == 0)) {
|
||||
if (continueValidation && fieldValue != null && (fieldValue == "" || fieldValue.replace(/^\s+|\s+$/g,"").length == 0)) {
|
||||
addError(field, error);
|
||||
errors = true;
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
}
|
||||
<#elseif validator.validatorType = "stringlength">
|
||||
if (continueValidation && field.value != null) {
|
||||
var value = field.value;
|
||||
if (continueValidation && fieldValue != null) {
|
||||
var value = fieldValue;
|
||||
<#if validator.trim>
|
||||
//trim field value
|
||||
while (value.substring(0,1) == ' ')
|
||||
@@ -79,28 +108,28 @@ END SNIPPET: supported-validators
|
||||
}
|
||||
}
|
||||
<#elseif validator.validatorType = "regex">
|
||||
if (continueValidation && field.value != null && !field.value.match("${validator.expression?js_string}")) {
|
||||
if (continueValidation && fieldValue != null && !fieldValue.match("${validator.regex?js_string}")) {
|
||||
addError(field, error);
|
||||
errors = true;
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
}
|
||||
<#elseif validator.validatorType = "email">
|
||||
if (continueValidation && field.value != null && field.value.length > 0 && field.value.match("${validator.expression?js_string}")==null) {
|
||||
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match("${validator.regex?js_string}")==null) {
|
||||
addError(field, error);
|
||||
errors = true;
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
}
|
||||
<#elseif validator.validatorType = "url">
|
||||
if (continueValidation && field.value != null && field.value.length > 0 && field.value.match(/^(ftp|http|https):\/\/((%[A-F0-9]{2}|[A-Z0-9-._~!$&'()*+,;=:])+@)?((%[A-F0-9]{2}|[A-Z0-9-._~!$&'()*+,;=])+)(:[0-9]+)?((\/(%[A-F0-9]{2}|[A-Z0-9-._~!$&'()*+,;=:@])*)*)(\?(%[A-F0-9]{2}|[A-Z0-9-._~!$&'()*+,;=:@/?])*)?(#(%[A-F0-9]{2}|[A-Z0-9-._~!$&'()*+,;=:@/?])*)?$/gi)==null) {
|
||||
if (continueValidation && fieldValue != null && fieldValue.length > 0 && fieldValue.match("${validator.regex?js_string}")==null) {
|
||||
addError(field, error);
|
||||
errors = true;
|
||||
<#if validator.shortCircuit>continueValidation = false;</#if>
|
||||
}
|
||||
<#elseif validator.validatorType = "int">
|
||||
if (continueValidation && field.value != null) {
|
||||
if (<#if validator.min??>parseInt(field.value) <
|
||||
<#elseif validator.validatorType = "int" || validator.validatorType = "short">
|
||||
if (continueValidation && fieldValue != null) {
|
||||
if (<#if validator.min??>parseInt(fieldValue) <
|
||||
${validator.min?c}<#else>false</#if> ||
|
||||
<#if validator.max??>parseInt(field.value) >
|
||||
<#if validator.max??>parseInt(fieldValue) >
|
||||
${validator.max?c}<#else>false</#if>) {
|
||||
addError(field, error);
|
||||
errors = true;
|
||||
@@ -108,15 +137,14 @@ END SNIPPET: supported-validators
|
||||
}
|
||||
}
|
||||
<#elseif validator.validatorType = "double">
|
||||
if (continueValidation && field.value != null) {
|
||||
var value = parseFloat(field.value);
|
||||
if (continueValidation && fieldValue != null) {
|
||||
var value = parseFloat(fieldValue);
|
||||
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>
|
||||
}
|
||||
}
|
||||
</#if>
|
||||
@@ -127,4 +155,4 @@ END SNIPPET: supported-validators
|
||||
return !errors;
|
||||
}
|
||||
</script>
|
||||
</#if>
|
||||
</#if>
|
||||
@@ -29,8 +29,8 @@
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>images/struts2.png</src>
|
||||
<href>http://struts.apache.org/2.x/index.html</href>
|
||||
<src>http://struts.apache.org/images/struts.gif</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
@@ -40,6 +40,7 @@
|
||||
href="http://struts.apache.org/index.html"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
</body>
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package org.apache.struts2;
|
||||
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
import org.apache.struts2.dispatcher.Dispatcher;
|
||||
import org.apache.struts2.dispatcher.mapper.ActionMapper;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Test class instantiation with Container
|
||||
*/
|
||||
public class ClassInstantiationTest extends StrutsTestCase {
|
||||
|
||||
public void testCompositeActionMapperInstantiationWithList() throws Exception {
|
||||
// given
|
||||
Dispatcher du = initDispatcher(new HashMap<String, String>() {{
|
||||
put(StrutsConstants.STRUTS_I18N_ENCODING, "utf-8");
|
||||
put(StrutsConstants.STRUTS_MAPPER_COMPOSITE, "struts,restful");
|
||||
}});
|
||||
Container container = du.getContainer();
|
||||
|
||||
// when
|
||||
ActionMapper instance = container.getInstance(ActionMapper.class, "composite");
|
||||
|
||||
// then
|
||||
assertNotNull(instance);
|
||||
}
|
||||
|
||||
public void testCompositeActionMapperInstantiationWithoutList() throws Exception {
|
||||
// given
|
||||
Dispatcher du = initDispatcher(new HashMap<String, String>() {{
|
||||
put(StrutsConstants.STRUTS_I18N_ENCODING, "utf-8");
|
||||
}});
|
||||
Container container = du.getContainer();
|
||||
|
||||
// when
|
||||
try {
|
||||
container.getInstance(ActionMapper.class, "composite");
|
||||
fail();
|
||||
}catch (Exception e) {
|
||||
// then
|
||||
// You cannot use CompositeActionMapper without defined list of "struts.mapper.composite"
|
||||
assertTrue(e.getMessage().contains("No mapping found for dependency [type=java.lang.String, name='struts.mapper.composite']"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user