Compare commits

...

223 Commits

Author SHA1 Message Date
Lukasz Lenart f0c159d871 [maven-release-plugin] prepare release STRUTS_2_3_14_2_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2@1488870 13f79535-47bb-0310-9956-ffa450edef68
2013-06-03 07:22:11 +00:00
Lukasz Lenart 859ff1af30 [maven-release-plugin] prepare branch STRUTS_2_3_14_2_X
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2@1488868 13f79535-47bb-0310-9956-ffa450edef68
2013-06-03 07:21:43 +00:00
René Gielen 394470e190 [maven-release-plugin] copy for tag STRUTS_2_3_14_2
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2@1486171 13f79535-47bb-0310-9956-ffa450edef68
2013-05-24 19:02:28 +00:00
René Gielen 8b2df4e019 [maven-release-plugin] prepare release STRUTS_2_3_14_2
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1486169 13f79535-47bb-0310-9956-ffa450edef68
2013-05-24 18:59:33 +00:00
René Gielen ea96d18d0f WW-4063
Testcase modification after refactoring

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1486164 13f79535-47bb-0310-9956-ffa450edef68
2013-05-24 18:47:35 +00:00
René Gielen 978afa48eb Maven archetype versions updated
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1486161 13f79535-47bb-0310-9956-ffa450edef68
2013-05-24 18:40:23 +00:00
René Gielen 61da6900d9 Remote excution vulnerability
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1486077 13f79535-47bb-0310-9956-ffa450edef68
2013-05-24 14:30:43 +00:00
René Gielen fed4f8e8a4 WW-4063
Skipping unneeded translation for included parameters

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1486076 13f79535-47bb-0310-9956-ffa450edef68
2013-05-24 14:29:09 +00:00
René Gielen d7804297e3 WW-4063
Improved security  by making static method attribute immutable

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1486054 13f79535-47bb-0310-9956-ffa450edef68
2013-05-24 13:52:41 +00:00
Maurizio Cucchiara 486b1479ae [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469504 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 18:07:39 +00:00
Maurizio Cucchiara 732472bd6e [maven-release-plugin] prepare release STRUTS_2_3_14_1
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469499 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 18:01:44 +00:00
Maurizio Cucchiara 3acccdecca * Rollback to the 2.3.14.1-SNAPSHOT version
* Changed the scm infos

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469476 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 17:26:29 +00:00
Maurizio Cucchiara abe07c22c2 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469389 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 15:57:34 +00:00
Maurizio Cucchiara 8e0c17e607 [maven-release-plugin] prepare release STRUTS_2_3_14_1
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469382 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 15:48:53 +00:00
Maurizio Cucchiara 535b610848 Updated the version of the archetypes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469371 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 15:28:18 +00:00
Maurizio Cucchiara 1f030bfde0 Rollback to the 2.3.14.1-SNAPSHOT version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469369 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 15:26:22 +00:00
Maurizio Cucchiara dfa3073690 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469315 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 13:33:45 +00:00
Maurizio Cucchiara 038ddb4663 [maven-release-plugin] prepare release struts2-parent-2.3.14.1
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469313 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 13:31:31 +00:00
Maurizio Cucchiara f152e7fa70 Added -SNAPSHOT suffix
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/branches/STRUTS_2_3_14_X@1469263 13f79535-47bb-0310-9956-ffa450edef68
2013-04-18 10:07:43 +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
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 9df00b0a86 [maven-release-plugin] copy for tag STRUTS_2_3_14
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14@1462298 13f79535-47bb-0310-9956-ffa450edef68
2013-03-28 20:51:33 +00:00
Lukasz Lenart 07fca85b08 [maven-release-plugin] prepare release STRUTS_2_3_14
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1462297 13f79535-47bb-0310-9956-ffa450edef68
2013-03-28 20:51:02 +00:00
Lukasz Lenart a1e8c628f5 WW-4022 Updates version of archetypes to match release version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1462292 13f79535-47bb-0310-9956-ffa450edef68
2013-03-28 20:21:52 +00:00
Lukasz Lenart 3d19149866 WW-4027 Changes app context to match archetype
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1461961 13f79535-47bb-0310-9956-ffa450edef68
2013-03-28 06:33:38 +00:00
Maurizio Cucchiara d1635c5c9e minor change: adjusted indentation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1461735 13f79535-47bb-0310-9956-ffa450edef68
2013-03-27 17:33:18 +00:00
Maurizio Cucchiara 4eee1f4747 WW-4031 - Missing log4j.properties inside convention and blank app archetypes (placed log4j file in the right dir)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1461733 13f79535-47bb-0310-9956-ffa450edef68
2013-03-27 17:32:06 +00:00
Maurizio Cucchiara e5a217a891 WW-4031 - Missing log4j.properties inside convention and blank app archetypes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1461711 13f79535-47bb-0310-9956-ffa450edef68
2013-03-27 17:02:28 +00:00
Maurizio Cucchiara 90cd4fc717 WW-4030 - Blank, Convention and Starter archetype contains a wrong path
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1461694 13f79535-47bb-0310-9956-ffa450edef68
2013-03-27 16:25:56 +00:00
Christian Grobmeier aa991b14b0 WW-4029: do not print stacktraces when an optional class could not be loaded
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1461544 13f79535-47bb-0310-9956-ffa450edef68
2013-03-27 12:05:52 +00:00
Lukasz Lenart b9ebe65738 WW-4026 Improves logging
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1460986 13f79535-47bb-0310-9956-ffa450edef68
2013-03-26 06:27:47 +00:00
Lukasz Lenart 3bf95951bc WW-4025 Solves problem with NPE in TextParseUtil
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1460985 13f79535-47bb-0310-9956-ffa450edef68
2013-03-26 06:21:53 +00:00
Lukasz Lenart 3ae920e5a3 WW-2537 Cleans up code and adds usage of generics
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1460983 13f79535-47bb-0310-9956-ffa450edef68
2013-03-26 06:14:18 +00:00
Lukasz Lenart 00ce58a3d6 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1460302 13f79535-47bb-0310-9956-ffa450edef68
2013-03-24 09:58:59 +00:00
Lukasz Lenart 8ca0e87d35 [maven-release-plugin] prepare release STRUTS_2_3_13
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1460299 13f79535-47bb-0310-9956-ffa450edef68
2013-03-24 09:57:28 +00:00
Lukasz Lenart 01fd6750a0 WW-4022 Updates version of archetypes to match release version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1460292 13f79535-47bb-0310-9956-ffa450edef68
2013-03-24 09:40:49 +00:00
Lukasz Lenart f7594cf03f WW-3975 Adds logic to look for handler without specified charset
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1459920 13f79535-47bb-0310-9956-ffa450edef68
2013-03-22 18:33:58 +00:00
Lukasz Lenart 8c7db9d2b0 WW-3988 Adds xwor.loggerFactory to allow define which implementation to use
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1459734 13f79535-47bb-0310-9956-ffa450edef68
2013-03-22 11:46:48 +00:00
Lukasz Lenart 359bcdbe48 WW-3988 Changes order of looking for LoggerFactory, first trying to use commons-logging
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1459689 13f79535-47bb-0310-9956-ffa450edef68
2013-03-22 09:59:43 +00:00
Lukasz Lenart 2c13925b49 WW-3964 Adds DEFAULT_PARAM to reduce noise in the logs
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1459687 13f79535-47bb-0310-9956-ffa450edef68
2013-03-22 09:37:51 +00:00
Lukasz Lenart 6e33b77ad8 WW-4019 When looking for converter of primitive type fallback to defaultConverter
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1459662 13f79535-47bb-0310-9956-ffa450edef68
2013-03-22 08:23:07 +00:00
Lukasz Lenart 1815a9925b WW-3389 Adds statusCode param as a excluded param to hide it in built url
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1459660 13f79535-47bb-0310-9956-ffa450edef68
2013-03-22 08:05:36 +00:00
Lukasz Lenart 48394634f5 WW-3778 Adds missing version tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1459657 13f79535-47bb-0310-9956-ffa450edef68
2013-03-22 07:53:07 +00:00
Lukasz Lenart eaa423dc71 WW-3997 Does small cleanup
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1459650 13f79535-47bb-0310-9956-ffa450edef68
2013-03-22 07:22:45 +00:00
Lukasz Lenart b4f49eed47 WW-3997 Reverts logic regarding empty action name to allow UnknownHandler work
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1459645 13f79535-47bb-0310-9956-ffa450edef68
2013-03-22 06:45:02 +00:00
Christian Grobmeier fc7ee40bd6 added example on how to use the convention plugin in conjunction with the junit plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1458681 13f79535-47bb-0310-9956-ffa450edef68
2013-03-20 08:17:33 +00:00
Christian Grobmeier cee2b773b1 removed wildcard import
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1458679 13f79535-47bb-0310-9956-ffa450edef68
2013-03-20 08:16:08 +00:00
Christian Grobmeier 6b98b9d33d added missing copyright information
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1458678 13f79535-47bb-0310-9956-ffa450edef68
2013-03-20 08:12:59 +00:00
Lukasz Lenart aaa27dc380 WW-3994 Uses constructor injections instead property injections to avoid NPE
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1458543 13f79535-47bb-0310-9956-ffa450edef68
2013-03-19 22:11:59 +00:00
Lukasz Lenart e091eb41f3 WW-3406 Solves NPE problem
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1458537 13f79535-47bb-0310-9956-ffa450edef68
2013-03-19 21:58:55 +00:00
Lukasz Lenart b56b9b9ff4 WW-3996 Updates files of example app to match new param name
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1458528 13f79535-47bb-0310-9956-ffa450edef68
2013-03-19 21:44:07 +00:00
Lukasz Lenart f1a2affae1 WW-4012 Changes order of params evaluation that the expression takes precedence
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457969 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 20:17:24 +00:00
Lukasz Lenart b68257de96 WW-4014 Improves VisitorFieldValidator annotation to match VisitorFieldValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457746 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 13:01:47 +00:00
Lukasz Lenart 878d7e55cb WW-4013 Improves UrlValidator annotation to match UrlValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457744 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 12:54:02 +00:00
Lukasz Lenart cff4d773b4 WW-4012 Improves StringLengthFieldValidator annotation to match StringLengthFieldValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457742 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 12:48:14 +00:00
Lukasz Lenart 4460ddae65 WW-4011 Improves ShortRangeFieldValidator annotation to match ShortRangeFieldValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457733 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 12:28:12 +00:00
Lukasz Lenart 9122aff601 WW-4010 Improves RequiredStringValidator annotation to match RequiredStringValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457728 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 12:12:58 +00:00
Lukasz Lenart a4eb0803dc WW-4009 Improves RequiredFieldValidator annotation to match RequiredFieldValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457722 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 12:00:22 +00:00
Lukasz Lenart 34a10bae06 WW-4008 Improves IntRangeFieldValidator annotation to match IntRangeFieldValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457708 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 11:01:14 +00:00
Lukasz Lenart 8a4c6f9376 WW-4007 Improves FieldExpressionValidator annotation to match FieldExpressionValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457704 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 10:40:08 +00:00
Lukasz Lenart 62d20e0302 WW-4006 Improves ExpressionValidator annotation to match ExpressionValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457703 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 10:30:24 +00:00
Lukasz Lenart 80df6b3065 WW-4005 Improves EmailValidator annotation to match EmailValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457694 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 10:11:36 +00:00
Lukasz Lenart c20ed48c44 Re-formats code and removes empty lines
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457678 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 09:15:07 +00:00
Lukasz Lenart ae90857f11 WW-4004 Improves DoubleRangeFieldValidator annotation to match DoubleRangeFieldValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457672 13f79535-47bb-0310-9956-ffa450edef68
2013-03-18 08:39:53 +00:00
Lukasz Lenart eb988a4b15 WW-4003 Improves DateRangeFieldValidator annotation to match DateRangeFieldValidator class
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457552 13f79535-47bb-0310-9956-ffa450edef68
2013-03-17 20:22:18 +00:00
Lukasz Lenart 7e61564f82 WW-4002 Improves CustomValidator annotation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457442 13f79535-47bb-0310-9956-ffa450edef68
2013-03-17 13:25:41 +00:00
Christian Grobmeier 07c8e20161 WW-4017: Support multiple Action executions and Session values
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457393 13f79535-47bb-0310-9956-ffa450edef68
2013-03-17 07:45:59 +00:00
Christian Grobmeier 762cc86714 WW-4017: Support multiple Action executions and Session values
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457392 13f79535-47bb-0310-9956-ffa450edef68
2013-03-17 07:44:54 +00:00
Lukasz Lenart 42d24e190f WW-4001 Improves ConversionErrorFieldValidator annotation to match validator class ConversionErrorFieldValidator
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457267 13f79535-47bb-0310-9956-ffa450edef68
2013-03-16 15:55:48 +00:00
Lukasz Lenart 16fade2857 WW-4000 Improves ConditionalVisitorFieldValidator annotation to match validator class ConditionalVisitorFieldValidator
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457262 13f79535-47bb-0310-9956-ffa450edef68
2013-03-16 15:14:04 +00:00
Lukasz Lenart 9d10ca7a9b WW-3996 Updates RegexFieldValidator annotation to match implementing class and adds test to verify that
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457137 13f79535-47bb-0310-9956-ffa450edef68
2013-03-15 21:44:43 +00:00
Lukasz Lenart c66877c460 Extends logger params support
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1457128 13f79535-47bb-0310-9956-ffa450edef68
2013-03-15 21:24:20 +00:00
Lukasz Lenart 34af1cd8a2 WW-3998 Extracts interface and adds default implementation base on existing code
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1456961 13f79535-47bb-0310-9956-ffa450edef68
2013-03-15 14:02:12 +00:00
Lukasz Lenart da6fa05ed9 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1453279 13f79535-47bb-0310-9956-ffa450edef68
2013-03-06 10:44:43 +00:00
Lukasz Lenart 0de4b61ff2 [maven-release-plugin] prepare release STRUTS_2_3_12
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1453277 13f79535-47bb-0310-9956-ffa450edef68
2013-03-06 10:44:20 +00:00
Lukasz Lenart 41eb4c2444 WW-3977 Updates version of archetypes to match release version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1453267 13f79535-47bb-0310-9956-ffa450edef68
2013-03-06 10:23:35 +00:00
Lukasz Lenart 9220708b59 WW-3991 Removes one to much call to normalizeToFileProtocol() method
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1452471 13f79535-47bb-0310-9956-ffa450edef68
2013-03-04 19:51:27 +00:00
Lukasz Lenart d89ac943b4 WW-3990 Returns null when trying to escape null value instead of returning an empty string
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1452255 13f79535-47bb-0310-9956-ffa450edef68
2013-03-04 11:17:47 +00:00
Lukasz Lenart 8daf1db8d9 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1451116 13f79535-47bb-0310-9956-ffa450edef68
2013-02-28 06:34:21 +00:00
Lukasz Lenart 8cefc26601 [maven-release-plugin] prepare release STRUTS_2_3_11
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1451114 13f79535-47bb-0310-9956-ffa450edef68
2013-02-28 06:33:55 +00:00
Lukasz Lenart df8f62bb50 WW-3977 Updates version of archetypes to match release version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1451110 13f79535-47bb-0310-9956-ffa450edef68
2013-02-28 06:19:17 +00:00
Lukasz Lenart 890e62bcf8 WW-3977 changes site target
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1451109 13f79535-47bb-0310-9956-ffa450edef68
2013-02-28 06:17:33 +00:00
Lukasz Lenart fb161f5535 Best practise - filters output values
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1448581 13f79535-47bb-0310-9956-ffa450edef68
2013-02-21 11:07:21 +00:00
Lukasz Lenart fe36e8bf08 Changes how links to parent site are generated
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1448580 13f79535-47bb-0310-9956-ffa450edef68
2013-02-21 11:06:22 +00:00
Lukasz Lenart 66e95042ec WW-3984 Adds support for URLs which are already normalized to file protocol
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1447738 13f79535-47bb-0310-9956-ffa450edef68
2013-02-19 14:47:00 +00:00
Lukasz Lenart 9d20642ccc WW-3984 Reverts some changes from previous commit
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1447689 13f79535-47bb-0310-9956-ffa450edef68
2013-02-19 11:45:45 +00:00
Lukasz Lenart 94c0a6cfdf WW-3984 Adds additional logging to check what is wrong
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1447654 13f79535-47bb-0310-9956-ffa450edef68
2013-02-19 10:13:53 +00:00
Lukasz Lenart 1c55798977 WW-3986 Reverts partially changes introduced with WW-3363 to use @Inject MultiPartRequest instead of name of MultiPartRequest
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1447453 13f79535-47bb-0310-9956-ffa450edef68
2013-02-18 19:53:42 +00:00
Lukasz Lenart e6e1976f39 WW-3984 Adds support for Convention plugin which based on actions in a Jar file embedded in Ear file on JBoss 5 server
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1447442 13f79535-47bb-0310-9956-ffa450edef68
2013-02-18 19:13:44 +00:00
Lukasz Lenart 44615af72b Adjusts website to folder structure
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1445912 13f79535-47bb-0310-9956-ffa450edef68
2013-02-13 20:46:24 +00:00
Lukasz Lenart 0aefd0a8c1 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1443341 13f79535-47bb-0310-9956-ffa450edef68
2013-02-07 07:54:10 +00:00
Lukasz Lenart feafa63d71 [maven-release-plugin] prepare release STRUTS_2_3_10
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1443339 13f79535-47bb-0310-9956-ffa450edef68
2013-02-07 07:53:43 +00:00
Lukasz Lenart fc57c2c242 WW-3977 Updates version of archetypes to match release version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1443329 13f79535-47bb-0310-9956-ffa450edef68
2013-02-07 07:30:00 +00:00
Lukasz Lenart 0c00c11d0b WW-3908 Renames required into requiredLabel to allow support of Html5 required attribute
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1442481 13f79535-47bb-0310-9956-ffa450edef68
2013-02-05 07:08:38 +00:00
Lukasz Lenart a34bb460f5 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1442037 13f79535-47bb-0310-9956-ffa450edef68
2013-02-04 07:11:54 +00:00
Lukasz Lenart 77d51c4222 [maven-release-plugin] prepare release STRUTS_2_3_9
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1442035 13f79535-47bb-0310-9956-ffa450edef68
2013-02-04 07:11:30 +00:00
Lukasz Lenart 2e19fc6670 WW-3977 changes version of archetypes
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1442033 13f79535-47bb-0310-9956-ffa450edef68
2013-02-04 06:56:26 +00:00
Lukasz Lenart 98ec0ea1bb WW-3977 changes site target
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1442032 13f79535-47bb-0310-9956-ffa450edef68
2013-02-04 06:53:48 +00:00
Lukasz Lenart 8a8c193fde Corrects site endpoint
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1441896 13f79535-47bb-0310-9956-ffa450edef68
2013-02-03 11:46:19 +00:00
Lukasz Lenart 596858143f Adjusts site configuration to use new Apache scm plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1441613 13f79535-47bb-0310-9956-ffa450edef68
2013-02-01 20:12:37 +00:00
Lukasz Lenart 97ae65c7a3 WW-3974 solves problem with parsing properties
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1439606 13f79535-47bb-0310-9956-ffa450edef68
2013-01-28 20:17:03 +00:00
Lukasz Lenart 504c86ead7 WW-3973 adds disclaimer about ParameterNameAware
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1439410 13f79535-47bb-0310-9956-ffa450edef68
2013-01-28 14:06:10 +00:00
Lukasz Lenart 12afffe7c3 WW-3931 adds new plugin to support Tiles 3 result type
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1439344 13f79535-47bb-0310-9956-ffa450edef68
2013-01-28 11:18:26 +00:00
Lukasz Lenart f852cacfee WW-3492 uses getter instead direct field access
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1439265 13f79535-47bb-0310-9956-ffa450edef68
2013-01-28 06:14:30 +00:00
Lukasz Lenart c9f2977902 WW-3698 wraps value with ValueStackDataSource if no already wrapped
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1439171 13f79535-47bb-0310-9956-ffa450edef68
2013-01-27 20:27:04 +00:00
Lukasz Lenart 6493648cc1 WW-3492 adds proper handling of If-Modified-Since header
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1439169 13f79535-47bb-0310-9956-ffa450edef68
2013-01-27 20:23:06 +00:00
Lukasz Lenart 30bc4bacc0 WW-3363 removes struts.multipart.handler and reference only to struts.multipart.parser to be consistent with the docs
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1439156 13f79535-47bb-0310-9956-ffa450edef68
2013-01-27 19:48:59 +00:00
Lukasz Lenart 7fe363aee4 WW-3664 extends Dispatcher to create directory tree defined as struts.multipart.saveDir
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1439137 13f79535-47bb-0310-9956-ffa450edef68
2013-01-27 18:41:57 +00:00
Lukasz Lenart 2d7564c05b WW-3871 refactors XWorkConverter to separate logic a bit
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1437180 13f79535-47bb-0310-9956-ffa450edef68
2013-01-22 21:20:35 +00:00
Lukasz Lenart ebc33bc718 Adds support for debug(String, Object...)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436984 13f79535-47bb-0310-9956-ffa450edef68
2013-01-22 14:55:59 +00:00
Lukasz Lenart 3f1f9a133b WW-3845 adds usage of putIfAbsent to improve atomicity
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436951 13f79535-47bb-0310-9956-ffa450edef68
2013-01-22 14:28:15 +00:00
Lukasz Lenart 7010dd2f56 WW-3845 improves code to avoid empty HashSet
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436940 13f79535-47bb-0310-9956-ffa450edef68
2013-01-22 14:13:07 +00:00
Lukasz Lenart 4f98e9148d WW-3971 adds ContainerHolder to reduce numbers of calls to getConfiguration() and optimize RuntimeConfiguration class to more thread friendly
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436878 13f79535-47bb-0310-9956-ffa450edef68
2013-01-22 12:44:45 +00:00
Lukasz Lenart 2d91d4598f Reduces log level to info
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436866 13f79535-47bb-0310-9956-ffa450edef68
2013-01-22 12:27:12 +00:00
Lukasz Lenart bacefffda4 WW-3919 adds proper logic to render id attribute
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436660 13f79535-47bb-0310-9956-ffa450edef68
2013-01-21 22:23:18 +00:00
Lukasz Lenart e1da75d1bc WW-3912 adds proper support for checked attribute
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436650 13f79535-47bb-0310-9956-ffa450edef68
2013-01-21 22:07:08 +00:00
Lukasz Lenart aba3b61670 WW-3922 uses default template engine to support cooperation with other plugins
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436643 13f79535-47bb-0310-9956-ffa450edef68
2013-01-21 21:52:34 +00:00
Lukasz Lenart 62ee2636af WW-3920 adds support for scripting events
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436637 13f79535-47bb-0310-9956-ffa450edef68
2013-01-21 21:47:13 +00:00
Lukasz Lenart 9b951fcd73 WW-3829 moves link to wiki
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436528 13f79535-47bb-0310-9956-ffa450edef68
2013-01-21 18:17:13 +00:00
Lukasz Lenart 96c99ce061 WW-3829 adds better logging and improve example in JavaDoc
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436526 13f79535-47bb-0310-9956-ffa450edef68
2013-01-21 18:13:32 +00:00
Lukasz Lenart 32ea57d925 Solves problem with possible NPE when key is null - https://github.com/apache/struts2/pull/4
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1436290 13f79535-47bb-0310-9956-ffa450edef68
2013-01-21 11:37:16 +00:00
Lukasz Lenart 186d2c1346 WW-3673 upgrades Log4j version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1435936 13f79535-47bb-0310-9956-ffa450edef68
2013-01-20 19:57:56 +00:00
Lukasz Lenart 6d5c38bea2 WW-3808 adds xerces to allow pass build on JDK7
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1435934 13f79535-47bb-0310-9956-ffa450edef68
2013-01-20 19:52:55 +00:00
Lukasz Lenart 02dbb86205 WW-3916 adds usage of the latest Jetty plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1435931 13f79535-47bb-0310-9956-ffa450edef68
2013-01-20 19:44:55 +00:00
Lukasz Lenart bbdaff9c0a WW-3965 solves problem with double bang in generated URI
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1434896 13f79535-47bb-0310-9956-ffa450edef68
2013-01-17 20:22:32 +00:00
Lukasz Lenart c4bc382de5 WW-3908 renames required attribute into requiredLabel to allow support of Html5 required attribute
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1434580 13f79535-47bb-0310-9956-ffa450edef68
2013-01-17 07:41:45 +00:00
Lukasz Lenart 85cfb8ba76 Solves problem with missing action name when mapping returned with empty action name
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1433889 13f79535-47bb-0310-9956-ffa450edef68
2013-01-16 10:39:01 +00:00
Lukasz Lenart adf10c07bb Solves problem with missing action name when mapping returned with empty action name
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1433854 13f79535-47bb-0310-9956-ffa450edef68
2013-01-16 08:36:59 +00:00
Lukasz Lenart 37025bc7b6 Adds better logging message to indicate where is the problem, which result type is missing DEFAULT_PARAM field
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1433853 13f79535-47bb-0310-9956-ffa450edef68
2013-01-16 08:34:41 +00:00
Lukasz Lenart 9389ae248a WW-3962 removes duplicated initialisation of loggerFactory
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1433650 13f79535-47bb-0310-9956-ffa450edef68
2013-01-15 21:09:01 +00:00
Lukasz Lenart bb5694b855 Improves logging of exceptions
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1433644 13f79535-47bb-0310-9956-ffa450edef68
2013-01-15 20:58:08 +00:00
Lukasz Lenart 09302facda WW-3837 solves problem with NPE
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1433600 13f79535-47bb-0310-9956-ffa450edef68
2013-01-15 19:43:43 +00:00
Lukasz Lenart 2db92f7040 WW-3904 removes parse param as is not needed anymore
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1432606 13f79535-47bb-0310-9956-ffa450edef68
2013-01-13 13:20:30 +00:00
Lukasz Lenart a8966a383d WW-3960 adds support to specify param as an expression
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1432603 13f79535-47bb-0310-9956-ffa450edef68
2013-01-13 13:05:21 +00:00
Lukasz Lenart dfe1d7c672 WW-3893 adds optional to params to define minLength, maxLength and trim params as an OGNL expression
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1432595 13f79535-47bb-0310-9956-ffa450edef68
2013-01-13 12:08:19 +00:00
Lukasz Lenart 6f110d8939 WW-3894 updates JavaDoc to match new implementation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1432590 13f79535-47bb-0310-9956-ffa450edef68
2013-01-13 11:23:55 +00:00
Lukasz Lenart f81e5ac903 WW-3892 updates JavaDoc to match the implementation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1432589 13f79535-47bb-0310-9956-ffa450edef68
2013-01-13 11:22:59 +00:00
Lukasz Lenart 52dba6bc29 WW-3894 updates JavaDoc to match new implementation
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1432588 13f79535-47bb-0310-9956-ffa450edef68
2013-01-13 11:19:47 +00:00
Lukasz Lenart 42c487bbca WW-3892 adjusts para names to new version of RegexpValidator
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1432586 13f79535-47bb-0310-9956-ffa450edef68
2013-01-13 11:03:39 +00:00
Lukasz Lenart b63c5086ba WW-3894 uses dedicated params to specify OGNL expressions
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1432585 13f79535-47bb-0310-9956-ffa450edef68
2013-01-13 11:00:37 +00:00
Lukasz Lenart f6a3d59df7 Adds missing documentation section
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1431540 13f79535-47bb-0310-9956-ffa450edef68
2013-01-10 18:18:39 +00:00
Johannes Geppert 5f083d4b23 WW-3959 Support for Slf4j as optional XWork Logging Backend
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1431482 13f79535-47bb-0310-9956-ffa450edef68
2013-01-10 16:26:26 +00:00
Lukasz Lenart d59aac13f2 WW-2923 adds support to be Locale independent
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1431122 13f79535-47bb-0310-9956-ffa450edef68
2013-01-09 22:35:08 +00:00
Lukasz Lenart e3602c0992 WW-2923 refactors validators to use dedicated params to define expressions
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1431115 13f79535-47bb-0310-9956-ffa450edef68
2013-01-09 22:21:56 +00:00
Lukasz Lenart 551e66d11e WW-3955 adds support to specify maxInclusive, minInclusive, minExclusive and maxExclusive params as expression
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428576 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 20:25:46 +00:00
Lukasz Lenart fab92fb0f2 Corrects tiny problem with formatting
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428457 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 16:31:57 +00:00
Lukasz Lenart ec4d64a308 Adds missing parse param in example
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428445 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 16:20:11 +00:00
Lukasz Lenart a77303e4bf Adds additional SNIPPET
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428441 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 16:14:09 +00:00
Lukasz Lenart dadb24ef47 Adds additional SNIPPET
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428436 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 16:12:49 +00:00
Lukasz Lenart ed155d05fe Adds additional SNIPPET
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428435 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 16:12:17 +00:00
Lukasz Lenart f5b8031de5 Adds additional SNIPPET
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428431 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 16:11:26 +00:00
Lukasz Lenart de18aca845 Adds additional SNIPPET
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428430 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 16:11:01 +00:00
Lukasz Lenart 837f85931e Removes duplicated warning
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428427 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 16:05:54 +00:00
Lukasz Lenart 8ba1848ecd Adds additional SNIPPET
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428423 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 16:04:24 +00:00
Lukasz Lenart 6a5a17f639 Removes duplicated code
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428293 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 11:29:38 +00:00
Lukasz Lenart 204a6f544f WW-3893 adds support to specify minLength, maxLength and trim params as expression
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428282 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 11:14:26 +00:00
Lukasz Lenart 673873c0c6 Moves parse(String, Class) to parent class to allow use it in all subclasess
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428281 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 11:13:36 +00:00
Lukasz Lenart 159829bd5b WW-3892 adds support to specify expression, caseSensitive and trim params as expressions
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428270 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 10:32:30 +00:00
Lukasz Lenart e65442f874 WW-3892 adds support to specify expression, caseSensitive and trim params as expressions
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428268 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 10:31:35 +00:00
Lukasz Lenart a7a7d1297c WW-3892 adds support to specify expression, caseSensitive and trim params as expressions
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428264 13f79535-47bb-0310-9956-ffa450edef68
2013-01-03 10:22:07 +00:00
Lukasz Lenart bc81e66e91 WW-3889 adds support to specify min and max constraints as expressions
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428077 13f79535-47bb-0310-9956-ffa450edef68
2013-01-02 21:44:41 +00:00
Lukasz Lenart 5d1edd6cc6 WW-3891 uses new way to define min/max as expression
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428076 13f79535-47bb-0310-9956-ffa450edef68
2013-01-02 21:43:39 +00:00
Lukasz Lenart daf5567a58 WW-3890 uses new way to define min/max as expression
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428075 13f79535-47bb-0310-9956-ffa450edef68
2013-01-02 21:43:01 +00:00
Lukasz Lenart 6517e330d0 WW-3888 uses new way to define min/max as expression
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428073 13f79535-47bb-0310-9956-ffa450edef68
2013-01-02 21:42:12 +00:00
Lukasz Lenart aa9de79979 WW-3890 improves support for generics and moves test values into the tests
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428072 13f79535-47bb-0310-9956-ffa450edef68
2013-01-02 21:41:26 +00:00
Lukasz Lenart 542b68666b WW-2923 adds better support for generics
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428071 13f79535-47bb-0310-9956-ffa450edef68
2013-01-02 21:40:21 +00:00
Lukasz Lenart 3a0454129e Removes unused constants and adds some logging
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1428017 13f79535-47bb-0310-9956-ffa450edef68
2013-01-02 20:41:22 +00:00
Lukasz Lenart d3624cbfbd WW-3953 adjusts Log level for accepted parameters
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1426761 13f79535-47bb-0310-9956-ffa450edef68
2012-12-29 13:38:20 +00:00
Lukasz Lenart 612e6f6611 Reverts back site target
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1425299 13f79535-47bb-0310-9956-ffa450edef68
2012-12-22 15:43:47 +00:00
Lukasz Lenart 23d2fbba65 Adds private scope
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1424653 13f79535-47bb-0310-9956-ffa450edef68
2012-12-20 19:54:05 +00:00
Lukasz Lenart bd01d1525a WW-3890 adds support for expression in specifying min and max constraints
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1424652 13f79535-47bb-0310-9956-ffa450edef68
2012-12-20 19:47:02 +00:00
Lukasz Lenart 40b7bfbe25 WW-3891 adds new Short validator and adds support for expression in specifying min and max constraints
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1424643 13f79535-47bb-0310-9956-ffa450edef68
2012-12-20 19:12:36 +00:00
Lukasz Lenart 27f8976f3a WW-3950 solves problem when there are two Convention based application deployed to JBoss 4.x
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1424375 13f79535-47bb-0310-9956-ffa450edef68
2012-12-20 09:25:40 +00:00
Lukasz Lenart c76e84572a WW-3947 improves Portlet Archetype
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1423630 13f79535-47bb-0310-9956-ffa450edef68
2012-12-18 20:37:23 +00:00
Lukasz Lenart bbb710b49f WW-3906 updates docs about parsing parameters
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1423626 13f79535-47bb-0310-9956-ffa450edef68
2012-12-18 20:30:41 +00:00
Lukasz Lenart 33a2e74ac4 WW-3906 adds support to parse all parameters of HttpHeaderResult
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1423621 13f79535-47bb-0310-9956-ffa450edef68
2012-12-18 20:27:39 +00:00
Lukasz Lenart 0ad2b155e2 WW-3755 extracts acceptedParamNames to constant
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1423615 13f79535-47bb-0310-9956-ffa450edef68
2012-12-18 20:13:50 +00:00
Lukasz Lenart fdc6b27e68 WW-3929 adds new errorPosition attribute
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1423607 13f79535-47bb-0310-9956-ffa450edef68
2012-12-18 19:53:12 +00:00
Lukasz Lenart 6368033118 WW-3925 adds better support for looking index action when user hits default namespace
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1423571 13f79535-47bb-0310-9956-ffa450edef68
2012-12-18 18:36:09 +00:00
Lukasz Lenart 036c5e77d4 Moves documentation to the wiki
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1422955 13f79535-47bb-0310-9956-ffa450edef68
2012-12-17 14:50:18 +00:00
Lukasz Lenart ab427ca043 Adds additional example how to use the mapper - thanks to Antonios Gkogkakis
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1422939 13f79535-47bb-0310-9956-ffa450edef68
2012-12-17 14:16:32 +00:00
Lukasz Lenart 640437c48b [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1422546 13f79535-47bb-0310-9956-ffa450edef68
2012-12-16 11:45:49 +00:00
Lukasz Lenart 992bc8c641 [maven-release-plugin] prepare release STRUTS_2_3_8
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1422543 13f79535-47bb-0310-9956-ffa450edef68
2012-12-16 11:44:57 +00:00
Lukasz Lenart 3ac5711ef3 WW-3946 Removes commented plugins to allow prepare a release
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1422519 13f79535-47bb-0310-9956-ffa450edef68
2012-12-16 11:09:31 +00:00
Lukasz Lenart eb43cfc9c8 WW-3946 updates archetypes version
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1422507 13f79535-47bb-0310-9956-ffa450edef68
2012-12-16 10:29:05 +00:00
Lukasz Lenart 1f1d855086 WW-3946 prepares for release
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1422506 13f79535-47bb-0310-9956-ffa450edef68
2012-12-16 10:27:44 +00:00
Lukasz Lenart a4f1a77b2d WW-3863 Allows to define encoding per result
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1421740 13f79535-47bb-0310-9956-ffa450edef68
2012-12-14 08:53:49 +00:00
Lukasz Lenart b86d3d13fe WW-3942 solves NPE in iterator tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1421210 13f79535-47bb-0310-9956-ffa450edef68
2012-12-13 10:42:09 +00:00
Lukasz Lenart 0d93ceedf3 WW-3943 adds support for REST plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1421096 13f79535-47bb-0310-9956-ffa450edef68
2012-12-13 07:24:06 +00:00
Christian Grobmeier 6bd836ee2a corrected svn id tag
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1420932 13f79535-47bb-0310-9956-ffa450edef68
2012-12-12 19:44:33 +00:00
Christian Grobmeier b87e82b1c9 added required license header
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1420931 13f79535-47bb-0310-9956-ffa450edef68
2012-12-12 19:43:31 +00:00
Christian Grobmeier b72d2a08c4 created serial uid
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1420930 13f79535-47bb-0310-9956-ffa450edef68
2012-12-12 19:37:49 +00:00
Christian Grobmeier adacc6741a example on how to wire session scoped spring beans prio spring-test 3.2 with the junit plugin
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1420928 13f79535-47bb-0310-9956-ffa450edef68
2012-12-12 19:36:56 +00:00
Lukasz Lenart 21d624697d WW-3766 sets struts.freemarker.mru.max.strong.size to 0 to SoftCacheStorage which performs better in heavy loaded applications
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1419061 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 18:09:19 +00:00
Lukasz Lenart 147a391cb6 WW-2537 cleans up code and logging
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1419038 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 17:45:58 +00:00
Lukasz Lenart f437838f39 WW-2537 clears warning about generics
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1418923 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 12:57:07 +00:00
Lukasz Lenart b312f1e7a0 WW-2537 clears warning about generics
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1418920 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 12:51:14 +00:00
Lukasz Lenart 225921477b WW-3058 Removes version from pom to use version from parent pom
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1418881 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 10:18:47 +00:00
Lukasz Lenart 3b8f2023c2 WW-3058 Upgrades only Velocity to 1.6.4 and cleans up poms a bit
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1418866 13f79535-47bb-0310-9956-ffa450edef68
2012-12-09 09:45:55 +00:00
Lukasz Lenart 35897a3c6c WW-3910 returns empty string list instead null and uses List instead of String[] array
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1417344 13f79535-47bb-0310-9956-ffa450edef68
2012-12-05 10:35:55 +00:00
Lukasz Lenart 58c919c5cb WW-3927 corrects developer notification
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1417339 13f79535-47bb-0310-9956-ffa450edef68
2012-12-05 10:17:35 +00:00
Lukasz Lenart 87feb01fd6 Adds Comparable to allow compile under JDK7
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1417321 13f79535-47bb-0310-9956-ffa450edef68
2012-12-05 09:08:10 +00:00
Lukasz Lenart d5108840a5 WW-3928 Rollbacks changes introduced with WW-2749 to allow work with mod_jk and so on
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1415770 13f79535-47bb-0310-9956-ffa450edef68
2012-11-30 17:58:41 +00:00
Lukasz Lenart 5c25eab9ef WW-3930 updates JavaDocs about static content loader
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1415524 13f79535-47bb-0310-9956-ffa450edef68
2012-11-30 07:25:53 +00:00
Lukasz Lenart cbe1d02cc5 Removes metadata as it's useless now
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1414891 13f79535-47bb-0310-9956-ffa450edef68
2012-11-28 20:12:49 +00:00
Lukasz Lenart c7eb0be7bf WW-3928 Adds deprecation warning to don't use ActionContextCleanUp any more
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1414400 13f79535-47bb-0310-9956-ffa450edef68
2012-11-27 21:06:08 +00:00
Lukasz Lenart 64c1753893 Excludes gxp and embedded jsp plugins from Maven build as theses plugins aren't Java5 complaint
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412446 13f79535-47bb-0310-9956-ffa450edef68
2012-11-22 08:06:54 +00:00
Lukasz Lenart 0f2c049ef2 Adjusts code base to be compliant with Java 1.5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412443 13f79535-47bb-0310-9956-ffa450edef68
2012-11-22 07:49:20 +00:00
Lukasz Lenart 948cbd8679 Adjusts code base to be compliant with Java 1.5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412438 13f79535-47bb-0310-9956-ffa450edef68
2012-11-22 07:34:17 +00:00
Lukasz Lenart 0802b09ea1 Adjusts code base to be compliant with Java 1.7
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412316 13f79535-47bb-0310-9956-ffa450edef68
2012-11-21 21:43:04 +00:00
Lukasz Lenart edbfa6716c Adjusts code base to be compliant with Java 1.5
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412281 13f79535-47bb-0310-9956-ffa450edef68
2012-11-21 20:48:20 +00:00
Christian Grobmeier 7f83250dc3 fixed typo
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412216 13f79535-47bb-0310-9956-ffa450edef68
2012-11-21 18:02:53 +00:00
Christian Grobmeier 6a0abf4387 Example should not use deprecated attributes. Added example showing evaluation of tag body
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1412215 13f79535-47bb-0310-9956-ffa450edef68
2012-11-21 18:02:17 +00:00
Lukasz Lenart b2428dbe78 WW-3884 reverts site target back to 2.x
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1411402 13f79535-47bb-0310-9956-ffa450edef68
2012-11-19 20:45:37 +00:00
Lukasz Lenart 7e3f60601b WW-3918 removes FileManager#isReloadConfigs() method and use @Inject("struts.configuration.xml.reload")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406190 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 15:45:57 +00:00
Lukasz Lenart 1011732ee2 WW-3918 removes FileManager#isReloadConfigs() method and use @Inject("struts.configuration.xml.reload")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406183 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 15:36:59 +00:00
Lukasz Lenart 60afb3aa82 WW-3918 removes FileManager#isReloadConfigs() method and use @Inject("struts.configuration.xml.reload")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406176 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 15:28:56 +00:00
Lukasz Lenart ac46437f21 WW-3907 upgrades to OGNL 3.0.6
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406159 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 14:54:28 +00:00
Lukasz Lenart 68b0ac243d Does minor code refactoring and adds some additional logging
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406154 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 14:44:10 +00:00
Lukasz Lenart f619eaefbf WW-3918 removes FileManager#isReloadConfigs() method and use @Inject("struts.configuration.xml.reload")
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406145 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 14:23:51 +00:00
Lukasz Lenart 2f465f8daf WW-3917 removes FileManager dependency from UrlSet
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406110 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 12:18:21 +00:00
Lukasz Lenart e0609a5fe8 WW-3916 adds the latest Jetty maven plugin to blank app
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406109 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 12:10:41 +00:00
Lukasz Lenart a7443f0693 [maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1406062 13f79535-47bb-0310-9956-ffa450edef68
2012-11-06 07:06:02 +00:00
360 changed files with 7882 additions and 4695 deletions
+8 -9
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-blank</artifactId>
@@ -34,9 +34,9 @@
<name>Blank Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps/blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/apps/blank</url>
</scm>
<dependencies>
@@ -65,15 +65,14 @@
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.0.1</version>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.7.v20120910</version>
<configuration>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
<scanIntervalSeconds>10</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp/WEB-INF</scanTarget>
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
<scanTarget>src/main/resources/struts.xml</scanTarget>
<scanTarget>src/main/resources/example.xml</scanTarget>
</scanTargets>
</configuration>
</plugin>
+1 -1
View File
@@ -6,7 +6,7 @@
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.devMode" value="true" />
<package name="default" namespace="/" extends="struts-default">
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-jboss-blank</artifactId>
@@ -34,9 +34,9 @@
<name>JBoss Blank Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps/jboss-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/jboss-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/jboss-blank</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/apps/jboss-blank</url>
</scm>
<dependencies>
+30 -6
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-mailreader</artifactId>
@@ -34,9 +34,9 @@
<name>Mail Reader Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps/mailreader</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/mailreader</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/mailreader</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/apps/mailreader</url>
</scm>
<dependencies>
@@ -68,11 +68,35 @@
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.0.1</version>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.7.v20120910</version>
<configuration>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
<systemProperties>
<systemProperty>
<name>log4j.configuration</name>
<value>file:${basedir}/src/main/resources/log4j.properties</value>
</systemProperty>
<systemProperty>
<name>slf4j</name>
<value>false</value>
</systemProperty>
</systemProperties>
<scanIntervalSeconds>10</scanIntervalSeconds>
<webAppSourceDirectory>${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<contextPath>/struts2-mailreader</contextPath>
<descriptor>${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
@@ -0,0 +1,36 @@
#
# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
#
# The five logging levels used by Log are (in order):
#
# 1. DEBUG (the least serious)
# 2. INFO
# 3. WARN
# 4. ERROR
# 5. FATAL (the most serious)
# Set root logger level to WARN and append to stdout
log4j.rootLogger=INFO, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
# Print only messages of level ERROR or above in the package noModule.
log4j.logger.noModule=FATAL
# OpenSymphony Stuff
log4j.logger.freemarker=INFO
log4j.logger.com.opensymphony=INFO
log4j.logger.com.opensymphony.xwork2.ognl=ERROR
log4j.logger.org.apache.struts2=WARN
log4j.logger.org.apache.struts2.components=WARN
log4j.logger.org.apache.struts2.dispatcher=WARN
log4j.logger.org.apache.struts2.convention=INFO
# Spring Stuff
log4j.logger.org.springframework=WARN
@@ -1,13 +1,9 @@
<?xml version='1.0'?>
<database>
<user username="user" fromAddress="John.User@somewhere.com"
fullName="John Q. User" password="pass">
<subscription host="mail.hotmail.com" autoConnect="false"
password="bar" type="pop3" username="user1234">
</subscription>
<subscription host="mail.yahoo.com" autoConnect="false" password="foo"
type="imap" username="jquser">
</subscription>
</user>
<user username="user" fromAddress="John.User@somewhere.com" fullName="John Q. User" password="pass">
<subscription host="mail.yahoo.com" autoConnect="false" password="foo" type="imap" username="jquser">
</subscription>
<subscription host="mail.hotmail.com" autoConnect="false" password="bar" type="pop3" username="user1234">
</subscription>
</user>
</database>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
@@ -42,9 +42,9 @@
</modules>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/apps</url>
</scm>
<profiles>
+11 -19
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet</artifactId>
@@ -34,9 +34,9 @@
<name>Portlet Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps/portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/portlet</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/apps/portlet</url>
</scm>
<profiles>
@@ -118,22 +118,8 @@
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<version>1.3</version>
<exclusions>
<exclusion>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
@@ -193,6 +179,12 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
@@ -6,6 +6,7 @@
<validator name="required" class="com.opensymphony.xwork2.validator.validators.RequiredFieldValidator"/>
<validator name="requiredstring" class="com.opensymphony.xwork2.validator.validators.RequiredStringValidator"/>
<validator name="int" class="com.opensymphony.xwork2.validator.validators.IntRangeFieldValidator"/>
<validator name="short" class="com.opensymphony.xwork2.validator.validators.ShortRangeFieldValidator"/>
<validator name="double" class="com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator"/>
<validator name="date" class="com.opensymphony.xwork2.validator.validators.DateRangeFieldValidator"/>
<validator name="expression" class="com.opensymphony.xwork2.validator.validators.ExpressionValidator"/>
+11 -4
View File
@@ -26,13 +26,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>2.3.7</version>
<version>2.3.14.2</version>
<name>Struts 2 Rest Showcase Example</name>
<description>Struts 2 Rest Showcase Example</description>
@@ -47,6 +47,11 @@
<artifactId>struts2-convention-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
@@ -96,8 +101,10 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.0.0.M2</version>
<version>8.1.7.v20120910</version>
<configuration>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
<systemProperties>
<systemProperty>
<name>log4j.configuration</name>
@@ -119,7 +126,7 @@
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<version>1.2.17</version>
</dependency>
</dependencies>
</plugin>
+8 -22
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-showcase</artifactId>
@@ -34,9 +34,9 @@
<name>Showcase Webapp</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/apps/showcase</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/showcase</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/apps/showcase</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/apps/showcase</url>
</scm>
@@ -134,23 +134,8 @@
<dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<exclusions>
<exclusion>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
</exclusion>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
<exclusion>
<groupId>struts</groupId>
<artifactId>struts</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>sitemesh</artifactId>
@@ -164,7 +149,6 @@
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
@@ -219,8 +203,10 @@
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.0.0.M2</version>
<version>8.1.7.v20120910</version>
<configuration>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
<systemProperties>
<systemProperty>
<name>log4j.configuration</name>
@@ -242,7 +228,7 @@
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<version>1.2.17</version>
</dependency>
</dependencies>
</plugin>
@@ -44,19 +44,19 @@ public class Skill implements IdEntity {
}
public String getName() {
return name;
return StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(name));
}
public void setName(String name) {
this.name = StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(name));
this.name = name;
}
public String getDescription() {
return description;
return StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(description));
}
public void setDescription(String description) {
this.description = StringEscapeUtils.escapeEcmaScript(StringEscapeUtils.escapeHtml4(description));
this.description = description;
}
public Serializable getId() {
@@ -58,7 +58,7 @@
</field>
<field name="regexValidatorField">
<field-validator type="regex">
<param name="expression">.*\.txt</param>
<param name="regex">.*\.txt</param>
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
</field-validator>
</field>
@@ -52,7 +52,7 @@
</field>
<field name="regexValidatorField">
<field-validator type="regex">
<param name="expression">.*\.txt</param>
<param name="regex"><![CDATA[ [^<>]+ ]]></param>
<message><![CDATA[ regexValidatorField must match a regexp (.*\.txt) if specified ]]></message>
</field-validator>
</field>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Maven Archetypes</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes</url>
</scm>
<modules>
+5 -5
View File
@@ -3,19 +3,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-blank</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Blank</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-blank</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-blank</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-blank</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-blank</url>
</scm>
<properties>
@@ -1,61 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor name="struts2-archetype-blank">
<fileSets>
<fileSet filtered="true" packaged="true">
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="true">
<directory>src/test/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="true">
<directory>src/main/resources</directory>
<includes>
<include>**/*package*.properties</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="true">
<directory>src/main/resources</directory>
<includes>
<include>**/*-validation.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="false">
<directory>src/main/resources</directory>
<includes>
<include>**/struts.xml</include>
<include>**/example.xml</include>
</includes>
</fileSet>
<fileSets>
<fileSet filtered="true" packaged="true">
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp/example</directory>
<includes>
<include>**/*.jsp</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp</directory>
<includes>
<include>**/index.html</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp/WEB-INF</directory>
<includes>
<include>**/web.xml</include>
</includes>
</fileSet>
</fileSets>
<fileSet filtered="true" packaged="true">
<directory>src/test/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="true">
<directory>src/main/resources</directory>
<includes>
<include>**/*package*.properties</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/resources</directory>
<includes>
<include>log4j.properties</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="true">
<directory>src/main/resources</directory>
<includes>
<include>**/*-validation.xml</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="false">
<directory>src/main/resources</directory>
<includes>
<include>**/struts.xml</include>
<include>**/example.xml</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp/example</directory>
<includes>
<include>**/*.jsp</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp</directory>
<includes>
<include>**/index.html</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/webapp/WEB-INF</directory>
<includes>
<include>**/web.xml</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>
@@ -66,17 +66,35 @@
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.21</version>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.7.v20120910</version>
<configuration>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
<systemProperties>
<systemProperty>
<name>log4j.configuration</name>
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
</systemProperty>
<systemProperty>
<name>slf4j</name>
<value>false</value>
</systemProperty>
</systemProperties>
<scanIntervalSeconds>10</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp/WEB-INF</scanTarget>
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
<scanTarget>src/main/resources/struts.xml</scanTarget>
<scanTarget>src/main/resources/example.xml</scanTarget>
</scanTargets>
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<contextPath>/struts2-blank</contextPath>
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
@@ -0,0 +1,29 @@
#
# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
#
# The five logging levels used by Log are (in order):
#
# 1. DEBUG (the least serious)
# 2. INFO
# 3. WARN
# 4. ERROR
# 5. FATAL (the most serious)
# Set root logger level to WARN and append to stdout
log4j.rootLogger=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
# Print only messages of level ERROR or above in the package noModule.
log4j.logger.noModule=ERROR
# OpenSymphony Stuff
log4j.logger.com.opensymphony=INFO
# Struts2 Stuff
log4j.logger.org.apache.struts2=INFO
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-convention</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Blank Convention</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-convention</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-convention</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-convention</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-convention</url>
</scm>
<properties>
@@ -23,6 +23,13 @@
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/resources</directory>
<includes>
<include>log4j.properties</include>
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<directory>src/main/resources</directory>
<includes>
@@ -80,16 +80,35 @@
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.21</version>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.7.v20120910</version>
<configuration>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
<systemProperties>
<systemProperty>
<name>log4j.configuration</name>
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
</systemProperty>
<systemProperty>
<name>slf4j</name>
<value>false</value>
</systemProperty>
</systemProperties>
<scanIntervalSeconds>10</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp/WEB-INF</scanTarget>
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
<scanTarget>src/main/resources/struts.xml</scanTarget>
</scanTargets>
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<contextPath>/struts2-convention</contextPath>
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
@@ -0,0 +1,29 @@
#
# Log4J Settings for log4j 1.2.x (via jakarta-commons-logging)
#
# The five logging levels used by Log are (in order):
#
# 1. DEBUG (the least serious)
# 2. INFO
# 3. WARN
# 4. ERROR
# 5. FATAL (the most serious)
# Set root logger level to WARN and append to stdout
log4j.rootLogger=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%d %5p (%c:%L) - %m%n
# Print only messages of level ERROR or above in the package noModule.
log4j.logger.noModule=ERROR
# OpenSymphony Stuff
log4j.logger.com.opensymphony=INFO
# Struts2 Stuff
log4j.logger.org.apache.struts2=INFO
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-dbportlet</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Database Portlet</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-dbportlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-dbportlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-dbportlet</developerConnection>
<url>svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-dbportlet</url>
</scm>
<properties>
+5 -5
View File
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-plugin</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Plugin</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-plugin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-plugin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-plugin</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-plugin</url>
</scm>
<properties>
+25 -29
View File
@@ -1,42 +1,38 @@
INFORMATION
===========
- This is Struts 2's "Portlet" Maven Archetype
- To be used to create a simple portlet that can be deployed as a webapp or JSR168 portlet.
- To be used to create a simple portlet that can be deployed as JSR286 portlet.
- There is a maven profile in order to test this portlet on Pluto Portal.
USAGE
=====
- change directory to where the portlet template is to be created,
for example, a 'projects' directory (which you may need to create):
cd /home/tmjee/projects
- run the following command to generate the sample portlet template, assuming :-
- root java package -> com.myCompany.myPortlet
1- Generate your archetype
- mvn archetype:generate -DartifactId=struts2-portlet-helloworld -DgroupId=com.mycompany.struts2.portlet -Dversion=1.0.0-SNAPSHOT -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-portlet -DarchetypeVersion=2.3.8
- the portlet war name -> myWebApp
2- Build your portlet project for Pluto Portal
- cd struts2-portlet-helloworld
- mvn clean package -Ppluto-embedded
3- Download and install Pluto Portal
- cd ..
- curl -v -H "Accept-Encoding: gzip" "http://apache.opensourcemirror.com/portals/pluto/pluto-2.0.3-bundle.zip" > pluto-2.0.3.zip
- unzip pluto-2.0.3.zip -d .
4- Deploy your portlet app
- cp struts2-portlet-helloworld/target/struts2-portlet-helloworld-1.0.0-SNAPSHOT.war pluto-2.0.3/webapps
5- Start Pluto Portal and create a page for your portlet
- ./pluto-2.0.3/bin/startup.sh
- Go to http://localhost:8080/pluto/portal (login: pluto / pwd: pluto)
- Click on "Pluto Admin" (http://localhost:8080/pluto/portal/Pluto%20Admin)
- On "Portal Pages" section : Add page "Struts2"
- On "Portlet Applications" section : select "/struts2-portlet-helloworld" and "HelloPortlet" then click "Add Portlet"
6- Test your portlet app
- Go to your Struts2 page http://localhost:8080/pluto/portal/Struts2 and play with your portlet !!
mvn archetype:create -DgroupId=com.myCompany.myPortlet \
-DartifactId=myWebApp \
-DarchetypeGroupId=org.apache.struts \
-DarchetypeArtifactId=struts2-archetype-portlet \
-DarchetypeVersion=2.0.9-SNAPSHOT \
-DremoteRepositories=http://people.apache.org/maven-snapshot-repository
- to compile, execute
mvn compile
- to run test cases execute
mvn test
- to clean execute
mvn clean
- to package execute
mvn package
- to start it with jetty execute as a servlet
mvn jetty:run
+5 -12
View File
@@ -2,19 +2,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-portlet</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Portlet</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-portlet</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-portlet</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-portlet</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-portlet</url>
</scm>
<properties>
@@ -25,13 +25,6 @@
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/resources/archetype-resources/src</directory>
<filtering>false</filtering>
<includes>
<include>**/*.*</include>
@@ -16,7 +16,7 @@
</includes>
</fileSet>
<fileSet filtered="false" packaged="false">
<fileSet filtered="true" packaged="false">
<directory>src/main/resources</directory>
<includes>
<include>**/*.xml</include>
@@ -3,14 +3,20 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>\${groupId}</groupId>
<artifactId>\${artifactId}</artifactId>
<version>\${version}</version>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<packaging>war</packaging>
<name>\${artifactId}</name>
<name>${artifactId}</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<struts2.version>${project.version}</struts2.version>
<portlet.api.version>2.0</portlet.api.version>
<!-- plugins -->
<plugin.compiler.version>3.0</plugin.compiler.version>
<plugin.war.version>2.3</plugin.war.version>
<plugin.pluto.version>2.0.3</plugin.pluto.version>
</properties>
<dependencies>
@@ -19,114 +25,67 @@
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>\${struts2.version}</version>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-portlet-plugin</artifactId>
<version>\${struts2.version}</version>
</dependency>
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-config-browser-plugin</artifactId>
<version>\${struts2.version}</version>
<version>${struts2.version}</version>
</dependency>
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<version>${portlet.api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.bekk.boss</groupId>
<artifactId>maven-jetty-pluto-embedded</artifactId>
<version>1.0.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.21</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jsp-2.1</artifactId>
<version>6.1.14</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${plugin.compiler.version}</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>pluto-embedded</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.pluto</groupId>
<artifactId>maven-pluto-plugin</artifactId>
<version>1.1.6</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.21</version>
<configuration>
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
<webAppConfig>
<contextPath>/${project.artifactId}</contextPath>
<defaultsDescriptor>/WEB-INF/jetty-pluto-web-default.xml</defaultsDescriptor>
</webAppConfig>
<systemProperties>
<systemProperty>
<name>org.apache.pluto.embedded.portletIds</name>
<value>HelloPortlet</value>
</systemProperty>
</systemProperties>
<scanIntervalSeconds>10</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp/WEB-INF</scanTarget>
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
<scanTarget>src/main/resources/struts.xml</scanTarget>
</scanTargets>
</configuration>
<dependencies>
<dependency>
<groupId>com.bekk.boss</groupId>
<artifactId>maven-jetty-pluto-embedded</artifactId>
<version>1.0.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<profiles>
<profile>
<id>pluto-embedded</id>
<build>
<plugins>
<!-- configure maven-war-plugin to use updated web.xml -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${plugin.war.version}</version>
<configuration>
<webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
</configuration>
</plugin>
<!-- bind 'pluto2:assemble' goal to 'generate-resources' lifecycle -->
<plugin>
<groupId>org.apache.portals.pluto</groupId>
<artifactId>maven-pluto-plugin</artifactId>
<version>${plugin.pluto.version}</version>
<executions>
<execution>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
@@ -1,12 +1,10 @@
package ${packageName};
package ${package};
import javax.portlet.PortletPreferences;
import org.apache.struts2.dispatcher.DefaultActionSupport;
import org.apache.struts2.portlet.interceptor.PortletPreferencesAware;
import com.opensymphony.xwork2.Preparable;
public class HelloAction extends DefaultActionSupport implements PortletPreferencesAware {
private static final long serialVersionUID = 1L;
@@ -1,4 +1,4 @@
package ${packageName};
package ${package};
import javax.portlet.PortletPreferences;
@@ -5,14 +5,14 @@
<struts>
<package name="default" extends="struts-portlet-default" namespace="/view">
<action name="index" class="${packageName}.HelloAction">
<action name="index" class="${package}.HelloAction">
<result>/WEB-INF/jsp/view/index.jsp</result>
</action>
</package>
<package name="edit" extends="struts-portlet-default" namespace="/edit">
<action name="index" class="${packageName}.UpdateNameAction">
<action name="index" class="${package}.UpdateNameAction">
<result type="redirectAction">
<param name="actionName">index</param>
<param name="portletMode">view</param>
@@ -1,19 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<portlet-app
version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
id="${artifactId}">
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
id="\${artifactId}">
<portlet id="HelloPortlet">
<description xml:lang="EN">Simple hello world portlet</description>
<portlet-name>HelloPortlet</portlet-name>
<display-name xml:lang="EN">${artifactId}</display-name>
<display-name xml:lang="EN">\${artifactId}</display-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr286Dispatcher</portlet-class>
<init-param>
<name>actionPackages</name>
<value>${package}</value>
</init-param>
<!-- The namespace for the actions configured for view mode -->
<init-param>
<name>viewNamespace</name>
@@ -1,5 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="${artifactId}">
<!-- Empty -->
<web-app id="\${artifactId}">
<display-name>Struts2 Hello World Portlet</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
@@ -1,21 +0,0 @@
package ${packageName};
import org.apache.pluto.core.PortletServlet;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.servlet.ServletHolder;
import org.mortbay.jetty.webapp.WebAppContext;
public class JettyPlutoLauncher {
public static void main(String[] args) throws Exception {
System.setProperty("org.apache.pluto.embedded.portletIds", "HelloPortlet");
Server server = new Server(8080);
WebAppContext webapp = new WebAppContext("src/main/webapp", "/${artifactId}");
webapp.setDefaultsDescriptor("/WEB-INF/jetty-pluto-web-default.xml");
ServletHolder portletServlet = new ServletHolder(new PortletServlet());
portletServlet.setInitParameter("portlet-name", "HelloPortlet");
portletServlet.setInitOrder(1);
webapp.addServlet(portletServlet, "/PlutoInvoker/HelloPortlet");
server.addHandler(webapp);
server.start();
}
}
+5 -5
View File
@@ -4,19 +4,19 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-archetypes</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>struts2-archetype-starter</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
<packaging>jar</packaging>
<name>Struts 2 Archetypes - Starter</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/archetypes/struts2-archetype-starter</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-starter</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-starter</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/archetypes/struts2-archetype-starter</url>
</scm>
<properties>
@@ -88,19 +88,37 @@
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.21</version>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.7.v20120910</version>
<configuration>
<stopKey>CTRL+C</stopKey>
<stopPort>8999</stopPort>
<systemProperties>
<systemProperty>
<name>log4j.configuration</name>
<value>file:\${basedir}/src/main/resources/log4j.properties</value>
</systemProperty>
<systemProperty>
<name>slf4j</name>
<value>false</value>
</systemProperty>
</systemProperties>
<scanIntervalSeconds>10</scanIntervalSeconds>
<scanTargets>
<scanTarget>src/main/webapp/WEB-INF</scanTarget>
<scanTarget>src/main/webapp/WEB-INF/web.xml</scanTarget>
<scanTarget>src/main/resources/struts.xml</scanTarget>
<scanTarget>src/main/resources/applicationContext.xml</scanTarget>
</scanTargets>
<webAppSourceDirectory>\${basedir}/src/main/webapp/</webAppSourceDirectory>
<webAppConfig>
<contextPath>/struts2-showcase</contextPath>
<descriptor>\${basedir}/src/main/webapp/WEB-INF/web.xml</descriptor>
</webAppConfig>
</configuration>
</plugin>
<dependencies>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
+4 -4
View File
@@ -11,13 +11,13 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/assembly</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/assembly</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/assembly</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/assembly</url>
</scm>
<profiles>
+4 -4
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-admin-bundle</artifactId>
@@ -12,9 +12,9 @@
<name>Struts 2 OSGi Admin Bundle</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/bundles/admin</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/bundles/admin</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/bundles/admin</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/bundles/admin</url>
</scm>
<dependencies>
+4 -10
View File
@@ -4,7 +4,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-demo-bundle</artifactId>
@@ -12,9 +12,9 @@
<name>Struts 2 OSGi Demo Bundle</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/bundles/demo</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/bundles/demo</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/bundles/demo</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/bundles/demo</url>
</scm>
<dependencies>
@@ -28,12 +28,6 @@
<groupId>org.apache.velocity</groupId>
<artifactId>velocity-tools</artifactId>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
@@ -34,9 +34,9 @@
<name>Struts OSGi Bundles</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/bundles</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/bundles</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/bundles</developerConnection>
<url>http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/bundles</url>
</scm>
<modules>
+4 -4
View File
@@ -26,7 +26,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>2.3.7</version>
<version>2.3.14.2</version>
</parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
@@ -34,9 +34,9 @@
<name>Struts 2 Core</name>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_7/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_7/core</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/core</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/struts/struts2/tags/STRUTS_2_3_14_2/core</developerConnection>
<url>http://svn.apache.org/viewcvs.cgi/struts/struts2/tags/STRUTS_2_3_14_2/core</url>
</scm>
<properties>
@@ -125,11 +125,6 @@ public final class StrutsConstants {
/** The directory to use for storing uploaded files */
public static final String STRUTS_MULTIPART_SAVEDIR = "struts.multipart.saveDir";
/**
* The name of the bean that will handle multipart requests
*/
public static final String STRUTS_MULTIPART_HANDLER = "struts.multipart.handler";
/**
* The org.apache.struts2.dispatcher.multipart.MultiPartRequest parser implementation
* for a multipart request (file upload)
@@ -233,6 +228,9 @@ public final class StrutsConstants {
/** Enables caching of parsed OGNL expressions **/
public static final String STRUTS_ENABLE_OGNL_EXPRESSION_CACHE = "struts.ognl.enableExpressionCache";
/** Enables evaluation of OGNL expressions **/
public static final String STRUTS_ENABLE_OGNL_EVAL_EXPRESSION = "struts.ognl.enableOGNLEvalExpression";
/** The{@link org.apache.struts2.views.util.UrlHelper} implementation class **/
public static final String STRUTS_URL_HELPER = "struts.view.urlHelper";
@@ -246,4 +244,12 @@ public final class StrutsConstants {
/** Enable handling exceptions by Dispatcher - true by default **/
public static final String STRUTS_HANDLE_EXCEPTION = "struts.handle.exception";
public static final String STRUTS_CONVERTER_PROPERTIES_PROCESSOR = "struts.converter.properties.processor";
public static final String STRUTS_CONVERTER_FILE_PROCESSOR = "struts.converter.file.processor";
public static final String STRUTS_CONVERTER_ANNOTATION_PROCESSOR = "struts.converter.annotation.processor";
public static final String STRUTS_CONVERTER_CREATOR = "struts.converter.creator";
public static final String STRUTS_CONVERTER_HOLDER = "struts..converter.holder";
public static final String STRUTS_EXPRESSION_PARSER = "struts.expression.parser";
}
@@ -21,16 +21,14 @@
package org.apache.struts2.components;
import java.io.Writer;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Writer;
/**
* ClosingUIBean is the standard superclass for UI components such as div etc.
@@ -59,7 +57,6 @@ public abstract class ClosingUIBean extends UIBean {
mergeTemplate(writer, buildTemplateName(openTemplate, getDefaultOpenTemplate()));
} catch (Exception e) {
LOG.error("Could not open template", e);
e.printStackTrace();
}
return result;
@@ -275,21 +275,19 @@ public class Date extends ContextBean {
}
public boolean end(Writer writer, String body) {
String msg = null;
String msg;
java.util.Date date = null;
// find the name on the valueStack
try {
//suport Calendar also
Object dateObject = findValue(name);
if (dateObject instanceof java.util.Date)
if (dateObject instanceof java.util.Date) {
date = (java.util.Date) dateObject;
else if(dateObject instanceof Calendar)
} else if(dateObject instanceof Calendar){
date = ((Calendar) dateObject).getTime();
}
} catch (Exception e) {
LOG.error("Could not convert object with key '" + name
+ "' to a java.util.Date instance");
// bad date, return a blank instead ?
msg = "";
LOG.error("Could not convert object with key '#0' to a java.util.Date instance", name);
}
//try to find the format on the stack
@@ -21,19 +21,18 @@
package org.apache.struts2.components;
import java.io.Writer;
import java.util.Iterator;
import java.util.List;
import java.util.Arrays;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.util.MakeIterator;
import org.apache.struts2.views.jsp.IteratorStatus;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.util.MakeIterator;
import org.apache.struts2.views.annotations.StrutsTag;
import org.apache.struts2.views.annotations.StrutsTagAttribute;
import org.apache.struts2.views.jsp.IteratorStatus;
import java.io.Writer;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
/**
* <!-- START SNIPPET: javadoc -->
@@ -357,7 +356,7 @@ public class IteratorComponent extends ContextBean {
}
}
class CounterIterator implements Iterator<Object> {
static class CounterIterator implements Iterator<Object> {
private int step;
private int end;
private int currentIndex;
@@ -380,7 +379,7 @@ public class IteratorComponent extends ContextBean {
if (hasNext()) {
int nextIndex = peekNextIndex();
currentIndex += step;
return value != null ? values.get(nextIndex) : nextIndex;
return values != null ? values.get(nextIndex) : nextIndex;
} else {
throw new IndexOutOfBoundsException("Index " + ( currentIndex + step) + " must be less than or equal to " + end);
}
@@ -33,7 +33,6 @@ import org.apache.struts2.views.annotations.StrutsTagAttribute;
import java.io.IOException;
import java.io.Writer;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.util.Currency;
@@ -212,6 +211,8 @@ public class Number extends ContextBean {
}
private void setRoundingMode(NumberFormat format) {
/*
TODO lukaszlenart: enable when switched to Java 1.6
if (roundingMode != null) {
roundingMode = findString(roundingMode);
if ("ceiling".equals(roundingMode)) {
@@ -234,6 +235,7 @@ public class Number extends ContextBean {
LOG.error("Could not recognise a roundingMode of [" + roundingMode + "]");
}
}
*/
}
private NumberFormat getNumberFormat() {
@@ -396,7 +398,7 @@ public class Number extends ContextBean {
/**
* @param roundingMode the roundingMode to set
*/
@StrutsTagAttribute(description = "The rounding mode to use", type = "String")
@StrutsTagAttribute(description = "The rounding mode to use - not implemented yet as this required Java 1.6", type = "String")
public void setRoundingMode(String roundingMode) {
this.roundingMode = roundingMode;
}
@@ -35,7 +35,7 @@ import com.opensymphony.xwork2.util.ValueStack;
* useful in both cases: when the complex expression takes time (performance improvement) or is hard to read (code
* readability improvement).</p>
* <p>If the tag is used with body content, the evaluation of the value parameter is omitted. Instead, the String to
* which the body eveluates is set as value for the scoped variable.</p>
* which the body evaluates is set as value for the scoped variable.</p>
*
* The scopes available are as follows :-
* <ul>
@@ -72,8 +72,11 @@ import com.opensymphony.xwork2.util.ValueStack;
*
* <pre>
* <!-- START SNIPPET: example -->
* &lt;s:set name="personName" value="person.name"/&gt;
* Hello, &lt;s:property value="#personName"/&gt;. How are you?
* &lt;s:set var="personName" value="person.name"/&gt;
* Hello, &lt;s:property value="#personName"/&gt;
*
* &lt;s:set var="janesName"&gt;Jane Doe&lt;/s:set&gt;
* &lt;s:property value="#janesName"/&gt;
* <!-- END SNIPPET: example -->
* </pre>
*
@@ -49,9 +49,10 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
/**
* UIBean is the standard superclass of all Struts UI componentns.
* UIBean is the standard superclass of all Struts UI components.
* It defines common Struts and html properties all UI components should present for usage.
*
* <!-- START SNIPPET: templateRelatedAttributes -->
@@ -156,6 +157,12 @@ import java.util.concurrent.ConcurrentHashMap;
* <td>xhtml</td>
* <td>String</td>
* <td>define required label position of form element (left/right), default to right</td>
* </tr>
* <tr>
* <td>errorPosition</td>
* <td>xhtml</td>
* <td>String</td>
* <td>define error position of form element (top|bottom), default to top</td>
* </tr>
* <tr>
* <td>name</td>
@@ -453,9 +460,10 @@ public abstract class UIBean extends Component {
protected String label;
protected String labelPosition;
protected String labelSeparator;
protected String requiredposition;
protected String requiredPosition;
protected String errorPosition;
protected String name;
protected String required;
protected String requiredLabel;
protected String tabindex;
protected String value;
protected String title;
@@ -495,7 +503,7 @@ public abstract class UIBean extends Component {
protected TemplateEngineManager templateEngineManager;
// dynamic attributes support for tags used with FreeMarker templates
protected static Map<Class, Set<String>> standardAttributesMap = new ConcurrentHashMap<Class, Set<String>>();
protected static ConcurrentMap<Class, Set<String>> standardAttributesMap = new ConcurrentHashMap<Class, Set<String>>();
@Inject(StrutsConstants.STRUTS_UI_TEMPLATEDIR)
public void setDefaultTemplateDir(String dir) {
@@ -662,12 +670,16 @@ public abstract class UIBean extends Component {
addParameter("labelposition", findString(labelPosition));
}
if (requiredposition != null) {
addParameter("requiredposition", findString(requiredposition));
if (requiredPosition != null) {
addParameter("requiredposition", findString(requiredPosition));
}
if (required != null) {
addParameter("required", findValue(required, Boolean.class));
if (errorPosition != null) {
addParameter("errorposition", findString(errorPosition));
}
if (requiredLabel != null) {
addParameter("required", findValue(requiredLabel, Boolean.class));
}
if (disabled != null) {
@@ -869,7 +881,7 @@ public abstract class UIBean extends Component {
if (name != null) {
return name.replaceAll("[\\/\\.\\[\\]]", "_");
} else {
return "";
return null;
}
}
@@ -883,7 +895,7 @@ public abstract class UIBean extends Component {
if (val != null) {
return val.replaceAll("\"", "&#34;");
} else {
return "";
return null;
}
}
@@ -1066,18 +1078,23 @@ public abstract class UIBean extends Component {
}
@StrutsTagAttribute(description="Define required position of required form element (left|right)")
public void setRequiredposition(String requiredposition) {
this.requiredposition = requiredposition;
public void setRequiredPosition(String requiredPosition) {
this.requiredPosition = requiredPosition;
}
@StrutsTagAttribute(description="Define error position of form element (top|bottom)")
public void setErrorPosition(String errorPosition) {
this.errorPosition = errorPosition;
}
@StrutsTagAttribute(description="The name to set for element")
public void setName(String name) {
this.name = name;
}
@StrutsTagAttribute(description="If set to true, the rendered element will indicate that input is required", type="Boolean", defaultValue="false")
public void setRequired(String required) {
this.required = required;
public void setRequiredLabel(String requiredLabel) {
this.requiredLabel = requiredLabel;
}
@StrutsTagAttribute(description="Set the html tabindex attribute on rendered html element")
@@ -1227,7 +1244,6 @@ public abstract class UIBean extends Component {
Set<String> standardAttributes = standardAttributesMap.get(clz);
if (standardAttributes == null) {
standardAttributes = new HashSet<String>();
standardAttributesMap.put(clz, standardAttributes);
while (clz != null) {
for (Field f : clz.getDeclaredFields()) {
if (Modifier.isProtected(f.getModifiers())
@@ -1241,8 +1257,9 @@ public abstract class UIBean extends Component {
clz = clz.getSuperclass();
}
}
standardAttributesMap.putIfAbsent(clz, standardAttributes);
}
return standardAttributes;
}
}
}
@@ -32,7 +32,12 @@ import com.opensymphony.xwork2.XWorkConstants;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.ConfigurationProvider;
import com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor;
import com.opensymphony.xwork2.conversion.ConversionFileProcessor;
import com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor;
import com.opensymphony.xwork2.conversion.ObjectTypeDeterminer;
import com.opensymphony.xwork2.conversion.TypeConverterCreator;
import com.opensymphony.xwork2.conversion.TypeConverterHolder;
import com.opensymphony.xwork2.conversion.impl.ArrayConverter;
import com.opensymphony.xwork2.conversion.impl.CollectionConverter;
import com.opensymphony.xwork2.conversion.impl.DateConverter;
@@ -44,10 +49,7 @@ import com.opensymphony.xwork2.inject.ContainerBuilder;
import com.opensymphony.xwork2.inject.Context;
import com.opensymphony.xwork2.inject.Factory;
import com.opensymphony.xwork2.inject.Scope;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.PatternMatcher;
import com.opensymphony.xwork2.util.ValueStackFactory;
import com.opensymphony.xwork2.util.*;
import com.opensymphony.xwork2.util.location.LocatableProperties;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
@@ -241,6 +243,43 @@ import java.util.StringTokenizer;
* <td>singleton</td>
* <td>Converter used to convert any object to String and back</td>
* </tr>
* <tr>
* <td>com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor</td>
* <td>struts.conversion.properties.processor</td>
* <td>singleton</td>
* <td>Process Properties to create converters</td>
* </tr>
* <tr>
* <td>com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor</td>
* <td>struts.converter.file.processor</td>
* <td>singleton</td>
* <td>Process <class>-conversion.properties file create converters</class></td>
* </tr>
* <tr>
* <td>com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor</td>
* <td>struts.converter.annotation.processor</td>
* <td>singleton</td>
* <td>Process TypeConversion annotation to create converters</td>
* </tr>
* <tr>
* <td>com.opensymphony.xwork2.conversion.TypeConverterCreator</td>
* <td>struts.converter.creator</td>
* <td>singleton</td>
* <td>Creates user converters</td>
* </tr>
* <tr>
* <td>com.opensymphony.xwork2.conversion.TypeConverterHolder</td>
* <td>struts.converter.holder</td>
* <td>singleton</td>
* <td>Holds user converters' instances</td>
* </tr>
* <tr>
* <td>com.opensymphony.xwork2.util.TextParser</td>
* <td>struts.expression.parser</td>
* <td>singleton</td>
* <td>Used to parse expressions like ${foo.bar} or %{bar.foo} but it is up tp the TextParser's
* implementation what kind of opening char to use (#, $, %, etc)</td>
* </tr>
* </table>
*
* <!-- END SNIPPET: extensionPoints -->
@@ -287,8 +326,22 @@ public class BeanSelectionProvider implements ConfigurationProvider {
public void register(ContainerBuilder builder, LocatableProperties props) {
alias(ObjectFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY, builder, props);
alias(FileManagerFactory.class, StrutsConstants.STRUTS_FILE_MANAGER_FACTORY, builder, props, Scope.SINGLETON);
alias(XWorkConverter.class, StrutsConstants.STRUTS_XWORKCONVERTER, builder, props);
alias(CollectionConverter.class, StrutsConstants.STRUTS_CONVERTER_COLLECTION, builder, props);
alias(ArrayConverter.class, StrutsConstants.STRUTS_CONVERTER_ARRAY, builder, props);
alias(DateConverter.class, StrutsConstants.STRUTS_CONVERTER_DATE, builder, props);
alias(NumberConverter.class, StrutsConstants.STRUTS_CONVERTER_NUMBER, builder, props);
alias(StringConverter.class, StrutsConstants.STRUTS_CONVERTER_STRING, builder, props);
alias(ConversionPropertiesProcessor.class, StrutsConstants.STRUTS_CONVERTER_PROPERTIES_PROCESSOR, builder, props);
alias(ConversionFileProcessor.class, StrutsConstants.STRUTS_CONVERTER_FILE_PROCESSOR, builder, props);
alias(ConversionAnnotationProcessor.class, StrutsConstants.STRUTS_CONVERTER_ANNOTATION_PROCESSOR, builder, props);
alias(TypeConverterCreator.class, StrutsConstants.STRUTS_CONVERTER_CREATOR, builder, props);
alias(TypeConverterHolder.class, StrutsConstants.STRUTS_CONVERTER_HOLDER, builder, props);
alias(TextProvider.class, StrutsConstants.STRUTS_XWORKTEXTPROVIDER, builder, props, Scope.DEFAULT);
alias(LocaleProvider.class, StrutsConstants.STRUTS_LOCALE_PROVIDER, builder, props);
alias(ActionProxyFactory.class, StrutsConstants.STRUTS_ACTIONPROXYFACTORY, builder, props);
alias(ObjectTypeDeterminer.class, StrutsConstants.STRUTS_OBJECTTYPEDETERMINER, builder, props);
@@ -306,11 +359,7 @@ public class BeanSelectionProvider implements ConfigurationProvider {
alias(UnknownHandlerManager.class, StrutsConstants.STRUTS_UNKNOWN_HANDLER_MANAGER, builder, props);
alias(UrlHelper.class, StrutsConstants.STRUTS_URL_HELPER, builder, props);
alias(CollectionConverter.class, StrutsConstants.STRUTS_CONVERTER_COLLECTION, builder, props);
alias(ArrayConverter.class, StrutsConstants.STRUTS_CONVERTER_ARRAY, builder, props);
alias(DateConverter.class, StrutsConstants.STRUTS_CONVERTER_DATE, builder, props);
alias(NumberConverter.class, StrutsConstants.STRUTS_CONVERTER_NUMBER, builder, props);
alias(StringConverter.class, StrutsConstants.STRUTS_CONVERTER_STRING, builder, props);
alias(TextParser.class, StrutsConstants.STRUTS_EXPRESSION_PARSER, builder, props);
if ("true".equalsIgnoreCase(props.getProperty(StrutsConstants.STRUTS_DEVMODE))) {
props.setProperty(StrutsConstants.STRUTS_I18N_RELOAD, "true");
@@ -326,6 +375,7 @@ public class BeanSelectionProvider implements ConfigurationProvider {
// Convert Struts properties into XWork properties
convertIfExist(props, StrutsConstants.STRUTS_LOG_MISSING_PROPERTIES, XWorkConstants.LOG_MISSING_PROPERTIES);
convertIfExist(props, StrutsConstants.STRUTS_ENABLE_OGNL_EXPRESSION_CACHE, XWorkConstants.ENABLE_OGNL_EXPRESSION_CACHE);
convertIfExist(props, StrutsConstants.STRUTS_ENABLE_OGNL_EVAL_EXPRESSION, XWorkConstants.ENABLE_OGNL_EVAL_EXPRESSION);
convertIfExist(props, StrutsConstants.STRUTS_ALLOW_STATIC_METHOD_ACCESS, XWorkConstants.ALLOW_STATIC_METHOD_ACCESS);
convertIfExist(props, StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD, XWorkConstants.RELOAD_XML_CONFIGURATION);
@@ -348,11 +398,11 @@ public class BeanSelectionProvider implements ConfigurationProvider {
String name = customBundles.nextToken();
try {
if (LOG.isInfoEnabled()) {
LOG.info("Loading global messages from " + name);
LOG.info("Loading global messages from [#0]", name);
}
LocalizedTextUtil.addDefaultResourceBundle(name);
} catch (Exception e) {
LOG.error("Could not find messages file " + name + ".properties. Skipping");
LOG.error("Could not find messages file #0.properties. Skipping", name);
}
}
}
@@ -21,7 +21,10 @@
package org.apache.struts2.dispatcher;
import java.io.IOException;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import com.opensymphony.xwork2.util.profiling.UtilTimerStack;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@@ -31,11 +34,7 @@ import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import com.opensymphony.xwork2.util.profiling.UtilTimerStack;
import java.io.IOException;
/**
* <!-- SNIPPET START: description -->
@@ -80,6 +79,8 @@ public class ActionContextCleanUp implements Filter {
*/
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
showDeprecatedWarning();
HttpServletRequest request = (HttpServletRequest) req;
HttpServletResponse response = (HttpServletResponse) res;
@@ -137,4 +138,22 @@ public class ActionContextCleanUp implements Filter {
public void init(FilterConfig arg0) throws ServletException {
}
private void showDeprecatedWarning() {
String msg =
"\n\n" +
"***************************************************************************\n" +
"* WARNING!!! *\n" +
"* *\n" +
"* >>> ActionContextCleanUp <<< is deprecated! Please use the new filters! *\n" +
"* *\n" +
"* This can be a source of unpredictable problems! *\n" +
"* *\n" +
"* Please refer to the docs for more details! *\n" +
"* http://struts.apache.org/2.x/docs/webxml.html *\n" +
"* *\n" +
"***************************************************************************\n\n";
System.out.println(msg);
}
}
@@ -0,0 +1,33 @@
package org.apache.struts2.dispatcher;
import com.opensymphony.xwork2.inject.Container;
import org.apache.struts2.StrutsConstants;
/**
* Simple class to hold Container instance per thread to minimise number of attempts
* to read configuration and build each time a new configuration.
*
* Thus depends on {@link StrutsConstants#STRUTS_CONFIGURATION_XML_RELOAD} flag,
* if set to false just use stored container, configuration will do not change.
*/
class ContainerHolder {
private static ThreadLocal<Container> instance = new ThreadLocal<Container>();
public static void store(Container instance) {
boolean reloadConfigs = Boolean.valueOf(instance.getInstance(String.class, StrutsConstants.STRUTS_CONFIGURATION_XML_RELOAD));
if (!reloadConfigs) {
// reloadConfigs is false, configuration will do not change, just keep it
ContainerHolder.instance.set(instance);
}
}
public static Container get() {
return ContainerHolder.instance.get();
}
public static void clear() {
ContainerHolder.instance.set(null);
}
}
@@ -37,19 +37,41 @@ import java.net.URL;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;
/**
* <b>Default implementation to server static content</b>
* <p/>
* This class is used to serve common static content needed when using various parts of Struts, such as JavaScript
* files, CSS files, etc. It works by looking for requests to /struts/* (or /static/*), and then mapping the value after "/struts/"
* to common packages in Struts and, optionally, in your class path. By default, the following packages are
* automatically searched:
* <ul>
* <li>org.apache.struts2.static</li>
* <li>template</li>
* <li>static</li>
* </ul>
* <p/> This means that you can simply request /struts/xhtml/styles.css and the XHTML UI theme's default stylesheet
* will be returned. Likewise, many of the AJAX UI components require various JavaScript files, which are found in the
* org.apache.struts2.static package. If you wish to add additional packages to be searched, you can add a comma
* separated (space, tab and new line will do as well) list in the filter init parameter named "packages". <b>Be
* careful</b>, however, to expose any packages that may have sensitive information, such as properties file with
* database access credentials.
* <p/>
*/
public class DefaultStaticContentLoader implements StaticContentLoader {
/**
* Provide a logging instance.
*/
private Logger log;
private Logger LOG = LoggerFactory.getLogger(DefaultStaticContentLoader.class);
/**
* Store set of path prefixes to use with static resources.
*/
protected String[] pathPrefixes;
protected List<String> pathPrefixes;
/**
* Store state of StrutsConstants.STRUTS_SERVE_STATIC_CONTENT setting.
@@ -116,7 +138,6 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
packages = param + " " + packages;
}
this.pathPrefixes = parse(packages);
initLogging(filterConfig);
}
protected String getAdditionalPackages() {
@@ -130,9 +151,9 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
* A comma-delimited String listing packages
* @return A string array of packages
*/
protected String[] parse(String packages) {
protected List<String> parse(String packages) {
if (packages == null) {
return null;
return Collections.emptyList();
}
List<String> pathPrefixes = new ArrayList<String>();
@@ -145,7 +166,7 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
pathPrefixes.add(pathPrefix);
}
return pathPrefixes.toArray(new String[pathPrefixes.size()]);
return pathPrefixes;
}
/*
@@ -192,8 +213,9 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
try {
ifModifiedSince = request.getDateHeader("If-Modified-Since");
} catch (Exception e) {
log.warn("Invalid If-Modified-Since header value: '"
+ request.getHeader("If-Modified-Since") + "', ignoring");
if (LOG.isWarnEnabled()) {
LOG.warn("Invalid If-Modified-Since header value: '#0', ignoring", request.getHeader("If-Modified-Since"));
}
}
long lastModifiedMillis = lastModifiedCal.getTimeInMillis();
long now = cal.getTimeInMillis();
@@ -233,33 +255,9 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
} finally {
is.close();
}
return;
}
}
private void initLogging(HostConfig filterConfig) {
String factoryName = filterConfig.getInitParameter("loggerFactory");
if (factoryName != null) {
try {
Class cls = ClassLoaderUtil.loadClass(factoryName, this.getClass());
LoggerFactory fac = (LoggerFactory)cls.newInstance();
LoggerFactory.setLoggerFactory(fac);
} catch (InstantiationException e) {
System.err.println("Unable to instantiate logger factory: "+factoryName+", using default");
e.printStackTrace();
} catch (IllegalAccessException e) {
System.err.println("Unable to access logger factory: "+factoryName+", using default");
e.printStackTrace();
} catch (ClassNotFoundException e) {
System.err.println("Unable to locate logger factory class: "+factoryName+", using default");
e.printStackTrace();
}
}
log = LoggerFactory.getLogger(FilterDispatcher.class);
}
/**
* Look for a static resource in the classpath.
*
@@ -276,7 +274,6 @@ public class DefaultStaticContentLoader implements StaticContentLoader {
* @param packagePrefix The package prefix to use to locate the resource
* @return full path
* @throws UnsupportedEncodingException
* @throws IOException
*/
protected String buildPath(String name, String packagePrefix) throws UnsupportedEncodingException {
String resourcePath;
@@ -252,7 +252,7 @@ public class Dispatcher {
multipartSaveDir = val;
}
@Inject(StrutsConstants.STRUTS_MULTIPART_HANDLER)
@Inject(StrutsConstants.STRUTS_MULTIPART_PARSER)
public void setMultipartHandler(String val) {
multipartHandlerName = val;
}
@@ -285,7 +285,7 @@ public class Dispatcher {
}
catch(Exception e) {
// catch any exception that may occurred during destroy() and log it
LOG.error("exception occurred while destroying ObjectFactory ["+objectFactory+"]", e);
LOG.error("exception occurred while destroying ObjectFactory [#0]", e, objectFactory.toString());
}
}
@@ -432,6 +432,8 @@ public class Dispatcher {
boolean reloadi18n = Boolean.valueOf(container.getInstance(String.class, StrutsConstants.STRUTS_I18N_RELOAD));
LocalizedTextUtil.setReloadBundles(reloadi18n);
ContainerHolder.store(container);
return container;
}
@@ -679,21 +681,20 @@ public class Dispatcher {
File multipartSaveDir = new File(saveDir);
if (!multipartSaveDir.exists()) {
if (!multipartSaveDir.mkdir()) {
if (!multipartSaveDir.mkdirs()) {
String logMessage;
try {
logMessage = "Could not find create multipart save directory '"+multipartSaveDir.getCanonicalPath()+"'.";
} catch (IOException e) {
logMessage = "Could not find create multipart save directory '"+multipartSaveDir.toString()+"'.";
}
if(devMode) {
try {
logMessage = "Could not find create multipart save directory '" + multipartSaveDir.getCanonicalPath() + "'.";
} catch (IOException e) {
logMessage = "Could not find create multipart save directory '" + multipartSaveDir.toString() + "'.";
}
if (devMode) {
LOG.error(logMessage);
}
else {
} else {
if (LOG.isWarnEnabled()) {
LOG.warn(logMessage);
}
}
}
}
}
}
@@ -773,17 +774,7 @@ public class Dispatcher {
String content_type = request.getContentType();
if (content_type != null && content_type.contains("multipart/form-data")) {
MultiPartRequest mpr = null;
//check for alternate implementations of MultiPartRequest
Set<String> multiNames = getContainer().getInstanceNames(MultiPartRequest.class);
for (String multiName : multiNames) {
if (multiName.equals(multipartHandlerName)) {
mpr = getContainer().getInstance(MultiPartRequest.class, multiName);
}
}
if (mpr == null ) {
mpr = getContainer().getInstance(MultiPartRequest.class);
}
MultiPartRequest mpr = getMultiPartRequest();
LocaleProvider provider = getContainer().getInstance(LocaleProvider.class);
request = new MultiPartRequestWrapper(mpr, request, getSaveDir(servletContext), provider);
} else {
@@ -793,6 +784,27 @@ public class Dispatcher {
return request;
}
/**
* On each request it must return a new instance as implementation could be not thread safe
* and thus ensure of resource clean up
*
* @return
*/
protected MultiPartRequest getMultiPartRequest() {
MultiPartRequest mpr = null;
//check for alternate implementations of MultiPartRequest
Set<String> multiNames = getContainer().getInstanceNames(MultiPartRequest.class);
for (String multiName : multiNames) {
if (multiName.equals(multipartHandlerName)) {
mpr = getContainer().getInstance(MultiPartRequest.class, multiName);
}
}
if (mpr == null ) {
mpr = getContainer().getInstance(MultiPartRequest.class);
}
return mpr;
}
/**
* Removes all the files created by MultiPartRequestWrapper.
*
@@ -908,8 +920,10 @@ public class Dispatcher {
* Modify the ConfigurationManager instance
*
* @param mgr The configuration manager
* @deprecated should be removed as is used only in tests
*/
public void setConfigurationManager(ConfigurationManager mgr) {
ContainerHolder.clear();
this.configurationManager = mgr;
}
@@ -918,6 +932,9 @@ public class Dispatcher {
* @return Our dependency injection container
*/
public Container getContainer() {
if (ContainerHolder.get() != null) {
return ContainerHolder.get();
}
ConfigurationManager mgr = getConfigurationManager();
if (mgr == null) {
throw new IllegalStateException("The configuration manager shouldn't be null");
@@ -926,8 +943,11 @@ public class Dispatcher {
if (config == null) {
throw new IllegalStateException("Unable to load configuration");
} else {
return config.getContainer();
Container container = config.getContainer();
ContainerHolder.store(container);
return container;
}
}
}
}
@@ -26,6 +26,8 @@ import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.ServletActionContext;
import javax.servlet.http.HttpServletResponse;
@@ -35,64 +37,65 @@ import java.util.Map;
/**
* <!-- START SNIPPET: description -->
*
* <p/>
* A custom Result type for setting HTTP headers and status by optionally evaluating against the ValueStack.
* This result can also be used to send and error to the client.
*
* This result can also be used to send and error to the client. All the parameters can be evaluated against the ValueStack.
* <p/>
* <!-- END SNIPPET: description -->
* <p/>
* <b>This result type takes the following parameters:</b>
*
* <p/>
* <!-- START SNIPPET: params -->
*
* <p/>
* <ul>
*
* <p/>
* <li><b>status</b> - the http servlet response status code that should be set on a response.</li>
*
* <p/>
* <li><b>parse</b> - true by default. If set to false, the headers param will not be parsed for Ognl expressions.</li>
*
* <p/>
* <li><b>headers</b> - header values.</li>
*
* <p/>
* <li><b>error</b> - the http servlet response error code that should be set on a response.</li>
*
* <p/>
* <li><b>errorMessage</b> - error message to be set on response if 'error' is set.</li>
* </ul>
*
* <p/>
* <!-- END SNIPPET: params -->
*
* <p/>
* <b>Example:</b>
*
* <p/>
* <pre><!-- START SNIPPET: example -->
* &lt;result name="success" type="httpheader"&gt;
* &lt;param name="status"&gt;204&lt;/param&gt;
* &lt;param name="headers.a"&gt;a custom header value&lt;/param&gt;
* &lt;param name="headers.b"&gt;another custom header value&lt;/param&gt;
* &lt;/result&gt;
*
* <p/>
* &lt;result name="proxyRequired" type="httpheader"&gt;
* &lt;param name="error"&gt;305&lt;/param&gt;
* &lt;param name="errorMessage"&gt;this action must be accessed through a prozy&lt;/param&gt;
* &lt;/result&gt;
* <!-- END SNIPPET: example --></pre>
*
*/
public class HttpHeaderResult implements Result {
private static final long serialVersionUID = 195648957144219214L;
private static final Logger LOG = LoggerFactory.getLogger(HttpHeaderResult.class);
/** The default parameter */
public static final String DEFAULT_PARAM = "status";
/**
* This result type doesn't have a default param, null is ok to reduce noice in logs
*/
public static final String DEFAULT_PARAM = null;
private boolean parse = true;
private Map<String,String> headers;
private Map<String, String> headers;
private int status = -1;
private int error = -1;
private String error = null;
private String errorMessage;
public HttpHeaderResult() {
super();
headers = new HashMap<String,String>();
headers = new HashMap<String, String>();
}
public HttpHeaderResult(int status) {
@@ -101,20 +104,19 @@ public class HttpHeaderResult implements Result {
this.parse = false;
}
/**
* Sets the http servlet error code that should be set on the reponse
*
* Sets the http servlet error code that should be set on the response
*
* @param error the Http error code
* @see javax.servlet.http.HttpServletResponse#sendError(int)
*/
public void setError(int error) {
public void setError(String error) {
this.error = error;
}
/**
* Sets the error message that should be set on the reponse
*
*
* @param errorMessage error message send to the client
* @see javax.servlet.http.HttpServletResponse#sendError(int, String)
*/
@@ -134,7 +136,7 @@ public class HttpHeaderResult implements Result {
/**
* Sets whether or not the HTTP header values should be evaluated against the ValueStack (by default they are).
*
* @param parse <tt>true</tt> if HTTP header values should be evaluated agains the ValueStack, <tt>false</tt>
* @param parse <tt>true</tt> if HTTP header values should be evaluated against the ValueStack, <tt>false</tt>
* otherwise.
*/
public void setParse(boolean parse) {
@@ -157,7 +159,8 @@ public class HttpHeaderResult implements Result {
/**
* Adds an HTTP header to the response
* @param name header name
*
* @param name header name
* @param value header value
*/
public void addHeader(String name, String value) {
@@ -174,24 +177,35 @@ public class HttpHeaderResult implements Result {
public void execute(ActionInvocation invocation) throws Exception {
HttpServletResponse response = ServletActionContext.getResponse();
ValueStack stack = ActionContext.getContext().getValueStack();
if (status != -1) {
response.setStatus(status);
} else if (error != -1) {
if (errorMessage != null) {
String finalMessage = parse ? TextParseUtil.translateVariables(
errorMessage, stack) : errorMessage;
response.sendError(error, finalMessage);
} else
response.sendError(error);
}
if (headers != null) {
for (Map.Entry<String, String> stringStringEntry : headers.entrySet()) {
Map.Entry entry = (Map.Entry) stringStringEntry;
String value = (String) entry.getValue();
for (Map.Entry<String, String> entry : headers.entrySet()) {
String value = entry.getValue();
String finalValue = parse ? TextParseUtil.translateVariables(value, stack) : value;
response.addHeader((String) entry.getKey(), finalValue);
response.addHeader(entry.getKey(), finalValue);
}
}
if (status == -1 && error != null) {
int errorCode = -1;
try {
errorCode = Integer.parseInt(parse ? TextParseUtil.translateVariables(error, stack) : error);
} catch (Exception e) {
if (LOG.isErrorEnabled()) {
LOG.error("Cannot parse errorCode [#0] value as Integer!", e, error);
}
}
if (errorCode != -1) {
if (errorMessage != null) {
String finalMessage = parse ? TextParseUtil.translateVariables(errorMessage, stack) : errorMessage;
response.sendError(errorCode, finalMessage);
} else {
response.sendError(errorCode);
}
}
}
}
@@ -198,8 +198,9 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
if (resultConfig != null) {
Map<String, String> resultConfigParams = resultConfig.getParams();
List<String> prohibitedResultParams = getProhibitedResultParams();
for (Map.Entry<String, String> e : resultConfigParams.entrySet()) {
if (!getProhibitedResultParams().contains(e.getKey())) {
if (!prohibitedResultParams.contains(e.getKey())) {
String potentialValue = e.getValue() == null ? "" : conditionalParse(e.getValue(), invocation);
if (!suppressEmptyParameters || ((potentialValue != null) && (potentialValue.length() > 0))) {
requestParameters.put(e.getKey(), potentialValue);
@@ -227,7 +228,18 @@ public class ServletRedirectResult extends StrutsResultSupport implements Reflec
}
protected List<String> getProhibitedResultParams() {
return Arrays.asList(DEFAULT_PARAM, "namespace", "method", "encode", "parse", "location", "prependServletContext", "suppressEmptyParameters", "anchor");
return Arrays.asList(
DEFAULT_PARAM,
"namespace",
"method",
"encode",
"parse",
"location",
"prependServletContext",
"suppressEmptyParameters",
"anchor",
"statusCode"
);
}
/**
@@ -20,15 +20,20 @@
*/
package org.apache.struts2.dispatcher;
import java.io.IOException;
import org.apache.struts2.dispatcher.ng.HostConfig;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts2.dispatcher.ng.HostConfig;
import java.io.IOException;
/**
* Interface for loading static resources, based on a path
* Interface for loading static resources, based on a path. After implementing your own static content loader
* you must tell the framework how to use it, eg.
*
* &lt;bean name="myContentLoader" type="org.apache.struts2.dispatcher" class="com.company.struts.MyContentLoader"/&gt;
* &lt;constant name="struts.staticContentLoader" value="myContentLoader"/&gt;
*
* Check {@link org.apache.struts2.config.BeanSelectionProvider} for more details.
*/
public interface StaticContentLoader {
@@ -197,13 +197,13 @@ public abstract class StrutsResultSupport implements Result, StrutsStatics {
if (parse && param != null && invocation != null) {
return TextParseUtil.translateVariables(param, invocation.getStack(),
new TextParseUtil.ParsedValueEvaluator() {
public Object evaluate(Object parsedValue) {
public Object evaluate(String parsedValue) {
if (encode) {
if (parsedValue != null) {
try {
// use UTF-8 as this is the recommended encoding by W3C to
// avoid incompatibilities.
return URLEncoder.encode(parsedValue.toString(), "UTF-8");
return URLEncoder.encode(parsedValue, "UTF-8");
}
catch(UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
@@ -159,15 +159,15 @@ public class VelocityResult extends StrutsResultSupport {
// to do it all the time (WW-829). Since Velocity support is being deprecated, we'll oblige :)
writer.flush();
} catch (Exception e) {
LOG.error("Unable to render Velocity Template, '" + finalLocation + "'", e);
if (LOG.isErrorEnabled()) {
LOG.error("Unable to render Velocity Template, '#0'", e, finalLocation);
}
throw e;
} finally {
if (usedJspFactory) {
jspFactory.releasePageContext(pageContext);
}
}
return;
}
/**
@@ -21,18 +21,16 @@
package org.apache.struts2.dispatcher.mapper;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.StrutsConstants;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
/**
* <!-- START SNIPPET: description -->
@@ -88,12 +86,11 @@ public class CompositeActionMapper implements ActionMapper {
protected Container container;
protected List<ActionMapper> actionMappers = new ArrayList<ActionMapper>();
@Inject
public void setContainer(Container container) {
public CompositeActionMapper(@Inject Container container) {
this.container = container;
}
@Inject(StrutsConstants.STRUTS_MAPPER_COMPOSITE)
public void setActionMappers(String list) {
if (list != null) {
@@ -27,6 +27,7 @@ import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import org.apache.struts2.RequestUtils;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsConstants;
@@ -37,7 +38,6 @@ import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -163,19 +163,13 @@ import java.util.Set;
public class DefaultActionMapper implements ActionMapper {
protected static final String METHOD_PREFIX = "method:";
protected static final String ACTION_PREFIX = "action:";
protected static final String REDIRECT_PREFIX = "redirect:";
protected static final String REDIRECT_ACTION_PREFIX = "redirectAction:";
protected boolean allowDynamicMethodCalls = true;
protected boolean allowSlashesInActionNames = false;
protected boolean alwaysSelectFullNamespace = false;
protected PrefixTrie prefixTrie = null;
protected List<String> extensions = new ArrayList<String>() {{
@@ -292,14 +286,16 @@ public class DefaultActionMapper implements ActionMapper {
return parseActionName(mapping);
}
public boolean isSlashesInActionNames() {
return allowSlashesInActionNames;
}
/*
* (non-Javadoc)
*
* @see org.apache.struts2.dispatcher.mapper.ActionMapper#getMapping(javax.servlet.http.HttpServletRequest)
*/
public ActionMapping getMapping(HttpServletRequest request,
ConfigurationManager configManager) {
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
ActionMapping mapping = new ActionMapping();
String uri = getUri(request);
@@ -312,21 +308,13 @@ public class DefaultActionMapper implements ActionMapper {
}
parseNameAndNamespace(uri, mapping, configManager);
handleSpecialParameters(request, mapping);
if (mapping.getName() == null) {
return null;
}
parseActionName(mapping);
return mapping;
return parseActionName(mapping);
}
protected ActionMapping parseActionName(ActionMapping mapping) {
if (mapping.getName() == null) {
return mapping;
return null;
}
if (allowDynamicMethodCalls) {
// handle "name!method" convention.
@@ -348,14 +336,12 @@ public class DefaultActionMapper implements ActionMapper {
* @param request The request
* @param mapping The action mapping
*/
public void handleSpecialParameters(HttpServletRequest request,
ActionMapping mapping) {
public void handleSpecialParameters(HttpServletRequest request, ActionMapping mapping) {
// handle special parameter prefixes.
Set<String> uniqueParameters = new HashSet<String>();
Map parameterMap = request.getParameterMap();
for (Iterator iterator = parameterMap.keySet().iterator(); iterator
.hasNext();) {
String key = (String) iterator.next();
for (Object o : parameterMap.keySet()) {
String key = (String) o;
// Strip off the image button location info, if found
if (key.endsWith(".x") || key.endsWith(".y")) {
@@ -364,8 +350,7 @@ public class DefaultActionMapper implements ActionMapper {
// Ensure a parameter doesn't get processed twice
if (!uniqueParameters.contains(key)) {
ParameterAction parameterAction = (ParameterAction) prefixTrie
.get(key);
ParameterAction parameterAction = (ParameterAction) prefixTrie.get(key);
if (parameterAction != null) {
parameterAction.execute(key, mapping);
uniqueParameters.add(key);
@@ -381,8 +366,7 @@ public class DefaultActionMapper implements ActionMapper {
* @param uri The uri
* @param mapping The action mapping to populate
*/
protected void parseNameAndNamespace(String uri, ActionMapping mapping,
ConfigurationManager configManager) {
protected void parseNameAndNamespace(String uri, ActionMapping mapping, ConfigurationManager configManager) {
String namespace, name;
int lastSlash = uri.lastIndexOf("/");
if (lastSlash == -1) {
@@ -425,7 +409,7 @@ public class DefaultActionMapper implements ActionMapper {
}
}
if (!allowSlashesInActionNames && name != null) {
if (!allowSlashesInActionNames) {
int pos = name.lastIndexOf('/');
if (pos > -1 && pos < name.length() - 1) {
name = name.substring(pos + 1);
@@ -441,7 +425,7 @@ public class DefaultActionMapper implements ActionMapper {
*
* @param name The action name
* @return The action name without its extension
* @deprecated Since 2.1, use {@link #dropExtension(java.lang.String,org.apache.struts2.dispatcher.mapper.ActionMapping)} instead
* @deprecated Since 2.1, use {@link #dropExtension(java.lang.String, org.apache.struts2.dispatcher.mapper.ActionMapping)} instead
*/
protected String dropExtension(String name) {
return dropExtension(name, new ActionMapping());
@@ -486,7 +470,7 @@ public class DefaultActionMapper implements ActionMapper {
if (extensions == null) {
return null;
} else {
return (String) extensions.get(0);
return extensions.get(0);
}
}
@@ -518,29 +502,64 @@ public class DefaultActionMapper implements ActionMapper {
*
* @see org.apache.struts2.dispatcher.mapper.ActionMapper#getUriFromActionMapping(org.apache.struts2.dispatcher.mapper.ActionMapping)
*/
public String getUriFromActionMapping(ActionMapping mapping) {
StringBuilder uri = new StringBuilder();
handleNamespace(mapping, uri);
handleName(mapping, uri);
handleDynamicMethod(mapping, uri);
handleExtension(mapping, uri);
handleParams(mapping, uri);
return uri.toString();
}
protected void handleNamespace(ActionMapping mapping, StringBuilder uri) {
if (mapping.getNamespace() != null) {
uri.append(mapping.getNamespace());
if (!"/".equals(mapping.getNamespace())) {
uri.append("/");
}
}
}
protected void handleName(ActionMapping mapping, StringBuilder uri) {
String name = mapping.getName();
String params = "";
if (name.indexOf('?') != -1) {
params = name.substring(name.indexOf('?'));
name = name.substring(0, name.indexOf('?'));
}
uri.append(name);
}
if (null != mapping.getMethod() && !"".equals(mapping.getMethod())) {
uri.append("!").append(mapping.getMethod());
protected void handleDynamicMethod(ActionMapping mapping, StringBuilder uri) {
// See WW-3965
if (StringUtils.isNotEmpty(mapping.getMethod())) {
if (allowDynamicMethodCalls) {
// handle "name!method" convention.
String name = mapping.getName();
if (!name.contains("!")) {
// Append the method as no bang found
uri.append("!").append(mapping.getMethod());
}
} else {
uri.append("!").append(mapping.getMethod());
}
}
}
String extension = mapping.getExtension();
protected void handleExtension(ActionMapping mapping, StringBuilder uri) {
String extension = lookupExtension(mapping.getExtension());
if (extension != null) {
if (extension.length() == 0 || (extension.length() > 0 && uri.indexOf('.' + extension) == -1)) {
if (extension.length() > 0) {
uri.append(".").append(extension);
}
}
}
}
protected String lookupExtension(String extension) {
if (extension == null) {
// Look for the current extension, if available
ActionContext context = ActionContext.getContext();
@@ -554,24 +573,18 @@ public class DefaultActionMapper implements ActionMapper {
extension = getDefaultExtension();
}
}
return extension;
}
if (extension != null) {
if (extension.length() == 0 || (extension.length() > 0 && uri.indexOf('.' + extension) == -1)) {
if (extension.length() > 0) {
uri.append(".").append(extension);
}
}
protected void handleParams(ActionMapping mapping, StringBuilder uri) {
String name = mapping.getName();
String params = "";
if (name.indexOf('?') != -1) {
params = name.substring(name.indexOf('?'));
}
if (params.length() > 0) {
uri.append(params);
}
return uri.toString();
}
public boolean isSlashesInActionNames() {
return allowSlashesInActionNames;
}
}
@@ -3,8 +3,8 @@ package org.apache.struts2.dispatcher.mapper;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import javax.servlet.http.HttpServletRequest;
@@ -14,7 +14,7 @@ import java.util.Map;
/**
* <!-- START SNIPPET: description -->
*
*
* A prefix based action mapper that is capable of delegating to other {@link ActionMapper}s based on the request's prefix
*
* It is configured through struts.xml
@@ -37,98 +37,100 @@ import java.util.Map;
*
* @see ActionMapper
* @see ActionMapping
*
*/
public class PrefixBasedActionMapper extends DefaultActionMapper implements ActionMapper {
protected transient final Log log = LogFactory.getLog(getClass());
protected Container container;
protected Map<String,ActionMapper> actionMappers = new HashMap<String,ActionMapper>();
@Inject
public void setContainer(Container container) {
this.container = container;
}
private static final Logger LOG = LoggerFactory.getLogger(PrefixBasedActionMapper.class);
@Inject(StrutsConstants.PREFIX_BASED_MAPPER_CONFIGURATION)
public void setPrefixBasedActionMappers(String list) {
if (list != null) {
String[] mappers = list.split(",");
for (String mapper : mappers) {
String[] thisMapper = mapper.split(":");
if ((thisMapper != null) && (thisMapper.length == 2)) {
String mapperPrefix = thisMapper[0].trim();
String mapperName = thisMapper[1].trim();
Object obj = container.getInstance(ActionMapper.class, mapperName);
if (obj != null) {
actionMappers.put(mapperPrefix, (ActionMapper) obj);
} else if (log.isDebugEnabled()) {
log.debug("invalid PrefixBasedActionMapper config entry: " + mapper);
}
}
}
protected Container container;
protected Map<String, ActionMapper> actionMappers = new HashMap<String, ActionMapper>();
@Inject
public void setContainer(Container container) {
this.container = container;
}
}
@SuppressWarnings("unchecked")
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
String uri = getUri(request);
for (int lastIndex = uri.lastIndexOf('/'); lastIndex > (-1); lastIndex = uri.lastIndexOf('/', lastIndex-1)) {
ActionMapper actionMapper = actionMappers.get(uri.substring(0,lastIndex));
if (actionMapper != null) {
ActionMapping actionMapping = actionMapper.getMapping(request, configManager);
if (log.isDebugEnabled()) {
log.debug("Using ActionMapper "+actionMapper);
}
if (actionMapping != null) {
if (log.isDebugEnabled()) {
if (actionMapping.getParams() != null) {
log.debug("ActionMapper found mapping. Parameters: "+actionMapping.getParams());
for (Map.Entry<String,Object> mappingParameterEntry : ((Map<String,Object>)(actionMapping.getParams())).entrySet()) {
Object paramValue = mappingParameterEntry.getValue();
if (paramValue == null) {
log.debug(mappingParameterEntry.getKey()+" : null!");
} else if (paramValue instanceof String[]) {
log.debug(mappingParameterEntry.getKey()+" : (String[]) "+Arrays.toString((String[])paramValue));
} else if (paramValue instanceof String) {
log.debug(mappingParameterEntry.getKey()+" : (String) "+(String)paramValue);
} else {
log.debug(mappingParameterEntry.getKey()+" : (Object) "+(paramValue.toString()));
@Inject(StrutsConstants.PREFIX_BASED_MAPPER_CONFIGURATION)
public void setPrefixBasedActionMappers(String list) {
if (list != null) {
String[] mappers = list.split(",");
for (String mapper : mappers) {
String[] thisMapper = mapper.split(":");
if ((thisMapper != null) && (thisMapper.length == 2)) {
String mapperPrefix = thisMapper[0].trim();
String mapperName = thisMapper[1].trim();
Object obj = container.getInstance(ActionMapper.class, mapperName);
if (obj != null) {
actionMappers.put(mapperPrefix, (ActionMapper) obj);
} else if (LOG.isDebugEnabled()) {
LOG.debug("invalid PrefixBasedActionMapper config entry: [#0]", mapper);
}
}
}
}
}
return actionMapping;
} else if (log.isDebugEnabled()) {
log.debug("ActionMapper "+actionMapper+" failed to return an ActionMapping");
}
}
}
if (log.isDebugEnabled()) {
log.debug("no ActionMapper found");
}
return null;
}
public String getUriFromActionMapping(ActionMapping mapping) {
String namespace = mapping.getNamespace();
for (int lastIndex = namespace.length(); lastIndex > (-1); lastIndex = namespace.lastIndexOf('/', lastIndex-1)) {
ActionMapper actionMapper = actionMappers.get(namespace.substring(0,lastIndex));
if (actionMapper != null) {
String uri = actionMapper.getUriFromActionMapping(mapping);
if (log.isDebugEnabled()) {
log.debug("Using ActionMapper "+actionMapper);
@SuppressWarnings("unchecked")
public ActionMapping getMapping(HttpServletRequest request, ConfigurationManager configManager) {
String uri = getUri(request);
for (int lastIndex = uri.lastIndexOf('/'); lastIndex > (-1); lastIndex = uri.lastIndexOf('/', lastIndex - 1)) {
ActionMapper actionMapper = actionMappers.get(uri.substring(0, lastIndex));
if (actionMapper != null) {
ActionMapping actionMapping = actionMapper.getMapping(request, configManager);
if (LOG.isDebugEnabled()) {
LOG.debug("Using ActionMapper [#0]", actionMapper.toString());
}
if (actionMapping != null) {
if (LOG.isDebugEnabled()) {
if (actionMapping.getParams() != null) {
LOG.debug("ActionMapper found mapping. Parameters: [#0]", actionMapping.getParams().toString());
for (Map.Entry<String, Object> mappingParameterEntry : actionMapping.getParams().entrySet()) {
Object paramValue = mappingParameterEntry.getValue();
if (paramValue == null) {
LOG.debug("[#0] : null!", mappingParameterEntry.getKey());
} else if (paramValue instanceof String[]) {
LOG.debug("[#0] : (String[]) #1", mappingParameterEntry.getKey(), Arrays.toString((String[]) paramValue));
} else if (paramValue instanceof String) {
LOG.debug("[#0] : (String) [#1]", mappingParameterEntry.getKey(), paramValue.toString());
} else {
LOG.debug("[#0] : (Object) [#1]", mappingParameterEntry.getKey(), paramValue.toString());
}
}
}
}
return actionMapping;
} else if (LOG.isDebugEnabled()) {
LOG.debug("ActionMapper [#0] failed to return an ActionMapping", actionMapper.toString());
}
}
}
if (uri != null) {
return uri;
} else if (log.isDebugEnabled()) {
log.debug("ActionMapper "+actionMapper+" failed to return an ActionMapping (null)");
if (LOG.isDebugEnabled()) {
LOG.debug("No ActionMapper found");
}
}
return null;
}
if (log.isDebugEnabled()) {
log.debug("ActionMapper failed to return a uri");
public String getUriFromActionMapping(ActionMapping mapping) {
String namespace = mapping.getNamespace();
for (int lastIndex = namespace.length(); lastIndex > (-1); lastIndex = namespace.lastIndexOf('/', lastIndex - 1)) {
ActionMapper actionMapper = actionMappers.get(namespace.substring(0, lastIndex));
if (actionMapper != null) {
String uri = actionMapper.getUriFromActionMapping(mapping);
if (LOG.isDebugEnabled()) {
LOG.debug("Using ActionMapper [#0]", actionMapper.toString());
}
if (uri != null) {
return uri;
} else if (LOG.isDebugEnabled()) {
LOG.debug("ActionMapper [#0] failed to return an ActionMapping (null)", actionMapper.toString());
}
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("ActionMapper failed to return a uri");
}
return null;
}
return null;
}
}
@@ -21,77 +21,20 @@
package org.apache.struts2.dispatcher.mapper;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.StringTokenizer;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.StrutsConstants;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsConstants;
import javax.servlet.http.HttpServletRequest;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.StringTokenizer;
/**
* <!-- START SNIPPET: description -->
*
* Improved restful action mapper that adds several ReST-style improvements to
* action mapping, but supports fully-customized URL's via XML. The two primary
* ReST enhancements are:
* <ul>
* <li>If the method is not specified (via '!' or 'method:' prefix), the method is
* "guessed" at using ReST-style conventions that examine the URL and the HTTP
* method.</li>
* <li>Parameters are extracted from the action name, if parameter name/value pairs
* are specified using PARAM_NAME/PARAM_VALUE syntax.
* </ul>
* <p>
* These two improvements allow a GET request for 'category/action/movie/Thrillers' to
* be mapped to the action name 'movie' with an id of 'Thrillers' with an extra parameter
* named 'category' with a value of 'action'. A single action mapping can then handle
* all CRUD operations using wildcards, e.g.
* </p>
* <pre>
* &lt;action name="movie/*" className="app.MovieAction"&gt;
* &lt;param name="id"&gt;{0}&lt;/param&gt;
* ...
* &lt;/action&gt;
* </pre>
* <p>
* This mapper supports the following parameters:
* </p>
* <ul>
* <li><code>struts.mapper.idParameterName</code> - If set, this value will be the name
* of the parameter under which the id is stored. The id will then be removed
* from the action name. This allows restful actions to not require wildcards.
* </li>
* </ul>
* <p>
* The following URL's will invoke its methods:
* </p>
* <ul>
* <li><code>GET: /movie/ => method="index"</code></li>
* <li><code>GET: /movie/Thrillers => method="view", id="Thrillers"</code></li>
* <li><code>GET: /movie/Thrillers!edit => method="edit", id="Thrillers"</code></li>
* <li><code>GET: /movie/new => method="editNew"</code></li>
* <li><code>POST: /movie/ => method="create"</code></li>
* <li><code>PUT: /movie/Thrillers => method="update", id="Thrillers"</code></li>
* <li><code>DELETE: /movie/Thrillers => method="remove", id="Thrillers"</code></li>
* </ul>
* <p>
* To simulate the HTTP methods PUT and DELETE, since they aren't supported by HTML,
* the HTTP parameter "__http_method" will be used.
* </p>
* <p>
* The syntax and design for this feature was inspired by the ReST support in Ruby on Rails.
* See <a href="http://ryandaigle.com/articles/2006/08/01/whats-new-in-edge-rails-simply-restful-support-and-how-to-use-it">
* http://ryandaigle.com/articles/2006/08/01/whats-new-in-edge-rails-simply-restful-support-and-how-to-use-it
* </a>
* </p>
*
* <!-- END SNIPPET: description -->
* Extended version of {@link RestfulActionMapper}, see documentation for more details
* http://struts.apache.org/2.x/docs/restfulactionmapper.html
*/
public class Restful2ActionMapper extends DefaultActionMapper {
@@ -102,7 +45,6 @@ public class Restful2ActionMapper extends DefaultActionMapper {
public Restful2ActionMapper() {
setSlashesInActionNames("true");
}
/*
* (non-Javadoc)
@@ -21,47 +21,21 @@
package org.apache.struts2.dispatcher.mapper;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.StringTokenizer;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.RequestUtils;
import com.opensymphony.xwork2.config.ConfigurationManager;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.RequestUtils;
import javax.servlet.http.HttpServletRequest;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;
import java.util.StringTokenizer;
/**
* <!-- START SNIPPET: description -->
*
* A custom action mapper using the following format:
* <p/>
* <p/>
* <ul><tt>http://HOST/ACTION_NAME/PARAM_NAME1/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2</tt></ul>
* <p/>
* You can have as many parameters you'd like to use. Alternatively the URL can be shortened to the following:
* <p/>
* <ul><tt>http://HOST/ACTION_NAME/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2</tt></ul>
* <p/>
* This is the same as:
* <p/>
* <ul><tt>http://HOST/ACTION_NAME/ACTION_NAME + "Id"/PARAM_VALUE1/PARAM_NAME2/PARAM_VALUE2</tt></ul>
* <p/>
* Suppose for example we would like to display some articles by id at using the following URL sheme:
* <p/>
* <ul><tt>http://HOST/article/Id</tt></ul>
* <p/>
* <p/>
* Your action just needs a setArticleId() method, and requests such as /article/1, /article/2, etc will all map
* to that URL pattern.
*
* <!-- END SNIPPET: description -->
*
* Simple Restfull Action Mapper to support REST application
* See docs for more information
* http://struts.apache.org/2.x/docs/restfulactionmapper.html
*/
public class RestfulActionMapper implements ActionMapper {
protected static final Logger LOG = LoggerFactory.getLogger(RestfulActionMapper.class);
@@ -133,8 +133,7 @@ public class PrepareOperations {
// parameters might not be accessible through before encoding (ww-1278)
request = dispatcher.wrapRequest(request, servletContext);
} catch (IOException e) {
String message = "Could not wrap servlet request with MultipartRequestWrapper!";
throw new ServletException(message, e);
throw new ServletException("Could not wrap servlet request with MultipartRequestWrapper!", e);
}
return request;
}
@@ -58,12 +58,13 @@ public class CheckboxInterceptor extends AbstractInterceptor {
private static final Logger LOG = LoggerFactory.getLogger(CheckboxInterceptor.class);
public String intercept(ActionInvocation ai) throws Exception {
Map parameters = ai.getInvocationContext().getParameters();
Map<String, Object> parameters = ai.getInvocationContext().getParameters();
Map<String, String[]> newParams = new HashMap<String, String[]>();
Set<Map.Entry> entries = parameters.entrySet();
for (Iterator<Map.Entry> iterator = entries.iterator(); iterator.hasNext();) {
Map.Entry entry = iterator.next();
String key = (String)entry.getKey();
Set<Map.Entry<String, Object>> entries = parameters.entrySet();
for (Iterator<Map.Entry<String, Object>> iterator = entries.iterator(); iterator.hasNext();) {
Map.Entry<String, Object> entry = iterator.next();
String key = entry.getKey();
if (key.startsWith("__checkbox_")) {
String name = key.substring("__checkbox_".length());
@@ -20,16 +20,14 @@
*/
package org.apache.struts2.interceptor;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
/**
* Just as the CheckboxInterceptor checks that if only the hidden field is present, so too does this interceptor. If
* the "__multiselect_" request parameter is present and its visible counterpart is not, set a new request parameter to an
@@ -49,7 +47,7 @@ public class MultiselectInterceptor extends AbstractInterceptor {
* @see com.opensymphony.xwork2.interceptor.Interceptor#intercept(com.opensymphony.xwork2.ActionInvocation)
*/
public String intercept(ActionInvocation actionInvocation) throws Exception {
Map parameters = actionInvocation.getInvocationContext().getParameters();
Map<String, Object> parameters = actionInvocation.getInvocationContext().getParameters();
Map<String, Object> newParams = new HashMap<String, Object>();
Set<String> keys = parameters.keySet();
@@ -74,4 +72,5 @@ public class MultiselectInterceptor extends AbstractInterceptor {
return actionInvocation.invoke();
}
}
@@ -117,7 +117,9 @@ public class StrutsUtil {
return responseWrapper.getData();
}
catch (Exception e) {
e.printStackTrace();
if (LOG.isDebugEnabled()) {
LOG.debug("Cannot include #0", e, aName.toString());
}
throw e;
}
}
@@ -126,6 +128,9 @@ public class StrutsUtil {
try {
return URLEncoder.encode(s, "UTF-8");
} catch (UnsupportedEncodingException e) {
if (LOG.isDebugEnabled()) {
LOG.debug("Cannot encode URL [#0]", e, s);
}
return s;
}
}
@@ -21,14 +21,14 @@
package org.apache.struts2.util;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* A bean that takes an iterator and outputs a subset of it.
@@ -168,7 +168,8 @@ public class SubsetIteratorFilter extends IteratorFilterSupport implements Itera
}
catch(Exception e) {
if (LOG.isWarnEnabled()) {
LOG.warn("decider ["+decider+"] encountered an error while decide adding element ["+element+"], element will be ignored, it will not appeared in subseted iterator", e);
LOG.warn("Decider [#0] encountered an error while decide adding element [#1], element will be ignored, it will not appeared in subseted iterator",
e, decider.toString(), element.toString());
}
return false;
}
@@ -21,15 +21,15 @@
package org.apache.struts2.util;
import java.math.BigInteger;
import java.util.Map;
import java.util.Random;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.util.LocalizedTextUtil;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import java.math.BigInteger;
import java.util.Map;
import java.util.Random;
/**
* TokenHelper
*
@@ -90,8 +90,10 @@ public class TokenHelper {
session.put(buildTokenSessionAttributeName(tokenName), token);
} catch ( IllegalStateException e ) {
// WW-1182 explain to user what the problem is
String msg = "Error creating HttpSession due response is commited to client. You can use the CreateSessionInterceptor or create the HttpSession from your action before the result is rendered to the client: " + e.getMessage();
LOG.error(msg, e);
String msg = "Error creating HttpSession due response is commited to client. You can use the CreateSessionInterceptor or create the HttpSession from your action before the result is rendered to the client: " + e.getMessage();
if (LOG.isErrorEnabled()) {
LOG.error(msg, e);
}
throw new IllegalArgumentException(msg);
}
}
@@ -2,12 +2,14 @@ package org.apache.struts2.util.fs;
import com.opensymphony.xwork2.util.fs.DefaultFileManager;
import com.opensymphony.xwork2.util.fs.FileRevision;
import com.opensymphony.xwork2.util.fs.JarEntryRevision;
import com.opensymphony.xwork2.util.fs.Revision;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
@@ -44,7 +46,9 @@ public class JBossFileManager extends DefaultFileManager {
Class.forName(VFS_JBOSS5);
return true;
} catch (ClassNotFoundException e) {
LOG.debug("Cannot load [#0] class, not a JBoss 5!", VFS_JBOSS7);
if (LOG.isDebugEnabled()) {
LOG.debug("Cannot load [#0] class, not a JBoss 5!", VFS_JBOSS5);
}
return false;
}
}
@@ -54,7 +58,9 @@ public class JBossFileManager extends DefaultFileManager {
Class.forName(VFS_JBOSS7);
return true;
} catch (ClassNotFoundException e) {
LOG.debug("Cannot load [#0] class, not a JBoss 7!", VFS_JBOSS7);
if (LOG.isDebugEnabled()) {
LOG.debug("Cannot load [#0] class, not a JBoss 7!", VFS_JBOSS7);
}
return false;
}
}
@@ -66,7 +72,18 @@ public class JBossFileManager extends DefaultFileManager {
if (LOG.isDebugEnabled()) {
LOG.debug("Creating revision for URL: " + fileName);
}
Revision revision = FileRevision.build(normalizeToFileProtocol(fileUrl));
URL normalizedUrl = normalizeToFileProtocol(fileUrl);
if (LOG.isDebugEnabled()) {
LOG.debug("Normalized URL for [#0] is [#1]", fileName, normalizedUrl.toString());
}
Revision revision;
if ("file".equals(normalizedUrl.getProtocol())) {
revision = FileRevision.build(normalizedUrl);
} else if ("jar".equals(normalizedUrl.getProtocol())) {
revision = JarEntryRevision.build(normalizedUrl);
} else {
revision = Revision.build(normalizedUrl);
}
files.put(fileName, revision);
} else {
super.monitorFile(fileUrl);
@@ -79,7 +96,9 @@ public class JBossFileManager extends DefaultFileManager {
try {
return getJBossPhysicalUrl(url);
} catch (IOException e) {
LOG.error(e.getMessage(), e);
if (LOG.isErrorEnabled()) {
LOG.error(e.getMessage(), e);
}
return null;
}
} else {
@@ -116,46 +135,75 @@ public class JBossFileManager extends DefaultFileManager {
*/
protected URL getJBossPhysicalUrl(URL url) throws IOException {
Object content = url.openConnection().getContent();
try {
String s = content.getClass().toString();
if (s.startsWith("class org.jboss.vfs.VirtualFile")) { // JBoss 7 and probably 6
File physicalFile = readJBossPhysicalFile(content);
return physicalFile.toURI().toURL();
} else if (s.startsWith("class org.jboss.virtual.VirtualFile")) { // JBoss 5
String fileName = url.toExternalForm();
return new URL("file", null, fileName.substring(fileName.indexOf(":") + 1));
}
} catch (Exception e) {
LOG.warn("Error calling getPhysicalFile() on JBoss VirtualFile.", e);
String classContent = content.getClass().toString();
if (LOG.isDebugEnabled()) {
LOG.debug("Reading physical URL for [#0]", url.toString());
}
if (classContent.startsWith("class org.jboss.vfs.VirtualFile")) { // JBoss 7 and probably 6
File physicalFile = readJBossPhysicalFile(content);
return physicalFile.toURI().toURL();
} else if (classContent.startsWith("class org.jboss.virtual.VirtualFile")) { // JBoss 5
return readJBoss5Url(content);
}
return url;
}
private File readJBossPhysicalFile(Object content) throws Exception {
Method method = content.getClass().getDeclaredMethod("getPhysicalFile");
return (File) method.invoke(content);
}
private List<URL> getAllJBossPhysicalUrls(URL url) throws IOException {
List<URL> urls = new ArrayList<URL>();
Object content = url.openConnection().getContent();
try {
if (content.getClass().toString().startsWith("class org.jboss.vfs.VirtualFile")) {
File physicalFile = readJBossPhysicalFile(content);
String classContent = content.getClass().toString();
if (classContent.startsWith("class org.jboss.vfs.VirtualFile")) {
File physicalFile = readJBossPhysicalFile(content);
if (physicalFile != null) {
readFile(urls, physicalFile);
readFile(urls, physicalFile.getParentFile());
} else {
urls.add(url);
}
} catch (Exception e) {
LOG.warn("Error calling getPhysicalFile() on JBoss VirtualFile!", e);
} else if (classContent.startsWith("class org.jboss.virtual.VirtualFile")) {
URL physicalUrl = readJBoss5Url(content);
if (physicalUrl != null) {
urls.add(physicalUrl);
}
} else {
urls.add(url);
}
return urls;
}
private File readJBossPhysicalFile(Object content) {
try {
Method method = content.getClass().getDeclaredMethod("getPhysicalFile");
return (File) method.invoke(content);
} catch (NoSuchMethodException e) {
LOG.error("Provided class content [#0] is not a JBoss VirtualFile, getPhysicalFile() method not found!", e, content.getClass().getSimpleName());
} catch (InvocationTargetException e) {
LOG.error("Cannot invoke getPhysicalFile() method!", e);
} catch (IllegalAccessException e) {
LOG.error("Cannot access getPhysicalFile() method!", e);
}
return null;
}
private URL readJBoss5Url(Object content) {
try {
Method method = content.getClass().getDeclaredMethod("getHandler");
method.setAccessible(true);
Object handler = method.invoke(content);
method = handler.getClass().getMethod("getRealURL");
return (URL) method.invoke(handler);
} catch (NoSuchMethodException e) {
LOG.error("Provided class content [#0] is not a JBoss VirtualFile, getHandler() or getRealURL() method not found!", e, content.getClass().getSimpleName());
} catch (InvocationTargetException e) {
LOG.error("Cannot invoke getHandler() or getRealURL() method!", e);
} catch (IllegalAccessException e) {
LOG.error("Cannot access getHandler() or getRealURL() method!", e);
}
return null;
}
private void readFile(List<URL> urls, File physicalFile) throws MalformedURLException {
if (physicalFile.isDirectory()) {
for (File file : physicalFile.listFiles()) {
File[] files = physicalFile.listFiles();
if (physicalFile.isDirectory() && files != null) {
for (File file : files) {
if (file.isFile()) {
addIfAbsent(urls, file.toURI().toURL());
} else if (file.isDirectory()) {
@@ -253,7 +253,9 @@ public class FreemarkerManager {
try {
init(servletContext);
} catch (TemplateException e) {
LOG.error("Cannot load freemarker configuration: ",e);
if (LOG.isErrorEnabled()) {
LOG.error("Cannot load freemarker configuration: ",e);
}
}
// config = createConfiguration(servletContext);
@@ -409,7 +411,9 @@ public class FreemarkerManager {
}
}
} catch (IOException e) {
LOG.error("Invalid template path specified: " + e.getMessage(), e);
if (LOG.isErrorEnabled()) {
LOG.error("Invalid template path specified: #0", e, e.getMessage());
}
}
// presume that most apps will require the class and webapp template loader
@@ -459,9 +463,13 @@ public class FreemarkerManager {
}
}
} catch (IOException e) {
LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
if (LOG.isErrorEnabled()) {
LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
}
} catch (TemplateException e) {
LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
if (LOG.isErrorEnabled()) {
LOG.error("Error while loading freemarker settings from /freemarker.properties", e);
}
} finally {
if (in != null) {
try {
@@ -26,6 +26,8 @@ import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.LocaleProvider;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import freemarker.template.Configuration;
import freemarker.template.ObjectWrapper;
import freemarker.template.Template;
@@ -103,6 +105,8 @@ public class FreemarkerResult extends StrutsResultSupport {
private static final long serialVersionUID = -3778230771704661631L;
private static final Logger LOG = LoggerFactory.getLogger(FreemarkerResult.class);
protected ActionInvocation invocation;
protected Configuration configuration;
protected ObjectWrapper wrapper;
@@ -191,6 +195,16 @@ public class FreemarkerResult extends StrutsResultSupport {
parentCharArrayWriter.flush();
parentCharArrayWriter.writeTo(writer);
}
} catch (TemplateException e) {
if (LOG.isErrorEnabled()) {
LOG.error("Error processing Freemarker result!", e);
}
throw e;
} catch (IOException e) {
if (LOG.isErrorEnabled()){
LOG.error("Error processing Freemarker result!", e);
}
throw e;
} finally {
if (isTopTemplate && parentCharArrayWriter != null) {
req.removeAttribute(PARENT_TEMPLATE_WRITER);
@@ -81,11 +81,11 @@ public abstract class TagModel implements TemplateTransformModel {
// the value should ALWAYS be a decendant of TemplateModel
if (value instanceof TemplateModel) {
try {
map.put(entry.getKey(), objectWrapper
.unwrap((TemplateModel) value));
map.put(entry.getKey(), objectWrapper.unwrap((TemplateModel) value));
} catch (TemplateModelException e) {
LOG.error("failed to unwrap [" + value
+ "] it will be ignored", e);
if (LOG.isErrorEnabled()) {
LOG.error("failed to unwrap [#0] it will be ignored", e, value.toString());
}
}
}
// if it doesn't, we'll do it the old way by just returning the toString() representation
@@ -123,7 +123,9 @@ public abstract class TagModel implements TemplateTransformModel {
try {
map.put(entry.getKey(), ((SimpleSequence) value).toList());
} catch (TemplateModelException e) {
LOG.error("There was a problem converting a SimpleSequence to a list", e);
if (LOG.isErrorEnabled()) {
LOG.error("There was a problem converting a SimpleSequence to a list", e);
}
}
}
}
@@ -21,14 +21,13 @@
package org.apache.struts2.views.jsp;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.components.Component;
import org.apache.struts2.components.IteratorComponent;
import com.opensymphony.xwork2.util.ValueStack;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
/**
* @see IteratorComponent
@@ -93,7 +92,7 @@ public class IteratorTag extends ContextBeanTag {
try {
bodyContent.writeOut(bodyContent.getEnclosingWriter());
} catch (Exception e) {
throw new JspException(e.getMessage());
throw new JspException(e);
}
}
return SKIP_BODY;
@@ -46,8 +46,9 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
protected String labelSeparator;
protected String labelPosition;
protected String requiredposition;
protected String errorPosition;
protected String name;
protected String required;
protected String requiredLabel;
protected String tabindex;
protected String value;
protected String template;
@@ -96,9 +97,10 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
uiBean.setLabel(label);
uiBean.setLabelSeparator(labelSeparator);
uiBean.setLabelposition(labelPosition);
uiBean.setRequiredposition(requiredposition);
uiBean.setRequiredPosition(requiredposition);
uiBean.setErrorPosition(errorPosition);
uiBean.setName(name);
uiBean.setRequired(required);
uiBean.setRequiredLabel(requiredLabel);
uiBean.setTabindex(tabindex);
uiBean.setValue(value);
uiBean.setTemplate(template);
@@ -171,12 +173,16 @@ public abstract class AbstractUITag extends ComponentTagSupport implements Dynam
this.requiredposition = requiredPosition;
}
public void setErrorPosition(String errorPosition) {
this.errorPosition = errorPosition;
}
public void setName(String name) {
this.name = name;
}
public void setRequired(String required) {
this.required = required;
public void setRequiredLabel(String requiredLabel) {
this.requiredLabel = requiredLabel;
}
public void setTabindex(String tabindex) {
@@ -183,8 +183,9 @@ public class DefaultUrlHelper implements UrlHelper {
try {
result = encodeResult ? response.encodeURL(result) : result;
} catch (Exception ex) {
// Could not encode the URL for some reason
// Use it unchanged
if (LOG.isDebugEnabled()) {
LOG.debug("Could not encode the URL for some reason, use it unchanged", ex);
}
result = link.toString();
}
@@ -240,47 +241,45 @@ public class DefaultUrlHelper implements UrlHelper {
private String buildParameterSubstring(String name, String value) {
StringBuilder builder = new StringBuilder();
builder.append(translateAndEncode(name));
builder.append(encode(name));
builder.append('=');
builder.append(translateAndEncode(value));
builder.append(encode(value));
return builder.toString();
}
/**
* Translates any script expressions using {@link com.opensymphony.xwork2.util.TextParseUtil#translateVariables} and
* encodes the URL using {@link java.net.URLEncoder#encode} with the encoding specified in the configuration.
*
* @param input
* @return the translated and encoded string
*/
public String translateAndEncode(String input) {
String translatedInput = translateVariable(input);
try {
return URLEncoder.encode(translatedInput, encoding);
} catch (UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
LOG.warn("Could not encode URL parameter '" + input + "', returning value un-encoded");
}
return translatedInput;
}
}
/**
* Encodes the URL using {@link java.net.URLEncoder#encode} with the encoding specified in the configuration.
*
* @param input the input to encode
* @return the encoded string
*/
public String encode( String input ) {
try {
return URLEncoder.encode(input, encoding);
} catch (UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
LOG.warn("Could not encode URL parameter '#0', returning value un-encoded", input);
}
return input;
}
}
public String translateAndDecode(String input) {
String translatedInput = translateVariable(input);
try {
return URLDecoder.decode(translatedInput, encoding);
} catch (UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
LOG.warn("Could not encode URL parameter '" + input + "', returning value un-encoded");
}
return translatedInput;
}
}
private String translateVariable(String input) {
ValueStack valueStack = ServletActionContext.getContext().getValueStack();
return TextParseUtil.translateVariables(input, valueStack);
}
/**
* Decodes the URL using {@link java.net.URLDecoder#decode(String, String)} with the encoding specified in the configuration.
*
* @param input the input to decode
* @return the encoded string
*/
public String decode( String input ) {
try {
return URLDecoder.decode(input, encoding);
} catch (UnsupportedEncodingException e) {
if (LOG.isWarnEnabled()) {
LOG.warn("Could not decode URL parameter '#0', returning value un-decoded", input);
}
return input;
}
}
public Map<String, Object> parseQueryString(String queryString, boolean forceValueArray) {
Map<String, Object> queryParams = new LinkedHashMap<String, Object>();
@@ -298,8 +297,8 @@ public class DefaultUrlHelper implements UrlHelper {
paramValue = tmpParams[1];
}
if (paramName != null) {
paramName = translateAndDecode(paramName);
String translatedParamValue = translateAndDecode(paramValue);
paramName = decode(paramName);
String translatedParamValue = decode(paramValue);
if (queryParams.containsKey(paramName) || forceValueArray) {
// WW-1619 append new param value to existing value(s)
@@ -46,7 +46,7 @@ public class StrutsResourceLoader extends ClasspathResourceLoader {
try {
return ClassLoaderUtil.getResourceAsStream(name, StrutsResourceLoader.class);
} catch (Exception e) {
throw new ResourceNotFoundException(e.getMessage());
throw new ResourceNotFoundException(e);
}
}
}
@@ -156,7 +156,9 @@ public class VelocityManager {
ctx = ServletActionContext.getServletContext();
} catch (NullPointerException npe) {
// in case this was used outside the lifecycle of struts servlet
LOG.debug("internal toolbox context ignored");
if (LOG.isDebugEnabled()) {
LOG.debug("internal toolbox context ignored");
}
}
if (toolboxManager != null && ctx != null) {
@@ -454,8 +456,7 @@ public class VelocityManager {
try {
velocityEngine.init(p);
} catch (Exception e) {
String gripe = "Unable to instantiate VelocityEngine!";
throw new StrutsException(gripe, e);
throw new StrutsException("Unable to instantiate VelocityEngine!", e);
}
return velocityEngine;
@@ -21,10 +21,6 @@
package org.apache.struts2.views.xslt;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.apache.struts2.StrutsException;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
@@ -33,6 +29,10 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
/**
* AdapterFactory produces Node adapters for Java object types.
* Adapter classes are generally instantiated dynamically via a no-args constructor
@@ -215,11 +215,9 @@ public class AdapterFactory {
return adapterNode;
} catch (IllegalAccessException e) {
e.printStackTrace();
throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage());
throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage(), e);
} catch (InstantiationException e) {
e.printStackTrace();
throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage());
throw new StrutsException("Cannot adapt " + propertyValue + " (" + propertyName + ") :" + e.getMessage(), e);
}
}
@@ -21,6 +21,12 @@
package org.apache.struts2.views.xslt;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.StrutsException;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
@@ -31,13 +37,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.struts2.StrutsException;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
/**
* This class is the most general type of adapter, utilizing reflective introspection to present a DOM view of all of
@@ -123,7 +122,9 @@ public class BeanAdapter extends AbstractAdapterElement {
} catch (Exception e) {
if (e instanceof InvocationTargetException)
e = (Exception) ((InvocationTargetException) e).getTargetException();
log.error("Cannot access bean property: "+propertyName, e);
if (log.isErrorEnabled()) {
log.error("Cannot access bean property: #0", e, propertyName);
}
continue;
}
@@ -21,12 +21,17 @@
package org.apache.struts2.views.xslt;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.Writer;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsException;
import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.ErrorListener;
@@ -40,19 +45,11 @@ import javax.xml.transform.URIResolver;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsException;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
/**
@@ -398,7 +395,9 @@ public class XSLTResult implements Result {
}
} catch (Exception e) {
LOG.error("Unable to render XSLT Template, '" + location + "'", e);
if (LOG.isErrorEnabled()) {
LOG.error("Unable to render XSLT Template, '#0'", e, location);
}
throw e;
}
}
@@ -184,8 +184,9 @@ struts.freemarker.beanwrapperCache=false
### See the StrutsBeanWrapper javadocs for more information
struts.freemarker.wrapper.altMap=true
### maxStrongSize for MruCacheStorage for freemarker
struts.freemarker.mru.max.strong.size=100
### maxStrongSize for MruCacheStorage for freemarker, when set to 0 SoftCacheStorage which performs better in heavy loaded application
### check WW-3766 for more details
struts.freemarker.mru.max.strong.size=0
### configure the XSLTResult class to use stylesheet caching.
### Set to true for developers and false for production.
+9 -1
View File
@@ -52,7 +52,7 @@
<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="struts" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default"/>
<bean type="org.apache.struts2.dispatcher.multipart.MultiPartRequest" name="jakarta" class="org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest" scope="default" />
<constant name="struts.multipart.handler" value="jakarta" />
<constant name="struts.multipart.parser" value="jakarta" />
<bean type="org.apache.struts2.views.TagLibrary" name="s" class="org.apache.struts2.views.DefaultTagLibrary" />
@@ -65,6 +65,12 @@
<bean type="org.apache.struts2.components.template.TemplateEngine" name="jsp" class="org.apache.struts2.components.template.JspTemplateEngine" />
<bean type="com.opensymphony.xwork2.conversion.impl.XWorkConverter" name="struts" class="com.opensymphony.xwork2.conversion.impl.XWorkConverter" />
<bean type="com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor" name="struts" class="com.opensymphony.xwork2.conversion.impl.DefaultConversionPropertiesProcessor" />
<bean type="com.opensymphony.xwork2.conversion.ConversionFileProcessor" name="struts" class="com.opensymphony.xwork2.conversion.impl.DefaultConversionFileProcessor" />
<bean type="com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor" name="struts" class="com.opensymphony.xwork2.conversion.impl.DefaultConversionAnnotationProcessor" />
<bean type="com.opensymphony.xwork2.conversion.TypeConverterCreator" name="struts" class="com.opensymphony.xwork2.conversion.impl.DefaultTypeConverterCreator" />
<bean type="com.opensymphony.xwork2.conversion.TypeConverterHolder" name="struts" class="com.opensymphony.xwork2.conversion.impl.DefaultTypeConverterHolder" />
<bean class="com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter" />
<bean type="com.opensymphony.xwork2.conversion.impl.CollectionConverter" name="struts" class="com.opensymphony.xwork2.conversion.impl.CollectionConverter" scope="singleton"/>
@@ -94,6 +100,8 @@
<bean class="com.opensymphony.xwork2.ognl.OgnlUtil" />
<bean type="com.opensymphony.xwork2.util.TextParser" name="struts" class="com.opensymphony.xwork2.util.OgnlTextParser" scope="singleton"/>
<bean type="ognl.PropertyAccessor" name="com.opensymphony.xwork2.util.CompoundRoot" class="com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor" />
<bean type="ognl.PropertyAccessor" name="java.lang.Object" class="com.opensymphony.xwork2.ognl.accessor.ObjectAccessor" />
<bean type="ognl.PropertyAccessor" name="java.util.Iterator" class="com.opensymphony.xwork2.ognl.accessor.XWorkIteratorPropertyAccessor" />
@@ -27,4 +27,20 @@ ${parameters.after?if_exists}<#t/>
<#else>
</span> <#rt/>
</#if>
</div>
<#if parameters.errorposition?default("top") == 'bottom'>
<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/>
<#if hasFieldErrors>
<div <#rt/><#if parameters.id??>id="wwerr_${parameters.id}"<#rt/></#if> class="wwerr">
<#list fieldErrors[parameters.name] as error>
<div<#rt/>
<#if parameters.id??>
errorFor="${parameters.id}"<#rt/>
</#if>
class="errorMessage">
${error?html}
</div><#t/>
</#list>
</div><#t/>
</#if>
</#if>
</div>
@@ -27,6 +27,7 @@
<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/>
<div <#rt/><#if parameters.id??>id="wwgrp_${parameters.id}"<#rt/></#if> class="wwgrp">
<#if parameters.errorposition?default("top") == 'top'>
<#if hasFieldErrors>
<div <#rt/><#if parameters.id??>id="wwerr_${parameters.id}"<#rt/></#if> class="wwerr">
<#list fieldErrors[parameters.name] as error>
@@ -40,6 +41,7 @@
</#list>
</div><#t/>
</#if>
</#if>
<#if parameters.label??>
<#if parameters.labelposition?default("top") == 'top'>
@@ -23,3 +23,16 @@
${parameters.after?if_exists}<#t/>
</td><#lt/>
</tr>
<#if parameters.errorposition?default("top") == 'bottom'>
<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/>
<#if hasFieldErrors>
<#list fieldErrors[parameters.name] as error>
<tr errorFor="${parameters.id}">
<td align="center" valign="top" colspan="2"><#rt/>
<span class="errorMessage">${error?html}</span><#t/>
</td><#lt/>
</tr>
</#list>
</#if>
</#if>
@@ -25,19 +25,17 @@
This will be done if ActionSupport is used.
-->
<#assign hasFieldErrors = parameters.name?? && fieldErrors?? && fieldErrors[parameters.name]??/>
<#if parameters.errorposition?default("top") == 'top'>
<#if hasFieldErrors>
<#list fieldErrors[parameters.name] as error>
<tr errorFor="${parameters.id}">
<#if parameters.labelposition?default("") == 'top'>
<td align="left" valign="top" colspan="2"><#rt/>
<#else>
<td align="center" valign="top" colspan="2"><#rt/>
</#if>
<span class="errorMessage">${error?html}</span><#t/>
</td><#lt/>
</tr>
</#list>
</#if>
</#if>
<#--
if the label position is top,
then give the label it's own row in the table
@@ -85,7 +85,7 @@ END SNIPPET: supported-validators
<#if validator.shortCircuit>continueValidation = false;</#if>
}
<#elseif validator.validatorType = "email">
if (continueValidation && field.value != null && field.value.length > 0 && field.value.match(/\b^['_a-z0-9-\+]+(\.['_a-z0-9-\+]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.([a-z]{2}|aero|arpa|asia|biz|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|nato|net|org|pro|tel|travel|xxx)$\b/gi)==null) {
if (continueValidation && field.value != null && field.value.length > 0 && field.value.match("${validator.expression?js_string}")==null) {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation = false;</#if>
@@ -99,9 +99,9 @@ END SNIPPET: supported-validators
<#elseif validator.validatorType = "int">
if (continueValidation && field.value != null) {
if (<#if validator.min??>parseInt(field.value) <
${validator.min}<#else>false</#if> ||
${validator.min?c}<#else>false</#if> ||
<#if validator.max??>parseInt(field.value) >
${validator.max}<#else>false</#if>) {
${validator.max?c}<#else>false</#if>) {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation = false;</#if>
@@ -110,10 +110,10 @@ END SNIPPET: supported-validators
<#elseif validator.validatorType = "double">
if (continueValidation && field.value != null) {
var value = parseFloat(field.value);
if (<#if validator.minInclusive??>value < ${validator.minInclusive}<#else>false</#if> ||
<#if validator.maxInclusive??>value > ${validator.maxInclusive}<#else>false</#if> ||
<#if validator.minExclusive??>value <= ${validator.minExclusive}<#else>false</#if> ||
<#if validator.maxExclusive??>value >= ${validator.maxExclusive}<#else>false</#if>) {
if (<#if validator.minInclusive??>value < ${validator.minInclusive?c}<#else>false</#if> ||
<#if validator.maxInclusive??>value > ${validator.maxInclusive?c}<#else>false</#if> ||
<#if validator.minExclusive??>value <= ${validator.minExclusive?c}<#else>false</#if> ||
<#if validator.maxExclusive??>value >= ${validator.maxExclusive?c}<#else>false</#if>) {
addError(field, error);
errors = true;
<#if validator.shortCircuit>continueValidation = false;</#if>
+10 -2
View File
@@ -105,6 +105,14 @@ Please do not edit it directly.
<td align="left" valign="top">Boolean</td>
<td align="left" valign="top">Whether to encode parameters</td>
</tr>
<tr>
<td align="left" valign="top">errorPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define error position of form element (top|bottom)</td>
</tr>
<tr>
<td align="left" valign="top">escapeAmp</td>
<td align="left" valign="top">false</td>
@@ -354,7 +362,7 @@ Please do not edit it directly.
<td align="left" valign="top">Specifies if this should be a portlet render or action URL. Default is "render". To create an action URL, use "action".</td>
</tr>
<tr>
<td align="left" valign="top">required</td>
<td align="left" valign="top">requiredLabel</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
@@ -362,7 +370,7 @@ Please do not edit it directly.
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
</tr>
<tr>
<td align="left" valign="top">requiredposition</td>
<td align="left" valign="top">requiredPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
+10 -2
View File
@@ -81,6 +81,14 @@ Please do not edit it directly.
<td align="left" valign="top">String</td>
<td align="left" valign="top">Set the html disabled attribute on rendered html element</td>
</tr>
<tr>
<td align="left" valign="top">errorPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define error position of form element (top|bottom)</td>
</tr>
<tr>
<td align="left" valign="top">escape</td>
<td align="left" valign="top">false</td>
@@ -258,7 +266,7 @@ Please do not edit it directly.
<td align="left" valign="top">Set the html onselect attribute on rendered html element</td>
</tr>
<tr>
<td align="left" valign="top">required</td>
<td align="left" valign="top">requiredLabel</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
@@ -266,7 +274,7 @@ Please do not edit it directly.
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
</tr>
<tr>
<td align="left" valign="top">requiredposition</td>
<td align="left" valign="top">requiredPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
@@ -81,6 +81,14 @@ Please do not edit it directly.
<td align="left" valign="top">String</td>
<td align="left" valign="top">Set the html disabled attribute on rendered html element</td>
</tr>
<tr>
<td align="left" valign="top">errorPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define error position of form element (top|bottom)</td>
</tr>
<tr>
<td align="left" valign="top">escape</td>
<td align="left" valign="top">false</td>
@@ -258,7 +266,7 @@ Please do not edit it directly.
<td align="left" valign="top">Set the html onselect attribute on rendered html element</td>
</tr>
<tr>
<td align="left" valign="top">required</td>
<td align="left" valign="top">requiredLabel</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
@@ -266,7 +274,7 @@ Please do not edit it directly.
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
</tr>
<tr>
<td align="left" valign="top">requiredposition</td>
<td align="left" valign="top">requiredPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
+10 -2
View File
@@ -113,6 +113,14 @@ Please do not edit it directly.
<td align="left" valign="top">String</td>
<td align="left" valign="top">Comma delimmited list of topics that will published after the request(if the request fails)</td>
</tr>
<tr>
<td align="left" valign="top">errorPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define error position of form element (top|bottom)</td>
</tr>
<tr>
<td align="left" valign="top">errorText</td>
<td align="left" valign="top">false</td>
@@ -394,7 +402,7 @@ Please do not edit it directly.
<td align="left" valign="top">Parse returned HTML for Dojo widgets</td>
</tr>
<tr>
<td align="left" valign="top">required</td>
<td align="left" valign="top">requiredLabel</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
@@ -402,7 +410,7 @@ Please do not edit it directly.
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
</tr>
<tr>
<td align="left" valign="top">requiredposition</td>
<td align="left" valign="top">requiredPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
@@ -153,6 +153,14 @@ Please do not edit it directly.
<td align="left" valign="top">String</td>
<td align="left" valign="top">Comma delimmited list of topics that will published after the request(if the request fails)</td>
</tr>
<tr>
<td align="left" valign="top">errorPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define error position of form element (top|bottom)</td>
</tr>
<tr>
<td align="left" valign="top">forceValidOption</td>
<td align="left" valign="top">false</td>
@@ -490,7 +498,7 @@ Please do not edit it directly.
<td align="left" valign="top">Whether the input is readonly</td>
</tr>
<tr>
<td align="left" valign="top">required</td>
<td align="left" valign="top">requiredLabel</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
@@ -498,7 +506,7 @@ Please do not edit it directly.
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
</tr>
<tr>
<td align="left" valign="top">requiredposition</td>
<td align="left" valign="top">requiredPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
@@ -121,6 +121,14 @@ Please do not edit it directly.
<td align="left" valign="top">Date</td>
<td align="left" valign="top">Last available date in the calendar set</td>
</tr>
<tr>
<td align="left" valign="top">errorPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define error position of form element (top|bottom)</td>
</tr>
<tr>
<td align="left" valign="top">formatLength</td>
<td align="left" valign="top">false</td>
@@ -314,7 +322,7 @@ Please do not edit it directly.
<td align="left" valign="top">Set the html onselect attribute on rendered html element</td>
</tr>
<tr>
<td align="left" valign="top">required</td>
<td align="left" valign="top">requiredLabel</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
@@ -322,7 +330,7 @@ Please do not edit it directly.
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
</tr>
<tr>
<td align="left" valign="top">requiredposition</td>
<td align="left" valign="top">requiredPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
+10 -2
View File
@@ -129,6 +129,14 @@ Please do not edit it directly.
<td align="left" valign="top">String</td>
<td align="left" valign="top">Comma delimmited list of topics that will published after the request(if the request fails)</td>
</tr>
<tr>
<td align="left" valign="top">errorPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define error position of form element (top|bottom)</td>
</tr>
<tr>
<td align="left" valign="top">errorText</td>
<td align="left" valign="top">false</td>
@@ -426,7 +434,7 @@ Please do not edit it directly.
<td align="left" valign="top">Content will be loaded when div becomes visible, used only inside the tabbedpanel tag</td>
</tr>
<tr>
<td align="left" valign="top">required</td>
<td align="left" valign="top">requiredLabel</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
@@ -434,7 +442,7 @@ Please do not edit it directly.
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
</tr>
<tr>
<td align="left" valign="top">requiredposition</td>
<td align="left" valign="top">requiredPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
+10 -2
View File
@@ -121,6 +121,14 @@ Please do not edit it directly.
<td align="left" valign="top">String</td>
<td align="left" valign="top">Comma delimmited list of topics that will published after the request(if the request fails)</td>
</tr>
<tr>
<td align="left" valign="top">errorPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define error position of form element (top|bottom)</td>
</tr>
<tr>
<td align="left" valign="top">errorText</td>
<td align="left" valign="top">false</td>
@@ -410,7 +418,7 @@ Please do not edit it directly.
<td align="left" valign="top">Parse returned HTML for Dojo widgets</td>
</tr>
<tr>
<td align="left" valign="top">required</td>
<td align="left" valign="top">requiredLabel</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
@@ -418,7 +426,7 @@ Please do not edit it directly.
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
</tr>
<tr>
<td align="left" valign="top">requiredposition</td>
<td align="left" valign="top">requiredPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
@@ -121,6 +121,14 @@ Please do not edit it directly.
<td align="left" valign="top">Boolean</td>
<td align="left" valign="top">If doLayout is false, the tab container's height equals the height of the currently selected tab</td>
</tr>
<tr>
<td align="left" valign="top">errorPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define error position of form element (top|bottom)</td>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top"><strong>true</strong></td>
@@ -298,7 +306,7 @@ Please do not edit it directly.
<td align="left" valign="top">Set template to use for opening the rendered html.</td>
</tr>
<tr>
<td align="left" valign="top">required</td>
<td align="left" valign="top">requiredLabel</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
@@ -306,7 +314,7 @@ Please do not edit it directly.
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
</tr>
<tr>
<td align="left" valign="top">requiredposition</td>
<td align="left" valign="top">requiredPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
@@ -89,6 +89,14 @@ Please do not edit it directly.
<td align="left" valign="top">String</td>
<td align="left" valign="top">Set the html disabled attribute on rendered html element</td>
</tr>
<tr>
<td align="left" valign="top">errorPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define error position of form element (top|bottom)</td>
</tr>
<tr>
<td align="left" valign="top">id</td>
<td align="left" valign="top">false</td>
@@ -266,7 +274,7 @@ Please do not edit it directly.
<td align="left" valign="top">Whether the textarea is readonly</td>
</tr>
<tr>
<td align="left" valign="top">required</td>
<td align="left" valign="top">requiredLabel</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
@@ -274,7 +282,7 @@ Please do not edit it directly.
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
</tr>
<tr>
<td align="left" valign="top">requiredposition</td>
<td align="left" valign="top">requiredPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
+10 -2
View File
@@ -113,6 +113,14 @@ Please do not edit it directly.
<td align="left" valign="top">String</td>
<td align="left" valign="top">Comma delimmited list of topics that will published after the request(if the request fails).Only valid if 'href' is set</td>
</tr>
<tr>
<td align="left" valign="top">errorPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">String</td>
<td align="left" valign="top">Define error position of form element (top|bottom)</td>
</tr>
<tr>
<td align="left" valign="top">expandIconSrcMinus</td>
<td align="left" valign="top">false</td>
@@ -402,7 +410,7 @@ Please do not edit it directly.
<td align="left" valign="top">Set template to use for opening the rendered html.</td>
</tr>
<tr>
<td align="left" valign="top">required</td>
<td align="left" valign="top">requiredLabel</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top">false</td>
@@ -410,7 +418,7 @@ Please do not edit it directly.
<td align="left" valign="top">If set to true, the rendered element will indicate that input is required</td>
</tr>
<tr>
<td align="left" valign="top">requiredposition</td>
<td align="left" valign="top">requiredPosition</td>
<td align="left" valign="top">false</td>
<td align="left" valign="top"></td>
<td align="left" valign="top">false</td>

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