Compare commits

...

97 Commits

Author SHA1 Message Date
Lukasz Lenart 8931ac19ea [maven-release-plugin] prepare release STRUTS_2_3_15_1_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1@1523930 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 06:50:03 +00:00
Lukasz Lenart a3e8dee846 [maven-release-plugin] prepare branch STRUTS_2_3_15_1_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1@1523928 13f79535-47bb-0310-9956-ffa450edef68
2013-09-17 06:49:40 +00:00
René Gielen e2d9d87e53 [maven-release-plugin] copy for tag STRUTS_2_3_15_1
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1@1502997 13f79535-47bb-0310-9956-ffa450edef68
2013-07-14 16:57:32 +00:00
René Gielen c5dbe134f4 [maven-release-plugin] prepare release STRUTS_2_3_15_1
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_15_X@1502996 13f79535-47bb-0310-9956-ffa450edef68
2013-07-14 16:57:27 +00:00
René Gielen ef438411af tagging site export snapshot version for release
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_15_X@1502986 13f79535-47bb-0310-9956-ffa450edef68
2013-07-14 15:38:18 +00:00
René Gielen 4fb4a6b5c0 Archetype versions changed for upcoming 2.3.15.1 release
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_15_X@1502984 13f79535-47bb-0310-9956-ffa450edef68
2013-07-14 15:24:40 +00:00
René Gielen 3cfe34fefe WW-4140
- Lukasz' patch applied

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_15_X@1502979 13f79535-47bb-0310-9956-ffa450edef68
2013-07-14 14:18:39 +00:00
René Gielen ad8ff3d6a9 Merged from trunk
WW-4130 Adds usage of SiteExporter instead of wget to export docs from Confluence [from revision 1497786]

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_15_X@1500651 13f79535-47bb-0310-9956-ffa450edef68
2013-07-08 10:59:25 +00:00
René Gielen bc1625e3c7 WW-3873 file tag leaks server path information
- file-tag: disabled rendering of any content within value attribute

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_15_X@1500311 13f79535-47bb-0310-9956-ffa450edef68
2013-07-06 19:00:21 +00:00
René Gielen 42c615c826 WW-4136 - Demonstrate proper input sanitizing for file download showcase example
- added demo code to prevent input paths containing "WEB-INF"

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_15_X@1500082 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 17:44:09 +00:00
René Gielen ba2d9b7400 Updated project poms to match new branch 2.3.15.1-SNAPSHOT
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_15_X@1500031 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 14:59:48 +00:00
René Gielen f4bcb9da2e Can't get mvn relase:branch to work - giving up, branching manually
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_15_X@1500021 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 14:32:51 +00:00
René Gielen 680b54631e mvn release:branch not working, branching manually again
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_15_X@1499991 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 13:00:29 +00:00
René Gielen 795abf4663 [maven-release-plugin] prepare branch STRUTS_2_3_15_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15@1499990 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 12:50:53 +00:00
René Gielen ecc21d9fa3 [maven-release-plugin] prepare branch STRUTS_2_3_15_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15@1499986 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 12:29:43 +00:00
René Gielen 3e9095eaac [maven-release-plugin] prepare branch STRUTS_2_3_15_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15@1499983 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 12:19:54 +00:00
René Gielen 1ee86bcad4 [maven-release-plugin] prepare branch STRUTS_2_3_15_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15@1499982 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 12:18:45 +00:00
René Gielen 5563088d85 [maven-release-plugin] prepare branch STRUTS_2_3_15_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15@1499950 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 08:59:51 +00:00
René Gielen 2339f7b109 [maven-release-plugin] prepare branch STRUTS_2_3_15_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15@1499945 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 08:49:17 +00:00
René Gielen 1920411684 [maven-release-plugin] prepare branch STRUTS_2_3_15_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15@1499944 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 08:48:50 +00:00
René Gielen 33228b9f3b [maven-release-plugin] prepare branch STRUTS_2_3_15_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15@1499943 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 08:46:50 +00:00
René Gielen f225e108fd [maven-release-plugin] prepare branch STRUTS_2_3_15_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15@1499942 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 08:46:08 +00:00
René Gielen 025c0397f1 [maven-release-plugin] prepare branch STRUTS_2_3_15_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15@1499941 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 08:45:41 +00:00
René Gielen 86009d9dd4 Fix release branch for 2.3.15
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_15_X@1499933 13f79535-47bb-0310-9956-ffa450edef68
2013-07-05 08:21:41 +00:00
Lukasz Lenart e26c86e1ff [maven-release-plugin] copy for tag STRUTS_2_3_15
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15@1493006 13f79535-47bb-0310-9956-ffa450edef68
2013-06-14 09:29:50 +00:00
Lukasz Lenart edb9c5e120 [maven-release-plugin] prepare release STRUTS_2_3_15
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1493005 13f79535-47bb-0310-9956-ffa450edef68
2013-06-14 09:29:42 +00:00
Lukasz Lenart b98c2d3c17 WW-4107 updates version of archetypes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1493002 13f79535-47bb-0310-9956-ffa450edef68
2013-06-14 09:07:52 +00:00
Christian Grobmeier 9b93e5e050 made private methods protected
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1492644 13f79535-47bb-0310-9956-ffa450edef68
2013-06-13 12:36:34 +00:00
Christian Grobmeier d7ad759995 some refactorings for better readability
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1492633 13f79535-47bb-0310-9956-ffa450edef68
2013-06-13 11:57:16 +00:00
Christian Grobmeier bbe2a3b81b renamed local variable to remove underscore
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1492624 13f79535-47bb-0310-9956-ffa450edef68
2013-06-13 11:21:20 +00:00
Christian Grobmeier 89cd538a53 removed unnecessary if
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1492613 13f79535-47bb-0310-9956-ffa450edef68
2013-06-13 10:30:31 +00:00
Christian Grobmeier 5c7868f0d8 used arguments in log statements, serial uid
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1492583 13f79535-47bb-0310-9956-ffa450edef68
2013-06-13 09:05:35 +00:00
Christian Grobmeier 0f5a74b983 testing expression enclosed by characters without space
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1492574 13f79535-47bb-0310-9956-ffa450edef68
2013-06-13 08:51:05 +00:00
Lukasz Lenart 508dd0b6a1 WW-4097 Updates JavaDoc to match current implementations
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1492402 13f79535-47bb-0310-9956-ffa450edef68
2013-06-12 19:57:40 +00:00
Lukasz Lenart 58f3b578e7 Simplifies example a bit and uses FreeMarker template to check response
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1492077 13f79535-47bb-0310-9956-ffa450edef68
2013-06-12 06:48:53 +00:00
Maurizio Cucchiara af961bd888 WW-4073 - Disable eval expressions and simple JSTL accessibility
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1491521 13f79535-47bb-0310-9956-ffa450edef68
2013-06-10 16:15:42 +00:00
René Gielen 2ed79d7b02 WW-4093
Applied JavaDoc patch. Thanks Johno Crawford for contributing.

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1490175 13f79535-47bb-0310-9956-ffa450edef68
2013-06-06 06:56:46 +00:00
Lukasz Lenart 041206d2a6 WW-4095 WW-4094 Changes how pattern is compiled to be once per instance and changes default regexp to match underscore
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1490165 13f79535-47bb-0310-9956-ffa450edef68
2013-06-06 06:03:26 +00:00
Lukasz Lenart 711cf0201c Merged from STRUTS_2_3_14_2_X
WW-4090 Itroduces actions names' whitelisting [from revision 1488895]
WW-4090 Removes double evaluation of parsed expression [from revision 1488897]
WW-4090 Add some logging [from revision 1488899]
WW-4090 Uses warn level instead of debug [from revision 1488900]

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1490149 13f79535-47bb-0310-9956-ffa450edef68
2013-06-06 05:29:48 +00:00
Lukasz Lenart 66d71be669 WW-4089 Removes outdated configuration and used the new filters
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1488488 13f79535-47bb-0310-9956-ffa450edef68
2013-06-01 08:34:22 +00:00
Lukasz Lenart c4d9d7d3ce WW-4087 Adds log4j dependency to example apps
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1488113 13f79535-47bb-0310-9956-ffa450edef68
2013-05-31 07:01:22 +00:00
Lukasz Lenart 8d209daa76 WW-4085 Adds default-action-ref to configuration of example apps
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1488108 13f79535-47bb-0310-9956-ffa450edef68
2013-05-31 06:30:45 +00:00
Lukasz Lenart 2382586b85 WW-4086 Adds default-action-ref to Config Browser configuration instead of empty action name
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1488106 13f79535-47bb-0310-9956-ffa450edef68
2013-05-31 06:24:35 +00:00
Lukasz Lenart 26778533ef WW-4084 Restores appending <s:param>s to <s:a/> tag which was broken since WW-3920
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1487806 13f79535-47bb-0310-9956-ffa450edef68
2013-05-30 10:22:34 +00:00
Lukasz Lenart bde077ee0a WW-4086 Adds empty action definition to support requests to /
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1487783 13f79535-47bb-0310-9956-ffa450edef68
2013-05-30 08:33:04 +00:00
Lukasz Lenart ac30ce247b Uses proper logging structure
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1487418 13f79535-47bb-0310-9956-ffa450edef68
2013-05-29 09:16:09 +00:00
Lukasz Lenart 4aca911cb0 Adds toString() to simplify debugging process
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1487417 13f79535-47bb-0310-9956-ffa450edef68
2013-05-29 09:15:40 +00:00
Lukasz Lenart f6a07e63e6 WW-4083 Extends support of ParametersNameAware to pass the same behaviour to OgnlValueStack
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1487092 13f79535-47bb-0310-9956-ffa450edef68
2013-05-28 20:14:15 +00:00
René Gielen d934c6e743 Merged from STRUTS_2_3_14_X
Disable eval expressions [from revision 1469249]
WW-4063
Improved security  by making static method attribute immutable [from revision 1486054]
WW-4063
Skipping unneeded translation for included parameters [from revision 1486076]
WW-4063
Testcase modification after refactoring [from revision 1486164]
WW-4063
Testcases for double parameter evaluation problems [from revision 1486576]

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1486633 13f79535-47bb-0310-9956-ffa450edef68
2013-05-27 14:11:10 +00:00
Lukasz Lenart eb2a9eb8ff WW-3593 Adds missing html files
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1486344 13f79535-47bb-0310-9956-ffa450edef68
2013-05-25 16:37:42 +00:00
Lukasz Lenart af74f78050 WW-4070 Cleans up assemblies and removes unused assembly definition
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1486295 13f79535-47bb-0310-9956-ffa450edef68
2013-05-25 07:06:47 +00:00
Lukasz Lenart 95238ac73e WW-4036 Extends support of Dynamic Attributes to evaluate null attributes to empty string
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1486079 13f79535-47bb-0310-9956-ffa450edef68
2013-05-24 14:39:40 +00:00
Lukasz Lenart 644dd2ed1c WW-600 Enables Client-side validation for visitor validations
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485978 13f79535-47bb-0310-9956-ffa450edef68
2013-05-24 08:56:41 +00:00
Lukasz Lenart 9d6e6a6b0f WW-4037 Adds functionality to create Cookies in action and apply them to response
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485719 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 14:12:24 +00:00
Lukasz Lenart b7907fa602 Tweaks docs a bit
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485710 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 13:46:25 +00:00
Lukasz Lenart 6ed1fdf3d8 WW-3999 Allows set respond code
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485653 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 11:49:47 +00:00
Lukasz Lenart 86d081bd4e WW-4052 Extends interceptor to propagate params during exception handling
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485645 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 11:14:20 +00:00
Lukasz Lenart b238ba7efb Merged from STRUTS_2_3_14_X
Disable eval expressions [from revision 1469249]

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485640 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 10:31:44 +00:00
Lukasz Lenart 62cb4575c3 WW-4072 Upgrade commons-logging to latest available version 1.1.3
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485634 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 09:48:46 +00:00
Lukasz Lenart 26728639ec WW-3623 Extends id generation logic to support case when tag doesn't have id, key nor name defined and some generics fix
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485592 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 06:31:48 +00:00
Lukasz Lenart 46e0da8058 WW-3689 Adds synchronized block with global lock to avoid NPE
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485576 13f79535-47bb-0310-9956-ffa450edef68
2013-05-23 05:34:19 +00:00
Lukasz Lenart d72ae0cffa WW-4071 Changes interface a bit after review
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485311 13f79535-47bb-0310-9956-ffa450edef68
2013-05-22 17:51:40 +00:00
Lukasz Lenart 07f97efcfd WW-4071 Adds some comments about the supported *Aware interfaces
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485153 13f79535-47bb-0310-9956-ffa450edef68
2013-05-22 11:26:13 +00:00
Lukasz Lenart 6c5b9adc8a WW-4071 Adds new ValidationErrorAware interface to allow notify action about action/field errors
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485149 13f79535-47bb-0310-9956-ffa450edef68
2013-05-22 11:10:29 +00:00
Lukasz Lenart e5754488c0 Adds proper JavaDoc comment
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485146 13f79535-47bb-0310-9956-ffa450edef68
2013-05-22 10:46:33 +00:00
Lukasz Lenart ce1530b280 WW-3958 Reverts cast to String to satisfy JDK7
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1485066 13f79535-47bb-0310-9956-ffa450edef68
2013-05-22 05:20:45 +00:00
Lukasz Lenart 1c5b931cfb WW-3958 Updates Apache Felix and adds option to cooperate with Felix integrated in Glassfish
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1484815 13f79535-47bb-0310-9956-ffa450edef68
2013-05-21 14:14:03 +00:00
Lukasz Lenart 7df4af2deb WW-3676 Uses simple toString() for non-null objects to support other types than String and Integer
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1484461 13f79535-47bb-0310-9956-ffa450edef68
2013-05-20 12:59:25 +00:00
Lukasz Lenart 01d979b039 WW-4070 Removes support for translating project to JDK4
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1484447 13f79535-47bb-0310-9956-ffa450edef68
2013-05-20 12:39:31 +00:00
Lukasz Lenart f3dc60ac8a WW-4021 Cleans up poms
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1484384 13f79535-47bb-0310-9956-ffa450edef68
2013-05-20 07:29:24 +00:00
Lukasz Lenart 150088f79d WW-4020 Upgrades commons-logging into the latest 1.1.2 version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1484340 13f79535-47bb-0310-9956-ffa450edef68
2013-05-19 19:21:36 +00:00
Lukasz Lenart 294d380398 WW-4068 Extracts method to accept parameter names to allow easier overriding
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1483950 13f79535-47bb-0310-9956-ffa450edef68
2013-05-17 18:58:39 +00:00
Lukasz Lenart 7caf810099 WW-4028 Extends ActionInvocation interface to support serialisation and deserialisation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1483773 13f79535-47bb-0310-9956-ffa450edef68
2013-05-17 12:38:42 +00:00
Lukasz Lenart 57ee122ab8 WW-4045 Reduces code duplication as FileManager can handle nulls
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1483700 13f79535-47bb-0310-9956-ffa450edef68
2013-05-17 09:00:09 +00:00
Lukasz Lenart 8d2c5ce474 WW-4067 Skips package reloading to avoid double initialisation of actions, interceptors, and so on
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1483648 13f79535-47bb-0310-9956-ffa450edef68
2013-05-17 05:24:39 +00:00
Lukasz Lenart 64328943bd Configures logging
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1483512 13f79535-47bb-0310-9956-ffa450edef68
2013-05-16 19:11:03 +00:00
Lukasz Lenart bcaa26597e WW-4057 Updates validation section to reflect changes made in validators
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1480907 13f79535-47bb-0310-9956-ffa450edef68
2013-05-10 07:57:07 +00:00
Lukasz Lenart 2580daa903 WW-4056 Changes case of requiredPosition getter to match tag attribute definition
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1480273 13f79535-47bb-0310-9956-ffa450edef68
2013-05-08 13:46:05 +00:00
Lukasz Lenart 369063406d Re-formats code
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1476064 13f79535-47bb-0310-9956-ffa450edef68
2013-04-26 06:32:25 +00:00
Lukasz Lenart 143fa76ddb Changes log levels to be more realistic
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1476063 13f79535-47bb-0310-9956-ffa450edef68
2013-04-26 06:27:17 +00:00
Lukasz Lenart 944b163887 WW-4058 Adds new method to cleanup after Dispatcher initialisation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1476062 13f79535-47bb-0310-9956-ffa450edef68
2013-04-26 06:24:11 +00:00
René Gielen b9636fd721 WW-4058
- use remove rather than set(null) for cleanup

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1475841 13f79535-47bb-0310-9956-ffa450edef68
2013-04-25 16:24:16 +00:00
Lukasz Lenart e2c26e3f74 WW-4058 Adds cleanup of ContainerHolder
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1475643 13f79535-47bb-0310-9956-ffa450edef68
2013-04-25 06:34:16 +00:00
Maurizio Cucchiara 7e6f641ebb Disable eval expressions
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469249 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 09:49:41 +00:00
Lukasz Lenart ab70a51baf WW-4048 Solves problem with instating a class and adds additional test
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1469245 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 09:31:24 +00:00
Maurizio Cucchiara 9fbb0d92b9 Creating new branch
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469242 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 09:26:25 +00:00
Lukasz Lenart f5464877a0 WW-4038 Solves a bug with struts.convention.action.includeJars
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1469182 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 06:20:37 +00:00
Lukasz Lenart 8cef213cec WW-4046 Solves failing test and uses ActionContext to create validators
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1469181 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 06:19:52 +00:00
Maurizio Cucchiara 2ce8c73d8e Default value is 'none'
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1468833 13f79535-47bb-0310-9956-ffa450edef68
2013-04-17 11:02:18 +00:00
Maurizio Cucchiara ced6f3568c Corrected typo
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1468832 13f79535-47bb-0310-9956-ffa450edef68
2013-04-17 11:00:27 +00:00
Maurizio Cucchiara 791665dd2a Fixed broken tests
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1466402 13f79535-47bb-0310-9956-ffa450edef68
2013-04-10 09:33:04 +00:00
Maurizio Cucchiara 1d64a3e75d Used the commons library api where possible
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1466100 13f79535-47bb-0310-9956-ffa450edef68
2013-04-09 16:19:50 +00:00
Lukasz Lenart 23bd008add WW-4039 Solves problem with user defined logger factory wasn't picked up
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1465538 13f79535-47bb-0310-9956-ffa450edef68
2013-04-08 05:42:10 +00:00
Maurizio Cucchiara 341140426c Updated commons-fileupload to the latest version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1465025 13f79535-47bb-0310-9956-ffa450edef68
2013-04-05 16:21:50 +00:00
Christian Grobmeier 2d02e2c7ae javadocs for CookiesAware
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1463871 13f79535-47bb-0310-9956-ffa450edef68
2013-04-03 08:13:06 +00:00
Christian Grobmeier 4db60a88a9 typo in docs
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1463865 13f79535-47bb-0310-9956-ffa450edef68
2013-04-03 07:59:54 +00:00
Lukasz Lenart e82957c5eb [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1462299 13f79535-47bb-0310-9956-ffa450edef68
2013-03-28 20:52:33 +00:00
243 changed files with 5853 additions and 2091 deletions
+15 -6
View File
@@ -26,17 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14/apps/blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_1/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
+47
View File
@@ -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
View File
@@ -26,17 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14/apps/jboss-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_1/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>
+47
View File
@@ -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 -5
View File
@@ -26,17 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14/apps/mailreader</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_1/apps/mailreader</url>
</scm>
<dependencies>
+47
View File
@@ -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
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14/apps</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_1/apps</url>
</scm>
<profiles>
+5 -5
View File
@@ -26,17 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14/apps/portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_1/apps/portlet</url>
</scm>
<profiles>
+47
View File
@@ -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 -7
View File
@@ -26,13 +26,12 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>2.3.14</version>
<version>2.3.15.1</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>
+47
View File
@@ -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
View File
@@ -26,20 +26,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14/apps/showcase</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_1/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>
@@ -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
@@ -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>
+47
View File
@@ -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>
@@ -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"));
}
}
+48
View File
@@ -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
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes</url>
</scm>
<modules>
+48
View File
@@ -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>
+5 -5
View File
@@ -3,19 +3,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-blank</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-blank</url>
</scm>
<properties>
@@ -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>
@@ -84,7 +90,7 @@
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<contextPath>/struts2-blank</contextPath>
<contextPath>\${artifactId}</contextPath>
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
@@ -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>
@@ -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.14</version>
<version>2.3.15.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-convention</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-convention</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-convention</url>
</scm>
<properties>
@@ -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>
@@ -98,7 +104,7 @@
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<contextPath>/struts2-convention</contextPath>
<contextPath>\${artifactId}</contextPath>
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
@@ -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.14</version>
<version>2.3.15.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-dbportlet</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-dbportlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/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>
+5 -5
View File
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-plugin</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/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>
+5 -5
View File
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-portlet</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/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>
+5 -5
View File
@@ -4,19 +4,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-starter</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/archetypes/struts2-archetype-starter</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/archetypes/struts2-archetype-starter</url>
</scm>
<properties>
@@ -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>
@@ -107,7 +119,7 @@
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<contextPath>/struts2-showcase</contextPath>
<contextPath>\${artifactId}</contextPath>
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
@@ -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>
@@ -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
View File
@@ -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.14</version>
<version>2.3.15.1</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_14/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14/assembly</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_1/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-20130702.031849-7</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>
+1 -3
View File
@@ -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>
+2 -2
View File
@@ -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 -->
-58
View File
@@ -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>
+1 -3
View File
@@ -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>
+6
View File
@@ -0,0 +1,6 @@
spaceKey: WW
pageCacheFile:/cache/docs.pageCache
templateName:assembly/src/main/resources/template.vm
outputDir:/docs
globalPages:Navigation,Banner,QuickLinks
+169
View File
@@ -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>
&nbsp;$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>
&nbsp;
<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>
&nbsp;
<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>
&nbsp;
<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>
+7 -9
View File
@@ -4,25 +4,24 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14/bundles/admin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_1/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>
@@ -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 {
+47
View File
@@ -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
View File
@@ -4,17 +4,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14/bundles/demo</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_1/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>
+47
View File
@@ -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
View File
@@ -26,17 +26,17 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/bundles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/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 -->
+48
View File
@@ -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
View File
@@ -26,17 +26,16 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.14</version>
<version>2.3.15.1</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_14/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14/core</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_15_1/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_15_1/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";
@@ -249,4 +255,7 @@ public final class StrutsConstants {
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>
@@ -375,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);
@@ -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.
@@ -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);
}
}
}
@@ -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") +
'}';
}
}
@@ -29,7 +29,7 @@ import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
/**
@@ -37,42 +37,8 @@ import java.util.List;
*
* 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>
* &lt;bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts"
* class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper" /&gt;
* &lt;constant name="struts.mapper.composite"
* value="org.apache.struts2.dispatcher.mapper.DefaultActionMapper,org.apache.struts2.dispatcher.mapper.RestfulActionMapper,org.apache.struts2.dispatcher.mapper.Restful2ActionMapper" /&gt;
* </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>
* &lt;bean type="org.apache.struts2.dispatcher.mapper.ActionMapper" name="struts"
* class="org.apache.struts2.dispatcher.mapper.CompositeActionMapper" /&gt;
* &lt;constant name="struts.mapper.composite"
* value="org.apache.struts2.dispatcher.mapper.DefaultActionMapper,foo.bar.MyActionMapper,foo.bar.MyAnotherActionMapper" /&gt;
* </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
@@ -83,16 +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>();
public CompositeActionMapper(@Inject Container container) {
this.container = container;
}
@Inject(StrutsConstants.STRUTS_MAPPER_COMPOSITE)
public void setActionMappers(String list) {
@Inject
public CompositeActionMapper(Container container,
@Inject(value = StrutsConstants.STRUTS_MAPPER_COMPOSITE) String list) {
if (list != null) {
String[] arr = list.split(",");
for (String name : arr) {
@@ -104,7 +65,6 @@ public class CompositeActionMapper implements ActionMapper {
}
}
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
for (ActionMapper actionMapper : actionMappers) {
@@ -27,11 +27,12 @@ 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.util.PrefixTrie;
import javax.servlet.http.HttpServletRequest;
@@ -41,6 +42,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 +164,16 @@ 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:";
protected boolean allowDynamicMethodCalls = true;
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");
@@ -185,8 +188,7 @@ public class DefaultActionMapper implements ActionMapper {
put(METHOD_PREFIX, new ParameterAction() {
public void execute(String key, ActionMapping mapping) {
if (allowDynamicMethodCalls) {
mapping.setMethod(key.substring(
METHOD_PREFIX.length()));
mapping.setMethod(key.substring(METHOD_PREFIX.length()));
}
}
});
@@ -202,34 +204,10 @@ public class DefaultActionMapper implements ActionMapper {
name = name.substring(0, bang);
}
}
mapping.setName(name);
mapping.setName(cleanupActionName(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);
}
});
}
};
}
@@ -260,6 +238,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;
@@ -417,7 +400,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;
}
}
/**
@@ -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;
}
}
@@ -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();
}
}
@@ -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 -->
*
* &lt;action ... &gt;
* &lt;interceptor-ref name="defaultStack"/&gt;
* &lt;interceptor-ref name="cookieProvider"/&gt;
* ...
* &lt;/action&gt;
*
* <!-- 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);
@@ -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.
@@ -145,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>
+3 -2
View File
@@ -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']"));
}
}
}
@@ -21,18 +21,17 @@
package org.apache.struts2.components;
import java.util.List;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.validator.validators.RequiredFieldValidator;
import org.apache.struts2.TestAction;
import org.apache.struts2.views.jsp.AbstractUITagTest;
import org.easymock.EasyMock;
import com.opensymphony.xwork2.validator.validators.RequiredFieldValidator;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import java.util.List;
/**
* <code>FormTest</code>
@@ -45,6 +44,7 @@ public class FormTest extends AbstractUITagTest {
Form form = new Form(stack, request, response);
container.inject(form);
form.getParameters().put("actionClass", TestAction.class);
form.setAction("actionName");
List v = form.getValidators("foo");
assertEquals(1, v.size());
assertEquals(RequiredFieldValidator.class, v.get(0).getClass());
@@ -21,15 +21,14 @@
package org.apache.struts2.components;
import java.util.Collections;
import java.util.Map;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.StrutsTestCase;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.ValueStack;
import java.util.Collections;
import java.util.Map;
/**
*
@@ -85,6 +84,21 @@ public class UIBeanTest extends StrutsTestCase {
assertEquals("formId_txtFldName", txtFld.getParameters().get("id"));
}
public void testPopulateComponentHtmlWithoutNameAndId() throws Exception {
ValueStack stack = ActionContext.getContext().getValueStack();
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
Form form = new Form(stack, req, res);
form.getParameters().put("id", "formId");
TextField txtFld = new TextField(stack, req, res);
txtFld.populateComponentHtmlId(form);
assertEquals(null, txtFld.getParameters().get("id"));
}
public void testEscape() throws Exception {
ValueStack stack = ActionContext.getContext().getValueStack();
MockHttpServletRequest req = new MockHttpServletRequest();
@@ -143,7 +157,7 @@ public class UIBeanTest extends StrutsTestCase {
ValueStack stack = ActionContext.getContext().getValueStack();
MockHttpServletRequest req = new MockHttpServletRequest();
MockHttpServletResponse res = new MockHttpServletResponse();
Map context = Collections.singletonMap("theme", new Integer(12));
Map context = Collections.singletonMap("theme", 12);
ActionContext.getContext().put("attr", context);
TextField txtFld = new TextField(stack, req, res);
@@ -36,15 +36,12 @@ import javax.servlet.http.HttpServletRequest;
*/
public class CompositeActionMapperTest extends TestCase {
CompositeActionMapper compositeActionMapper;
Mock mockContainer;
public void setUp() throws Exception {
mockContainer = new Mock(Container.class);
compositeActionMapper = new CompositeActionMapper((Container)mockContainer.proxy());
}
public void testGetActionMappingAndUri1() throws Exception {
ActionMapper mapper1 = new InnerActionMapper1();
ActionMapper mapper2 = new InnerActionMapper2();
@@ -52,7 +49,7 @@ public class CompositeActionMapperTest extends TestCase {
mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper1")), mapper1);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper2")), mapper3);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper3")), mapper2);
compositeActionMapper.setActionMappers("mapper1,mapper2,mapper3");
CompositeActionMapper compositeActionMapper = new CompositeActionMapper((Container) mockContainer.proxy(), "mapper1,mapper2,mapper3");
ActionMapping actionMapping = compositeActionMapper.getMapping(new MockHttpServletRequest(), new ConfigurationManager());
String uri = compositeActionMapper.getUriFromActionMapping(new ActionMapping());
@@ -70,7 +67,7 @@ public class CompositeActionMapperTest extends TestCase {
ActionMapper mapper2 = new InnerActionMapper2();
mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper1")), mapper1);
mockContainer.expectAndReturn("getInstance", C.args(C.eq(ActionMapper.class), C.eq("mapper2")), mapper2);
compositeActionMapper.setActionMappers("mapper1,mapper2");
CompositeActionMapper compositeActionMapper = new CompositeActionMapper((Container) mockContainer.proxy(), "mapper1,mapper2");
ActionMapping actionMapping = compositeActionMapper.getMapping(new MockHttpServletRequest(), new ConfigurationManager());
String uri = compositeActionMapper.getUriFromActionMapping(new ActionMapping());
@@ -21,10 +21,8 @@
package org.apache.struts2.dispatcher.mapper;
import com.mockobjects.dynamic.Mock;
import com.mockobjects.servlet.MockHttpServletRequest;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationManager;
@@ -32,10 +30,8 @@ import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsTestCase;
import org.apache.struts2.dispatcher.ServletRedirectResult;
import org.apache.struts2.dispatcher.StrutsResultSupport;
import org.apache.struts2.views.jsp.StrutsMockHttpServletRequest;
import org.apache.struts2.views.jsp.StrutsMockHttpServletResponse;
import java.util.Arrays;
import java.util.HashMap;
@@ -447,7 +443,7 @@ public class DefaultActionMapperTest extends StrutsTestCase {
public void testRedirectPrefix() throws Exception {
Map parameterMap = new HashMap();
parameterMap.put(DefaultActionMapper.REDIRECT_PREFIX + "http://www.google.com", "");
parameterMap.put("redirect:" + "http://www.google.com", "");
StrutsMockHttpServletRequest request = new StrutsMockHttpServletRequest();
request.setupGetServletPath("/someServletPath.action");
@@ -458,25 +454,28 @@ public class DefaultActionMapperTest extends StrutsTestCase {
ActionMapping actionMapping = defaultActionMapper.getMapping(request, configManager);
Result result = actionMapping.getResult();
assertNotNull(result);
assertTrue(result instanceof ServletRedirectResult);
assertNull(result);
}
Mock invMock = new Mock(ActionInvocation.class);
ActionInvocation inv = (ActionInvocation) invMock.proxy();
ActionContext ctx = ActionContext.getContext();
ctx.put(ServletActionContext.HTTP_REQUEST, request);
StrutsMockHttpServletResponse response = new StrutsMockHttpServletResponse();
ctx.put(ServletActionContext.HTTP_RESPONSE, response);
invMock.expectAndReturn("getInvocationContext", ctx);
invMock.expectAndReturn("getStack", ctx.getValueStack());
result.execute(inv);
assertEquals("http://www.google.com", response.getRedirectURL());
//TODO: need to test location but there's noaccess to the property/method, unless we use reflection
public void testUnsafeRedirectPrefix() throws Exception {
Map parameterMap = new HashMap();
parameterMap.put("redirect:" + "http://%{3*4}", "");
StrutsMockHttpServletRequest request = new StrutsMockHttpServletRequest();
request.setupGetServletPath("/someServletPath.action");
request.setParameterMap(parameterMap);
DefaultActionMapper defaultActionMapper = new DefaultActionMapper();
defaultActionMapper.setContainer(container);
ActionMapping actionMapping = defaultActionMapper.getMapping(request, configManager);
Result result = actionMapping.getResult();
assertNull(result);
}
public void testRedirectActionPrefix() throws Exception {
Map parameterMap = new HashMap();
parameterMap.put(DefaultActionMapper.REDIRECT_ACTION_PREFIX + "myAction", "");
parameterMap.put("redirectAction:" + "myAction", "");
StrutsMockHttpServletRequest request = new StrutsMockHttpServletRequest();
request.setupGetServletPath("/someServletPath.action");
@@ -488,17 +487,29 @@ public class DefaultActionMapperTest extends StrutsTestCase {
StrutsResultSupport result = (StrutsResultSupport) actionMapping.getResult();
assertNotNull(result);
assertTrue(result instanceof ServletRedirectResult);
assertNull(result);
}
assertEquals("myAction.action", result.getLocation());
public void testUnsafeRedirectActionPrefix() throws Exception {
Map parameterMap = new HashMap();
parameterMap.put("redirectAction:" + "%{3*4}", "");
// TODO: need to test location but there's noaccess to the property/method, unless we use reflection
StrutsMockHttpServletRequest request = new StrutsMockHttpServletRequest();
request.setupGetServletPath("/someServletPath.action");
request.setParameterMap(parameterMap);
DefaultActionMapper defaultActionMapper = new DefaultActionMapper();
defaultActionMapper.setContainer(container);
ActionMapping actionMapping = defaultActionMapper.getMapping(request, configManager);
StrutsResultSupport result = (StrutsResultSupport) actionMapping.getResult();
assertNull(result);
}
public void testRedirectActionPrefixWithEmptyExtension() throws Exception {
Map parameterMap = new HashMap();
parameterMap.put(DefaultActionMapper.REDIRECT_ACTION_PREFIX + "myAction", "");
parameterMap.put("redirectAction:" + "myAction", "");
StrutsMockHttpServletRequest request = new StrutsMockHttpServletRequest();
request.setupGetServletPath("/someServletPath");
@@ -511,12 +522,7 @@ public class DefaultActionMapperTest extends StrutsTestCase {
StrutsResultSupport result = (StrutsResultSupport) actionMapping.getResult();
assertNotNull(result);
assertTrue(result instanceof ServletRedirectResult);
assertEquals("myAction", result.getLocation());
// TODO: need to test location but there's noaccess to the property/method, unless we use reflection
assertNull(result);
}
public void testCustomActionPrefix() throws Exception {
@@ -747,4 +753,29 @@ public class DefaultActionMapperTest extends StrutsTestCase {
}
public void testAllowedActionNames() throws Exception {
DefaultActionMapper mapper = new DefaultActionMapper();
String actionName = "action";
assertEquals(actionName, mapper.cleanupActionName(actionName));
actionName = "${action}";
assertEquals("action", mapper.cleanupActionName(actionName));
actionName = "${${%{action}}}";
assertEquals("action", mapper.cleanupActionName(actionName));
actionName = "${#foo='action',#foo}";
assertEquals("fooactionfoo", mapper.cleanupActionName(actionName));
actionName = "test-action";
assertEquals("test-action", mapper.cleanupActionName(actionName));
actionName = "test_action";
assertEquals("test_action", mapper.cleanupActionName(actionName));
actionName = "test!bar.action";
assertEquals("test!bar.action", mapper.cleanupActionName(actionName));
}
}
@@ -0,0 +1,55 @@
package org.apache.struts2.interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.XWorkTestCase;
import org.easymock.EasyMock;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.util.HashSet;
import java.util.Set;
public class CookieProviderInterceptorTest extends XWorkTestCase {
public void testPreResultListenerAddition() throws Exception {
// given
ActionInvocation invocation = EasyMock.createNiceMock(ActionInvocation.class);
CookieProviderInterceptor interceptor = new CookieProviderInterceptor();
invocation.addPreResultListener(interceptor);
EasyMock.replay(invocation);
// when
interceptor.intercept(invocation);
// then
EasyMock.verify(invocation);
}
public void testCookieCreation() throws Exception {
// given
CookieProviderInterceptor interceptor = new CookieProviderInterceptor();
final Cookie cookie = new Cookie("foo", "bar");
CookieProvider action = new CookieProvider() {
public Set<Cookie> getCookies() {
Set<Cookie> cookies = new HashSet<Cookie>();
cookies.add(cookie);
return cookies;
}
};
HttpServletResponse response = EasyMock.createNiceMock(HttpServletResponse.class);
response.addCookie(cookie);
EasyMock.replay(response);
// when
interceptor.addCookiesToResponse(action, response);
// then
EasyMock.verify(response);
}
}
@@ -21,17 +21,15 @@
package org.apache.struts2.util;
import java.util.HashMap;
import java.util.Map;
import org.apache.struts2.StrutsTestCase;
import com.mockobjects.dynamic.Mock;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.ValueStackFactory;
import org.apache.struts2.StrutsTestCase;
import java.util.HashMap;
import java.util.Map;
/**
@@ -79,6 +77,8 @@ public class InvocationSessionStoreTest extends StrutsTestCase {
invocationMock = new Mock(ActionInvocation.class);
invocation = (ActionInvocation) invocationMock.proxy();
invocationMock.matchAndReturn("serialize", invocation);
invocationMock.matchAndReturn("deserialize", actionContext, invocation);
actionContext.setValueStack(stack);
invocationMock.matchAndReturn("getStack", stack);
@@ -21,16 +21,12 @@
package org.apache.struts2.views.jsp;
import java.io.File;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspWriter;
import com.mockobjects.dynamic.Mock;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.DefaultActionInvocation;
import com.opensymphony.xwork2.DefaultActionProxyFactory;
import com.opensymphony.xwork2.inject.Container;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.components.URL;
import org.apache.struts2.dispatcher.ApplicationMap;
@@ -40,15 +36,14 @@ import org.apache.struts2.dispatcher.SessionMap;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
import org.apache.struts2.dispatcher.mapper.DefaultActionMapper;
import com.mockobjects.dynamic.Mock;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionProxy;
import com.opensymphony.xwork2.DefaultActionInvocation;
import com.opensymphony.xwork2.DefaultActionProxy;
import com.opensymphony.xwork2.DefaultActionProxyFactory;
import com.opensymphony.xwork2.config.providers.XWorkConfigurationProvider;
import com.opensymphony.xwork2.config.providers.XmlConfigurationProvider;
import com.opensymphony.xwork2.inject.Container;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspWriter;
import java.io.File;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Unit test for {@link URLTag}.
@@ -619,6 +614,69 @@ public class URLTagTest extends AbstractUITagTest {
}
public void testEmbeddedParamTagExpressionGetsEvaluatedCorrectly() throws Exception {
request.setRequestURI("/public/about");
request.setQueryString("section=team&company=acme inc");
tag.setAction("team");
tag.setIncludeParams("all");
tag.doStartTag();
Foo foo = new Foo("test");
stack.push(foo);
// include nested param tag
ParamTag paramTag = new ParamTag();
paramTag.setPageContext(pageContext);
paramTag.setName("title");
paramTag.setValue("%{title}");
paramTag.doStartTag();
paramTag.doEndTag();
tag.doEndTag();
assertEquals("/team.action?section=team&amp;company=acme+inc&amp;title=test", writer.toString());
}
public void testAccessToStackInternalsGetsHandledCorrectly() throws Exception {
Map<String, Object> params = new HashMap<String, Object>();
params.put("aaa", new String[] {"1${#session[\"foo\"]='true'}"});
params.put("aab", new String[] {"1${#session[\"bar\"]}"});
params.put("aac", new String[] {"1${#_memberAccess[\"allowStaticMethodAccess\"]='true'}"});
params.put("aad", new String[] {"1${#_memberAccess[\"allowStaticMethodAccess\"]}"});
request.setParameterMap(params);
request.setRequestURI("/public/about");
request.setQueryString("aae${%23session[\"bar\"]}=1%24%7B%23session%5B%22bar%22%5D%7D");
session.put("bar", "rab");
tag.setAction("team");
tag.setIncludeParams("all");
tag.doStartTag();
tag.doEndTag();
Object allowMethodAccess = stack.findValue("\u0023_memberAccess['allowStaticMethodAccess']");
assertNotNull(allowMethodAccess);
assertEquals(Boolean.FALSE, allowMethodAccess);
assertNull(session.get("foo"));
assertEquals("/team.action?" +
"aab=1%24%7B%23session%5B%22bar%22%5D%7D" +
"&amp;" +
"aac=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%3D%27true%27%7D" +
"&amp;" +
"aaa=1%24%7B%23session%5B%22foo%22%5D%3D%27true%27%7D" +
"&amp;" +
"aad=1%24%7B%23_memberAccess%5B%22allowStaticMethodAccess%22%5D%7D" +
"&amp;"+
"aae%24%7B%23session%5B%22bar%22%5D%7D=1%24%7B%23session%5B%22bar%22%5D%7D"
, writer.toString()
);
}
protected void setUp() throws Exception {
super.setUp();
@@ -635,7 +693,14 @@ public class URLTagTest extends AbstractUITagTest {
public static class Foo {
private String title;
public void setTitle(String title) {
public Foo() {
}
public Foo( String title ) {
this.title = title;
}
public void setTitle(String title) {
this.title = title;
}
@@ -66,6 +66,7 @@ public class FileTest extends AbstractUITagTest {
Map result = super.initializedGenericTagTestProperties();
new PropertyHolder("accept", "someAccepted").addToMap(result);
new PropertyHolder("size", "101").addToMap(result);
new PropertyHolder("value", "").addToMap(result);
return result;
}
@@ -378,17 +378,17 @@ public class DefaultUrlHelperTest extends StrutsTestCase {
}
public void testTranslateAndEncode() throws Exception {
public void testEncode() throws Exception {
setProp(StrutsConstants.STRUTS_I18N_ENCODING, "UTF-8");
String result = urlHelper.translateAndEncode("\u65b0\u805e");
String result = urlHelper.encode("\u65b0\u805e");
String expectedResult = "%E6%96%B0%E8%81%9E";
assertEquals(result, expectedResult);
}
public void testTranslateAndDecode() throws Exception {
public void testDecode() throws Exception {
setProp(StrutsConstants.STRUTS_I18N_ENCODING, "UTF-8");
String result = urlHelper.translateAndDecode("%E6%96%B0%E8%81%9E");
String result = urlHelper.decode("%E6%96%B0%E8%81%9E");
String expectedResult = "\u65b0\u805e";
assertEquals(result, expectedResult);
@@ -191,7 +191,20 @@ public class XSLTResultTest extends StrutsTestCase {
assertEquals("Error transforming result", ex.getMessage());
}
}
public void testStatusCode() throws Exception {
result.setParse(false);
result.setLocation("XSLTResultTest.xsl");
result.setStatus("302");
result.execute(mai);
String out = response.getContentAsString();
assertEquals(302, response.getStatus());
assertTrue(out.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
assertTrue(out.indexOf("<result xmlns=\"http://www.w3.org/TR/xhtml1/strict\"") > -1);
}
protected void setUp() throws Exception {
super.setUp();
request = new MockHttpServletRequest();

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