Compare commits

...

229 Commits

Author SHA1 Message Date
Lukasz Lenart 8fb9aba74b [maven-release-plugin] prepare release STRUTS_6_7_4 2025-02-20 13:20:46 +01:00
Lukasz Lenart c45664a330 Merge pull request #1226 from apache/fix/WW-5529-maxlength-s6
WW-5529 Adds autogenerated files with updated desc
2025-02-20 13:05:57 +01:00
Lukasz Lenart 91c9314176 WW-5529 Adds autogenerated files with updated desc 2025-02-20 12:21:58 +01:00
Kusal Kithul-Godage a4e9902d94 Merge pull request #1225 from apache/WW-5531-jre8-compat
WW-5531 Enforce JRE8 compatibility (when compiled on JDK9+)
2025-02-20 17:22:42 +11:00
Kusal Kithul-Godage fe5b197738 WW-5531 Enforce JRE8 compatibility (when compiled on JDK9+) 2025-02-20 16:23:10 +11:00
Lukasz Lenart 87e322dbe2 [maven-release-plugin] prepare for next development iteration 2025-02-17 11:34:19 +01:00
Lukasz Lenart 7909f43237 [maven-release-plugin] prepare release STRUTS_6_7_3 2025-02-17 11:34:11 +01:00
Lukasz Lenart 1fe822cca0 WW-5529 Drops unused misleading setter setMaxLength in favour of setMaxlength (#1221) (#1222) 2025-02-17 10:27:04 +01:00
Kusal Kithul-Godage ef90b3ba3c Merge pull request #1220 from apache/WW-5525-proxyutil-npe-67
6.7: WW-5525 Fix NPE in ProxyUtil for SecurityMemberAccess originating static members
2025-02-17 19:11:21 +11:00
Lukasz Lenart d35ec15c76 WW-5525 Fixes NPE when checking if expressions is acceptable
(cherry picked from commit 9fee06cea0)
2025-02-17 18:57:27 +11:00
Kusal Kithul-Godage 583b174fe6 WW-5525 Fix NPE in ProxyUtil for SecurityMemberAccess originating static members 2025-02-17 18:57:27 +11:00
Lukasz Lenart 9b044377ac WW-5501 Reverts all changes related to WW-5501 (#1218)
* Reverts all changes related to WW-5501

* Fixes CodeQL scan by using proper versions of actions

* WW-5501 Uses FilenameUtils instead of a custom code
2025-02-16 12:05:49 +01:00
Kusal Kithul-Godage 58f37babbf Merge pull request #1215 from apache/WW-5528-multipart-illegal-char-errors-67 2025-02-09 23:44:10 +11:00
Kusal Kithul-Godage fe3dd6ba9f WW-5528 Ensure multipart upload illegal characters reported as error 2025-02-07 12:40:42 +11:00
Lukasz Lenart 7a77c7a82c [maven-release-plugin] prepare for next development iteration 2025-02-04 07:39:44 +01:00
Lukasz Lenart 5038a9209f [maven-release-plugin] prepare release STRUTS_6_7_2 2025-02-04 07:39:35 +01:00
Lukasz Lenart 2135ebf651 WW-5501 Ignores DMI related action field (#1211) 2025-02-04 06:47:43 +01:00
Kusal Kithul-Godage c0dd8dd80c Merge pull request #1210 from apache/WW-5516-attrmap-npe-67 2025-02-04 01:19:16 +11:00
Kusal Kithul-Godage c36eafa37a WW-5516 Fix AttributeMap NPE when PageContext has no request 2025-02-04 01:00:36 +11:00
Lukasz Lenart 07603b9591 [maven-release-plugin] prepare for next development iteration 2025-02-02 10:16:30 +01:00
Lukasz Lenart 3227d5929a [maven-release-plugin] prepare release STRUTS_6_7_1 2025-02-02 10:16:20 +01:00
Lukasz Lenart 4a8ddbb274 Merge pull request #1202 from apache/fix/bom-version
Defines proper snapshot version for BOM
2025-02-02 10:10:35 +01:00
Lukasz Lenart 67ba458d03 Defines proper snapshot version for BOM 2025-02-02 10:00:09 +01:00
Lukasz Lenart 959b2182b2 Merge pull request #1195 from apache/fix/proper-version
Defines proper snapshot version
2025-01-24 08:28:32 +01:00
Lukasz Lenart 6de93e77db Defines proper snapshot version 2025-01-24 07:58:39 +01:00
Lukasz Lenart 59dc9301e0 Merge pull request #1194 from apache/fix/jenkinsfile-67x
Simplifies Jenkinsfile to build Struts 6.x
2025-01-22 08:18:56 +01:00
Lukasz Lenart 2fc4a822a4 Simplifies Jenkinsfile to build Struts 6.x 2025-01-22 07:52:34 +01:00
Kusal Kithul-Godage 6a6270f62a Merge pull request #1190 from apache/WW-5516-fix-temp-theme-fallback
WW-5516 Fix TemplateDir and Theme fallback to Request/Session/Application attributes
2025-01-22 13:24:09 +11:00
Lukasz Lenart 9153228b6a Merge pull request #1192 from apache/fix/nightlies-67x
Fixes nightlies builds
2025-01-21 20:31:59 +01:00
Lukasz Lenart 5713a74edc Fixes nightlies builds 2025-01-21 18:06:11 +01:00
Kusal Kithul-Godage 32071c71ad WW-5516 Fix TemplateDir and Theme fallback to Request/Session/Application attributes 2025-01-21 20:05:24 +11:00
Lukasz Lenart 7e4791985b Merge pull request #1175 from apache/feature/WW-5512-optional-inject
WW-5512 Extends the container to support injecting optional parameters into constructor
2025-01-21 07:25:58 +01:00
Lukasz Lenart 3c1e44ca2d WW-5512 Supports mixing required and optional parameters in any order 2025-01-19 09:53:01 +01:00
Lukasz Lenart 2ba8d97ad0 WW-5512 Supports mixing required and optional parameters 2025-01-19 09:36:27 +01:00
Lukasz Lenart cba0db0b07 Merge pull request #1181 from apache/fix/WW-5501-exclude
WW-5501 Only exclude malicious file names
2025-01-16 07:28:46 +01:00
Lukasz Lenart 688162cae2 WW-5501 Only exclude malicious file names 2025-01-14 07:47:39 +01:00
Lukasz Lenart a33c162f53 WW-5512 Extends the container to support injecting optional parameters into constructor 2025-01-05 17:45:11 +01:00
Lukasz Lenart c7a6daf5ce Merge pull request #1169 from apache/fix/WW-5500
WW-5500 Extends pattern to validate multipart uploads
2025-01-05 09:20:33 +01:00
Lukasz Lenart 370c7ce17a Merge pull request #1168 from apache/fix/WW-5498
WW-5498 Adds devMode errors as action messages to avoid breaking validation logic
2025-01-05 09:16:44 +01:00
Lukasz Lenart 55989befce Merge pull request #1167 from apache/fix/excluded-packages
Excludes new & old packages
2025-01-04 14:37:47 +01:00
Lukasz Lenart 2e4a4b5e36 Excludes new & old packages 2025-01-04 13:56:31 +01:00
Lukasz Lenart 9d07c3b4c3 WW-5498 Adds devMode errors as action messages to avoid breaking validation logic 2025-01-03 17:14:12 +01:00
Lukasz Lenart 575e4e8c9b WW-5500 Extends pattern to validate multipart uploads 2025-01-03 17:10:59 +01:00
Lukasz Lenart 74388dfba7 Merge pull request #1158 from apache/fix/updates-asf-yaml
Updates .asf.yaml to match main
2024-12-23 16:11:55 +01:00
Lukasz Lenart 4ee8b02262 Updates .asf.yaml to match main 2024-12-23 15:24:10 +01:00
Lukasz Lenart c8febc2050 Merge pull request #1156 from apache/feature/WW-5501-exclude
WW-5501 Exclude malicious names
2024-12-23 15:08:58 +01:00
Lukasz Lenart 3ea126388c WW-5501 Uses StringUtils.normalizeSpace instead of sanitizeNewlines 2024-12-23 14:13:26 +01:00
Lukasz Lenart 09993e3476 WW-5501 Exclude malicious names 2024-12-23 12:05:15 +01:00
Lukasz Lenart f5688e680b Merge pull request #1150 from apache/feature/prepare-development
Sets version to 6.7.1-SNAPSHOT to prepare for another development cycle
2024-12-18 15:42:21 +01:00
Lukasz Lenart 60a3db0a63 Sets version to 6.7.1-SNAPSHOT to prepare for another development cycle 2024-12-18 14:43:29 +01:00
Lukasz Lenart 4714d27678 Merge pull request #1141 from apache/fix/WW-5493-parameters
WW-5493 Restores parameters and uses getAttributes()
2024-12-18 07:42:47 +01:00
Lukasz Lenart 4feceee5f1 WW-5493 Restores parameters and uses getAttributes()
Instead of using parameters field directly, this PR uses getAttributes() instead to avoid coupling with internal Component state
2024-12-04 08:19:34 +01:00
Lukasz Lenart 1f5305c249 [maven-release-plugin] prepare release STRUTS_6_7_0 2024-11-17 10:57:09 +01:00
Lukasz Lenart 1903e0ef33 Merge pull request #1126 from apache/feature/WW-5484-dwr
WW-5484 Marks the DWR plugin as deprecated
2024-11-14 15:55:01 +01:00
Lukasz Lenart 8a2f494c12 WW-5484 Marks the DWR plugin as deprecated 2024-11-11 17:49:54 +01:00
Lukasz Lenart 6b2e5ecd9b Merge pull request #1125 from apache/dependabot/github_actions/github/codeql-action-3.27.1
Bump github/codeql-action from 3.27.0 to 3.27.1
2024-11-11 07:37:48 +01:00
dependabot[bot] cb08d18b5a Bump github/codeql-action from 3.27.0 to 3.27.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.0 to 3.27.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.27.0...v3.27.1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-11 01:45:38 +00:00
Kusal Kithul-Godage 1e2517b59e Merge pull request #1117 from apache/WW-3714-overriding-behaviour
WW-3714 Ensure correct delegation of deprecated API methods
2024-11-03 21:06:59 +11:00
Kusal Kithul-Godage 8d6ecee849 Merge pull request #1116 from apache/WW-5459-repkg-action-chain-2 2024-11-03 18:53:21 +11:00
Kusal Kithul-Godage 570bf46a7f Merge pull request #1115 from apache/WW-5459-repkg-action-chain 2024-11-03 18:52:42 +11:00
Kusal Kithul-Godage be82a72403 WW-3714 Ensure correct delegation of new Interceptor API 2024-11-03 11:47:34 +11:00
Kusal Kithul-Godage 6fbd9e5321 WW-3714 Ensure correct delegation of new Result API 2024-11-03 11:26:14 +11:00
Kusal Kithul-Godage b0a4c4f417 WW-5459 Deprecate and repackage ActionChainResult 2024-11-03 11:25:46 +11:00
Kusal Kithul-Godage b001c61f89 WW-5459 Move new Action class into action package 2024-11-03 10:49:36 +11:00
Kusal Kithul-Godage 2beac8eba4 Merge pull request #1109 from apache/WW-3714-result-repackage
WW-3714 Move new Result class into result package
2024-11-03 10:46:42 +11:00
Kusal Kithul-Godage d351843ecd WW-3714 Move new Result class into result package 2024-11-02 23:01:07 +11:00
Kusal Kithul-Godage 22036174c7 Merge pull request #1108 from apache/WW-5480-templating-warning
WW-5480 Warn against potential templating bug
2024-11-02 22:58:34 +11:00
Kusal Kithul-Godage ced44650ec WW-5480 Warn against potential templating bug 2024-11-02 14:42:07 +11:00
Kusal Kithul-Godage 1908cbab8f Merge pull request #1105 from apache/WW-5476-defaultresultfactory
WW-5478 Deprecate DefaultResultFactory
2024-11-02 14:05:37 +11:00
Kusal Kithul-Godage c176390926 WW-5478 Fix ActionContext equals/hashCode contract 2024-11-02 14:01:37 +11:00
Kusal Kithul-Godage fe46ad9f4a WW-5478 Deprecate DefaultResultFactory 2024-11-02 14:01:36 +11:00
Kusal Kithul-Godage a0dc19c4be Merge pull request #1104 from apache/WW-5468-modeldriven-strutsparameter-fix 2024-11-01 23:19:43 +11:00
Kusal Kithul-Godage 7cdcd84b83 Merge pull request #1072 from apache/fix/WW-5468-modeldriven-2
WW-5468 Exempt ModelDriven Actions from @StrutsParameter requirement
2024-11-01 19:17:21 +11:00
Lukasz Lenart 8566c14648 Merge pull request #1096 from apache/feature/WW-5476-deprecate
WW-5476 Deprecates tag's parameters as replaced with attributes
2024-10-30 06:43:07 +01:00
Lukasz Lenart c75ddbbf3e Merge pull request #1098 from apache/dependabot/maven/asm.version-9.7.1
Bump asm.version from 9.7 to 9.7.1
2024-10-29 16:00:40 +01:00
Lukasz Lenart b15dc458cf Merge pull request #1102 from apache/dependabot/github_actions/github/codeql-action-3.27.0
Bump github/codeql-action from 3.26.13 to 3.27.0
2024-10-29 16:00:12 +01:00
dependabot[bot] 3f74923099 Bump github/codeql-action from 3.26.13 to 3.27.0
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.13 to 3.27.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.26.13...v3.27.0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-28 01:54:27 +00:00
dependabot[bot] 5b2f63fa7e Bump asm.version from 9.7 to 9.7.1
Bumps `asm.version` from 9.7 to 9.7.1.

Updates `org.ow2.asm:asm` from 9.7 to 9.7.1

Updates `org.ow2.asm:asm-commons` from 9.7 to 9.7.1

---
updated-dependencies:
- dependency-name: org.ow2.asm:asm
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.ow2.asm:asm-commons
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-28 01:50:03 +00:00
Lukasz Lenart d9d580ae3d Merge pull request #1094 from apache/dependabot/maven/org.apache.commons-commons-lang3-3.17.0
WW-5477 Bump org.apache.commons:commons-lang3 from 3.15.0 to 3.17.0
2024-10-27 09:01:15 +01:00
Lukasz Lenart 67e0477993 WW-5476 Deprecates tag's parameters as replaced with attributes 2024-10-25 08:28:18 +02:00
Kusal Kithul-Godage 89bcbecc70 Merge pull request #1085 from apache/kusal-depr-apis-7
WW-3714 Deprecate and repackage common APIs part 6
2024-10-25 12:13:09 +11:00
Kusal Kithul-Godage 67ee1b2d67 Merge pull request #1084 from apache/kusal-depr-apis-6 2024-10-23 21:12:42 +11:00
Kusal Kithul-Godage 5b81ec0852 Merge pull request #1083 from apache/kusal-depr-apis-5
WW-3714 Deprecate and repackage common APIs part 4
2024-10-22 23:11:23 +11:00
Kusal Kithul-Godage 266cd1333c Merge pull request #1082 from apache/kusal-depr-apis-4
WW-3714 Deprecate and repackage common APIs part 3
2024-10-22 23:11:07 +11:00
Kusal Kithul-Godage 323267fa88 Merge pull request #1087 from apache/kusal-depr-apis-3.5
WW-3714 Deprecate and repackage common APIs part 2.5
2024-10-22 23:10:48 +11:00
Kusal Kithul-Godage 2432449975 WW-3714 Update StrutsResultSupport to allow overriding new signature 2024-10-22 18:50:56 +11:00
Kusal Kithul-Godage 45a1f5efc6 WW-3714 Deprecate and migrate assorted Interceptors 2024-10-22 18:50:56 +11:00
Kusal Kithul-Godage b488c80aa2 Merge pull request #1081 from apache/kusal-depr-apis-3
WW-3714 Deprecate and repackage common APIs part 2
2024-10-22 18:03:00 +11:00
Lukasz Lenart 144010c3b7 Merge pull request #1093 from apache/dependabot/maven/org.apache.maven.doxia-doxia-core-2.0.0
Bump org.apache.maven.doxia:doxia-core from 1.12.0 to 2.0.0
2024-10-22 08:27:26 +02:00
Lukasz Lenart 9b87e88bb0 Merge pull request #1095 from apache/dependabot/maven/org.apache.maven.plugins-maven-failsafe-plugin-3.5.1
Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.3.1 to 3.5.1
2024-10-22 08:27:07 +02:00
Lukasz Lenart 117e84f246 Merge pull request #1092 from apache/dependabot/maven/maven-surefire-plugin.version-3.5.1
Bump maven-surefire-plugin.version from 3.5.0 to 3.5.1
2024-10-22 08:26:39 +02:00
Lukasz Lenart a28f22605c Merge pull request #1090 from apache/dependabot/github_actions/github/codeql-action-3.26.13
Bump github/codeql-action from 3.26.12 to 3.26.13
2024-10-22 08:26:02 +02:00
Kusal Kithul-Godage deb6c09bce WW-3714 Replace deprecated APIs in new ActionSupport 2024-10-22 17:02:11 +11:00
Kusal Kithul-Godage f95f9a7cd3 WW-3714 Add alternative constructors in InterceptorMapping 2024-10-22 17:02:11 +11:00
Kusal Kithul-Godage 9e23fbe665 WW-3714 Deprecate and migrate AbstractInterceptor and MethodFilterInterceptor 2024-10-22 17:02:11 +11:00
Kusal Kithul-Godage a623842bce WW-3714 Deprecate and migrate ActionSupport 2024-10-22 17:02:11 +11:00
Kusal Kithul-Godage 2757c23572 WW-3714 Fix replacement ValidationAware marker not recognised 2024-10-22 17:01:57 +11:00
Kusal Kithul-Godage ebedd7391f WW-3714 Marker interface migration follow-up 2024-10-22 13:55:46 +11:00
Kusal Kithul-Godage 7ce8f484e0 WW-3714 Shortcut adapters 2024-10-22 13:55:46 +11:00
Kusal Kithul-Godage dfd07190bd WW-3714 Update new ActionContext with new ValueStack 2024-10-22 13:55:46 +11:00
Kusal Kithul-Godage 111bc25650 WW-3714 Deprecate and migrate assorted marker interfaces 2024-10-22 13:55:46 +11:00
Kusal Kithul-Godage 8ba8ee5fe6 WW-3714 Deprecate and migrate ValueStack 2024-10-22 13:55:46 +11:00
Kusal Kithul-Godage 14bd4b80cf WW-3714 Deprecate and migrate ActionProxy 2024-10-22 13:55:19 +11:00
Kusal Kithul-Godage bbca2717f9 WW-3714 Deprecate and migrate ActionEventListener 2024-10-22 13:55:19 +11:00
Kusal Kithul-Godage b622e5d725 WW-3714 Ensure ReflectionExceptionHandler, WithLazyParams, ParamNameAwareResult marker interfaces respected 2024-10-22 13:50:45 +11:00
Kusal Kithul-Godage efa447af21 Merge pull request #1079 from apache/kusal-depr-apis
WW-3714 Deprecate and repackage common APIs part 1
2024-10-22 10:53:36 +11:00
dependabot[bot] cf6cbf3816 Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.3.1 to 3.5.1
Bumps [org.apache.maven.plugins:maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.3.1 to 3.5.1.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.3.1...surefire-3.5.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-failsafe-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-21 01:48:11 +00:00
dependabot[bot] 48ee44bbc2 Bump org.apache.commons:commons-lang3 from 3.15.0 to 3.17.0
Bumps org.apache.commons:commons-lang3 from 3.15.0 to 3.17.0.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-lang3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-21 01:48:04 +00:00
dependabot[bot] b18fbda1f7 Bump org.apache.maven.doxia:doxia-core from 1.12.0 to 2.0.0
Bumps [org.apache.maven.doxia:doxia-core](https://github.com/apache/maven-doxia) from 1.12.0 to 2.0.0.
- [Release notes](https://github.com/apache/maven-doxia/releases)
- [Commits](https://github.com/apache/maven-doxia/compare/doxia-1.12.0...doxia-2.0.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.doxia:doxia-core
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-21 01:48:01 +00:00
dependabot[bot] 28c8f1503d Bump maven-surefire-plugin.version from 3.5.0 to 3.5.1
Bumps `maven-surefire-plugin.version` from 3.5.0 to 3.5.1.

Updates `org.apache.maven.surefire:surefire-junit47` from 3.5.0 to 3.5.1

Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.5.0 to 3.5.1
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.5.0...surefire-3.5.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.surefire:surefire-junit47
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-21 01:47:53 +00:00
dependabot[bot] d1695f7a4d Bump github/codeql-action from 3.26.12 to 3.26.13
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.12 to 3.26.13.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.26.12...v3.26.13)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-21 01:29:19 +00:00
Lukasz Lenart b359da5517 Merge pull request #1068 from JCgH4164838Gh792C124B5/localS2_66_JakartaMulipartRequestFix1
Potential mitigation for WW-5466
2024-10-20 11:09:53 +02:00
Kusal Kithul-Godage 36a890ba69 WW-3714 Add factory support for new Interceptor, Result interfaces 2024-10-17 20:23:48 +11:00
Kusal Kithul-Godage e3fbe88355 WW-3714 Update new ActionContext with new ActionInvocation 2024-10-17 17:32:09 +11:00
Kusal Kithul-Godage 272c2e7bba WW-3714 Deprecate and migrate PreResultListener 2024-10-17 15:04:53 +11:00
Kusal Kithul-Godage 60095a6934 WW-3714 Deprecate and migrate ActionInvocation 2024-10-17 15:03:53 +11:00
Kusal Kithul-Godage ae9dc42da7 WW-3714 Deprecate and migrate ConditionalInterceptor 2024-10-17 14:22:30 +11:00
Kusal Kithul-Godage 8da6a79926 WW-3714 Deprecate and migrate ActionContext 2024-10-17 13:38:26 +11:00
Kusal Kithul-Godage 7deb481298 WW-3714 Deprecate and migrate Action, Interceptor, Result 2024-10-17 13:38:26 +11:00
Lukasz Lenart 9f2770b2c3 Merge pull request #1075 from apache/feature/WW-5471-deprecate-sitemesh
WW-5471 Marks Sitemesh plugin as deprecated
2024-10-15 16:16:44 +02:00
Lukasz Lenart 78451db87e Merge pull request #1062 from apache/dependabot/maven/jackson.version-2.18.0
WW-5469 Bump jackson.version from 2.17.2 to 2.18.0
2024-10-14 08:08:01 +02:00
Lukasz Lenart 49ddf6130a WW-5471 Marks Sitemesh plugin as deprecated 2024-10-14 07:55:05 +02:00
dependabot[bot] 1bcadd4682 Bump jackson.version from 2.17.2 to 2.18.0
Bumps `jackson.version` from 2.17.2 to 2.18.0.

Updates `com.fasterxml.jackson.core:jackson-core` from 2.17.2 to 2.18.0
- [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.17.2...jackson-core-2.18.0)

Updates `com.fasterxml.jackson.core:jackson-databind` from 2.17.2 to 2.18.0
- [Commits](https://github.com/FasterXML/jackson/commits)

Updates `com.fasterxml.jackson.dataformat:jackson-dataformat-xml` from 2.17.2 to 2.18.0
- [Commits](https://github.com/FasterXML/jackson-dataformat-xml/compare/jackson-dataformat-xml-2.17.2...jackson-dataformat-xml-2.18.0)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.fasterxml.jackson.dataformat:jackson-dataformat-xml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-14 05:40:12 +00:00
Lukasz Lenart b115a510a6 Merge pull request #1064 from apache/dependabot/maven/log4j2.version-2.24.1
WW-5470 Bump log4j2.version from 2.23.1 to 2.24.1
2024-10-14 07:39:16 +02:00
Lukasz Lenart fbab5d4df9 Merge pull request #1065 from apache/dependabot/maven/org.apache.maven.plugins-maven-project-info-reports-plugin-3.7.0
Bump org.apache.maven.plugins:maven-project-info-reports-plugin from 3.6.2 to 3.7.0
2024-10-14 07:28:01 +02:00
Lukasz Lenart cd7f1097e2 Merge pull request #1061 from apache/dependabot/maven/commons-logging-commons-logging-1.3.4
Bump commons-logging:commons-logging from 1.3.3 to 1.3.4
2024-10-14 07:27:47 +02:00
Lukasz Lenart 2eff2da4fd Merge pull request #1074 from apache/dependabot/github_actions/actions/upload-artifact-4.4.3
Bump actions/upload-artifact from 4.4.0 to 4.4.3
2024-10-14 07:24:46 +02:00
Lukasz Lenart b3629460e6 Merge pull request #1073 from apache/dependabot/github_actions/github/codeql-action-3.26.12
Bump github/codeql-action from 3.26.8 to 3.26.12
2024-10-14 07:24:29 +02:00
dependabot[bot] 3528b88327 Bump actions/upload-artifact from 4.4.0 to 4.4.3
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.4.0 to 4.4.3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/50769540e7f4bd5e21e526ee35c689e35e0d6874...b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-14 01:45:55 +00:00
dependabot[bot] 3e04197ba7 Bump github/codeql-action from 3.26.8 to 3.26.12
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.8 to 3.26.12.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.26.8...v3.26.12)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-14 01:45:53 +00:00
JCgH4164838Gh792C124B5 09eb286020 Initial Commit:
- Fix for boundary condition bug in JakartaMultipartRequest that results
in a NPE when struts.multipart.maxStringLength is not explicitly set, and
normal fields are processed along with a file upload.
- Additional unit tests for file upload interceptors to confirm
functionality with-or-without max parameters being set when a file upload
is processed alone as well as with normal fields.
2024-10-06 15:37:16 -04:00
Lukasz Lenart d33be1d43c [maven-release-plugin] prepare for next development iteration 2024-10-05 16:08:38 +02:00
Lukasz Lenart c812450292 [maven-release-plugin] prepare release STRUTS_6_6_1 2024-10-05 16:08:26 +02:00
Lukasz Lenart 75cc664fda Merge pull request #1060 from apache/fix/WW-5297-invalid-session
WW-5297 Fixes checking nonce of invalidated session
2024-10-01 06:44:58 +02:00
dependabot[bot] 9d903ddf96 Bump org.apache.maven.plugins:maven-project-info-reports-plugin
Bumps [org.apache.maven.plugins:maven-project-info-reports-plugin](https://github.com/apache/maven-project-info-reports-plugin) from 3.6.2 to 3.7.0.
- [Commits](https://github.com/apache/maven-project-info-reports-plugin/compare/maven-project-info-reports-plugin-3.6.2...maven-project-info-reports-plugin-3.7.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-project-info-reports-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-30 01:12:53 +00:00
dependabot[bot] 4ccde0087e Bump log4j2.version from 2.23.1 to 2.24.1
Bumps `log4j2.version` from 2.23.1 to 2.24.1.

Updates `org.apache.logging.log4j:log4j-api` from 2.23.1 to 2.24.1

Updates `org.apache.logging.log4j:log4j-core` from 2.23.1 to 2.24.1

Updates `org.apache.logging.log4j:log4j-jcl` from 2.23.1 to 2.24.1

Updates `org.apache.logging.log4j:log4j-slf4j-impl` from 2.23.1 to 2.24.1

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.logging.log4j:log4j-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.logging.log4j:log4j-jcl
  dependency-type: direct:development
  update-type: version-update:semver-minor
- dependency-name: org.apache.logging.log4j:log4j-slf4j-impl
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-30 01:12:30 +00:00
dependabot[bot] 7473b4cef9 Bump commons-logging:commons-logging from 1.3.3 to 1.3.4
Bumps commons-logging:commons-logging from 1.3.3 to 1.3.4.

---
updated-dependencies:
- dependency-name: commons-logging:commons-logging
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-30 01:11:56 +00:00
Lukasz Lenart 0bd4266d2f WW-5297 Fixes checking nonce of invalidated session 2024-09-24 07:31:12 +02:00
Lukasz Lenart 48c4e3b6a0 Merge pull request #1058 from apache/dependabot/github_actions/github/codeql-action-3.26.8
Bump github/codeql-action from 3.26.6 to 3.26.8
2024-09-23 19:25:25 +02:00
Lukasz Lenart 40b4395801 Merge pull request #1057 from apache/dependabot/maven/org.codehaus.mojo-exec-maven-plugin-3.4.1
Bump org.codehaus.mojo:exec-maven-plugin from 3.3.0 to 3.4.1
2024-09-23 19:24:59 +02:00
Lukasz Lenart 0ce2c7b5dd Merge pull request #1054 from apache/dependabot/maven/org.owasp-dependency-check-maven-10.0.4
Bump org.owasp:dependency-check-maven from 10.0.3 to 10.0.4
2024-09-23 19:24:13 +02:00
Lukasz Lenart 2924208228 Merge pull request #1053 from apache/dependabot/maven/org.apache.maven.plugins-maven-site-plugin-3.20.0
Bump org.apache.maven.plugins:maven-site-plugin from 3.12.1 to 3.20.0
2024-09-23 19:23:29 +02:00
dependabot[bot] 3c71b2ed8c Bump github/codeql-action from 3.26.6 to 3.26.8
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.6 to 3.26.8.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.26.6...v3.26.8)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-23 01:08:01 +00:00
dependabot[bot] d7626ed7d6 Bump org.codehaus.mojo:exec-maven-plugin from 3.3.0 to 3.4.1
Bumps [org.codehaus.mojo:exec-maven-plugin](https://github.com/mojohaus/exec-maven-plugin) from 3.3.0 to 3.4.1.
- [Release notes](https://github.com/mojohaus/exec-maven-plugin/releases)
- [Commits](https://github.com/mojohaus/exec-maven-plugin/compare/3.3.0...3.4.1)

---
updated-dependencies:
- dependency-name: org.codehaus.mojo:exec-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 01:55:27 +00:00
dependabot[bot] fda2c546b3 Bump org.owasp:dependency-check-maven from 10.0.3 to 10.0.4
Bumps [org.owasp:dependency-check-maven](https://github.com/jeremylong/DependencyCheck) from 10.0.3 to 10.0.4.
- [Release notes](https://github.com/jeremylong/DependencyCheck/releases)
- [Changelog](https://github.com/jeremylong/DependencyCheck/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jeremylong/DependencyCheck/compare/v10.0.3...v10.0.4)

---
updated-dependencies:
- dependency-name: org.owasp:dependency-check-maven
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 01:55:12 +00:00
dependabot[bot] f03d36c46b Bump org.apache.maven.plugins:maven-site-plugin from 3.12.1 to 3.20.0
Bumps [org.apache.maven.plugins:maven-site-plugin](https://github.com/apache/maven-site-plugin) from 3.12.1 to 3.20.0.
- [Release notes](https://github.com/apache/maven-site-plugin/releases)
- [Commits](https://github.com/apache/maven-site-plugin/compare/maven-site-plugin-3.12.1...maven-site-plugin-3.20.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-site-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 01:55:09 +00:00
Lukasz Lenart 90f984ca85 Merge pull request #1050 from apache/dependabot/maven/org.awaitility-awaitility-4.2.2
Bump org.awaitility:awaitility from 4.2.1 to 4.2.2
2024-09-10 18:42:27 +02:00
Lukasz Lenart 0f83b83972 Merge pull request #1048 from apache/dependabot/maven/org.apache.maven.plugins-maven-dependency-plugin-3.8.0
Bump org.apache.maven.plugins:maven-dependency-plugin from 3.6.1 to 3.8.0
2024-09-10 18:42:10 +02:00
Lukasz Lenart c352fb59c1 Merge pull request #1047 from apache/dependabot/maven/org.assertj-assertj-core-3.26.3
Bump org.assertj:assertj-core from 3.25.3 to 3.26.3
2024-09-10 18:41:51 +02:00
Lukasz Lenart 3d155048da Merge pull request #1046 from apache/dependabot/maven/maven-surefire-plugin.version-3.5.0
Bump maven-surefire-plugin.version from 3.4.0 to 3.5.0
2024-09-10 18:41:29 +02:00
Lukasz Lenart 9a06e7c983 Merge pull request #1049 from apache/dependabot/maven/org.jfree-jfreechart-1.5.5
Bump org.jfree:jfreechart from 1.5.4 to 1.5.5
2024-09-10 18:40:41 +02:00
dependabot[bot] 280c3e4f5f Bump org.awaitility:awaitility from 4.2.1 to 4.2.2
Bumps [org.awaitility:awaitility](https://github.com/awaitility/awaitility) from 4.2.1 to 4.2.2.
- [Changelog](https://github.com/awaitility/awaitility/blob/master/changelog.txt)
- [Commits](https://github.com/awaitility/awaitility/compare/awaitility-4.2.1...awaitility-4.2.2)

---
updated-dependencies:
- dependency-name: org.awaitility:awaitility
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 01:41:29 +00:00
dependabot[bot] 4c95983abb Bump org.jfree:jfreechart from 1.5.4 to 1.5.5
Bumps [org.jfree:jfreechart](https://github.com/jfree/jfreechart) from 1.5.4 to 1.5.5.
- [Release notes](https://github.com/jfree/jfreechart/releases)
- [Commits](https://github.com/jfree/jfreechart/compare/v1.5.4...v1.5.5)

---
updated-dependencies:
- dependency-name: org.jfree:jfreechart
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 01:41:23 +00:00
dependabot[bot] 3111c4b86f Bump org.apache.maven.plugins:maven-dependency-plugin
Bumps [org.apache.maven.plugins:maven-dependency-plugin](https://github.com/apache/maven-dependency-plugin) from 3.6.1 to 3.8.0.
- [Release notes](https://github.com/apache/maven-dependency-plugin/releases)
- [Commits](https://github.com/apache/maven-dependency-plugin/compare/maven-dependency-plugin-3.6.1...maven-dependency-plugin-3.8.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-dependency-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 01:41:19 +00:00
dependabot[bot] efab3fc6fa Bump org.assertj:assertj-core from 3.25.3 to 3.26.3
Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.25.3 to 3.26.3.
- [Release notes](https://github.com/assertj/assertj/releases)
- [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.25.3...assertj-build-3.26.3)

---
updated-dependencies:
- dependency-name: org.assertj:assertj-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 01:41:13 +00:00
dependabot[bot] 0c69993cd7 Bump maven-surefire-plugin.version from 3.4.0 to 3.5.0
Bumps `maven-surefire-plugin.version` from 3.4.0 to 3.5.0.

Updates `org.apache.maven.surefire:surefire-junit47` from 3.4.0 to 3.5.0

Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.4.0 to 3.5.0
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.4.0...surefire-3.5.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.surefire:surefire-junit47
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-09 01:41:09 +00:00
Lukasz Lenart b04ad6b412 Merge pull request #1040 from apache/fix/WW-5461-input-name
WW-5461 Extends UploadedFile with inputName field
2024-09-06 20:16:13 +02:00
Lukasz Lenart 735d1bc88d WW-5461 Extends UploadedFile with inputName field 2024-09-03 07:40:17 +02:00
Lukasz Lenart f388f6a679 Merge pull request #1030 from apache/dependabot/maven/spring.platformVersion-5.3.39
Bump spring.platformVersion from 5.3.37 to 5.3.39
2024-09-02 08:26:44 +02:00
Lukasz Lenart e74d21befb Merge pull request #1038 from apache/dependabot/github_actions/github/codeql-action-3.26.6
Bump github/codeql-action from 3.26.2 to 3.26.6
2024-09-02 08:18:20 +02:00
Lukasz Lenart 93c9856527 Merge pull request #1037 from apache/dependabot/github_actions/actions/upload-artifact-4.4.0
Bump actions/upload-artifact from 4.3.6 to 4.4.0
2024-09-02 08:18:04 +02:00
Lukasz Lenart f05a4d1c83 Merge pull request #1031 from apache/dependabot/maven/org.apache.commons-commons-compress-1.27.1
Bump org.apache.commons:commons-compress from 1.26.2 to 1.27.1
2024-09-02 08:16:53 +02:00
dependabot[bot] e4872ecf8e Bump spring.platformVersion from 5.3.37 to 5.3.39
Bumps `spring.platformVersion` from 5.3.37 to 5.3.39.

Updates `org.springframework:spring-core` from 5.3.37 to 5.3.39
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.37...v5.3.39)

Updates `org.springframework:spring-context` from 5.3.37 to 5.3.39
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.37...v5.3.39)

Updates `org.springframework:spring-aop` from 5.3.37 to 5.3.39
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.37...v5.3.39)

Updates `org.springframework:spring-aspects` from 5.3.37 to 5.3.39
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.37...v5.3.39)

Updates `org.springframework:spring-beans` from 5.3.37 to 5.3.39
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.37...v5.3.39)

Updates `org.springframework:spring-test` from 5.3.37 to 5.3.39
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.37...v5.3.39)

Updates `org.springframework:spring-context-support` from 5.3.37 to 5.3.39
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.37...v5.3.39)

Updates `org.springframework:spring-web` from 5.3.37 to 5.3.39
- [Release notes](https://github.com/spring-projects/spring-framework/releases)
- [Commits](https://github.com/spring-projects/spring-framework/compare/v5.3.37...v5.3.39)

---
updated-dependencies:
- dependency-name: org.springframework:spring-core
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-context
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-aop
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-aspects
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-beans
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-test
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-context-support
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: org.springframework:spring-web
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 06:14:58 +00:00
Lukasz Lenart f6a60fc66f Merge pull request #1028 from apache/dependabot/maven/slf4j.version-2.0.16
Bump slf4j.version from 2.0.13 to 2.0.16
2024-09-02 08:13:56 +02:00
dependabot[bot] 00f0942449 Bump github/codeql-action from 3.26.2 to 3.26.6
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.2 to 3.26.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.26.2...v3.26.6)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 01:21:36 +00:00
dependabot[bot] 8c7c39424f Bump actions/upload-artifact from 4.3.6 to 4.4.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.6 to 4.4.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/834a144ee995460fba8ed112a2fc961b36a5ec5a...50769540e7f4bd5e21e526ee35c689e35e0d6874)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-02 01:21:24 +00:00
dependabot[bot] ad7f3e3523 Bump org.apache.commons:commons-compress from 1.26.2 to 1.27.1
Bumps org.apache.commons:commons-compress from 1.26.2 to 1.27.1.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-compress
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-26 01:18:06 +00:00
dependabot[bot] 5a50bd312d Bump slf4j.version from 2.0.13 to 2.0.16
Bumps `slf4j.version` from 2.0.13 to 2.0.16.

Updates `org.slf4j:slf4j-api` from 2.0.13 to 2.0.16

Updates `org.slf4j:slf4j-simple` from 2.0.13 to 2.0.16

---
updated-dependencies:
- dependency-name: org.slf4j:slf4j-api
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.slf4j:slf4j-simple
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-26 01:17:36 +00:00
Lukasz Lenart 5b68d4bd59 Merge pull request #1025 from apache/dependabot/maven/org.apache.maven.plugins-maven-release-plugin-3.1.1
Bump org.apache.maven.plugins:maven-release-plugin from 3.0.1 to 3.1.1
2024-08-19 10:28:23 +02:00
Lukasz Lenart 64a3d0c32f Merge pull request #1020 from apache/dependabot/maven/org.easymock-easymock-5.4.0
Bump org.easymock:easymock from 5.2.0 to 5.4.0
2024-08-19 10:27:42 +02:00
Lukasz Lenart 6f135ea4d8 Merge pull request #1022 from apache/dependabot/maven/maven-surefire-plugin.version-3.4.0
Bump maven-surefire-plugin.version from 3.3.1 to 3.4.0
2024-08-19 10:23:23 +02:00
Lukasz Lenart bdace9bbad Merge pull request #1026 from apache/dependabot/github_actions/github/codeql-action-3.26.2
Bump github/codeql-action from 3.26.0 to 3.26.2
2024-08-19 10:23:00 +02:00
dependabot[bot] 9765edf2ea Bump github/codeql-action from 3.26.0 to 3.26.2
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.0 to 3.26.2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.26.0...v3.26.2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 01:52:03 +00:00
dependabot[bot] e81adc11eb Bump org.apache.maven.plugins:maven-release-plugin from 3.0.1 to 3.1.1
Bumps [org.apache.maven.plugins:maven-release-plugin](https://github.com/apache/maven-release) from 3.0.1 to 3.1.1.
- [Release notes](https://github.com/apache/maven-release/releases)
- [Commits](https://github.com/apache/maven-release/compare/maven-release-3.0.1...maven-release-3.1.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-release-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 01:25:44 +00:00
dependabot[bot] 0d84319dbf Bump maven-surefire-plugin.version from 3.3.1 to 3.4.0
Bumps `maven-surefire-plugin.version` from 3.3.1 to 3.4.0.

Updates `org.apache.maven.surefire:surefire-junit47` from 3.3.1 to 3.4.0

Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.3.1 to 3.4.0
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.3.1...surefire-3.4.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.surefire:surefire-junit47
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 01:25:04 +00:00
Kusal Kithul-Godage 9b259ae43a Merge pull request #1021 from apache/WW-4062-ognl-exc-cache
WW-4062 Further optimisation of OgnlException caching
2024-08-13 19:22:28 +10:00
Kusal Kithul-Godage 0fd85517e9 WW-4062 Further optimisation of OgnlException caching 2024-08-13 19:15:43 +10:00
Lukasz Lenart 8d07694be6 Merge pull request #1019 from apache/dependabot/maven/org.apache.maven.plugins-maven-failsafe-plugin-3.3.1
Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.3.0 to 3.3.1
2024-08-12 07:42:45 +02:00
Lukasz Lenart d42e530c89 Merge pull request #1018 from apache/dependabot/maven/org.codehaus.mojo-versions-maven-plugin-2.17.1
Bump org.codehaus.mojo:versions-maven-plugin from 2.16.2 to 2.17.1
2024-08-12 07:42:29 +02:00
Lukasz Lenart ea9d4774dd Merge pull request #1017 from apache/dependabot/maven/org.apache.maven.plugins-maven-wrapper-plugin-3.3.2
Bump org.apache.maven.plugins:maven-wrapper-plugin from 3.2.0 to 3.3.2
2024-08-12 07:42:09 +02:00
Lukasz Lenart 9948258fca Merge pull request #1016 from apache/dependabot/maven/commons-logging-commons-logging-1.3.3
Bump commons-logging:commons-logging from 1.3.0 to 1.3.3
2024-08-12 07:41:53 +02:00
Lukasz Lenart 8bbe215b6a Merge pull request #1015 from apache/dependabot/github_actions/github/codeql-action-3.26.0
Bump github/codeql-action from 3.25.15 to 3.26.0
2024-08-12 07:41:31 +02:00
Lukasz Lenart 90fca13568 Merge pull request #1014 from apache/dependabot/github_actions/actions/upload-artifact-4.3.6
Bump actions/upload-artifact from 4.3.5 to 4.3.6
2024-08-12 07:41:21 +02:00
dependabot[bot] d2d222e05d Bump org.easymock:easymock from 5.2.0 to 5.4.0
Bumps [org.easymock:easymock](https://github.com/easymock/easymock) from 5.2.0 to 5.4.0.
- [Release notes](https://github.com/easymock/easymock/releases)
- [Changelog](https://github.com/easymock/easymock/blob/master/ReleaseNotes.md)
- [Commits](https://github.com/easymock/easymock/compare/easymock-5.2.0...easymock-5.4.0)

---
updated-dependencies:
- dependency-name: org.easymock:easymock
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 01:46:09 +00:00
dependabot[bot] dc03a83f61 Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.3.0 to 3.3.1
Bumps [org.apache.maven.plugins:maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.3.0 to 3.3.1.
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.3.0...surefire-3.3.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-failsafe-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 01:45:57 +00:00
dependabot[bot] c067e25b2c Bump org.codehaus.mojo:versions-maven-plugin from 2.16.2 to 2.17.1
Bumps [org.codehaus.mojo:versions-maven-plugin](https://github.com/mojohaus/versions) from 2.16.2 to 2.17.1.
- [Release notes](https://github.com/mojohaus/versions/releases)
- [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md)
- [Commits](https://github.com/mojohaus/versions/compare/2.16.2...2.17.1)

---
updated-dependencies:
- dependency-name: org.codehaus.mojo:versions-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 01:45:53 +00:00
dependabot[bot] acd6ebeb6b Bump org.apache.maven.plugins:maven-wrapper-plugin from 3.2.0 to 3.3.2
Bumps [org.apache.maven.plugins:maven-wrapper-plugin](https://github.com/apache/maven-wrapper) from 3.2.0 to 3.3.2.
- [Release notes](https://github.com/apache/maven-wrapper/releases)
- [Commits](https://github.com/apache/maven-wrapper/compare/maven-wrapper-3.2.0...maven-wrapper-3.3.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-wrapper-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 01:45:48 +00:00
dependabot[bot] 89154e0479 Bump commons-logging:commons-logging from 1.3.0 to 1.3.3
Bumps commons-logging:commons-logging from 1.3.0 to 1.3.3.

---
updated-dependencies:
- dependency-name: commons-logging:commons-logging
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 01:45:42 +00:00
dependabot[bot] 107810dce2 Bump github/codeql-action from 3.25.15 to 3.26.0
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.15 to 3.26.0.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v3.25.15...v3.26.0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 01:15:10 +00:00
dependabot[bot] 1536a7e04b Bump actions/upload-artifact from 4.3.5 to 4.3.6
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.5 to 4.3.6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/89ef406dd8d7e03cfd12d9e0a4a378f454709029...834a144ee995460fba8ed112a2fc961b36a5ec5a)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-12 01:14:58 +00:00
Kusal Kithul-Godage 663dd3a50c Merge pull request #1013 from apache/WW-4062-ognl-exc-cache
WW-4062 Cache OgnlException thrown on compilation
2024-08-10 19:00:41 +10:00
Kusal Kithul-Godage 6caa932fff WW-4062 Cache OgnlException thrown on compilation 2024-08-09 20:34:52 +10:00
Lukasz Lenart a4464099d9 Merge pull request #1006 from apache/dependabot/github_actions/ossf/scorecard-action-2.4.0
Bump ossf/scorecard-action from 2.3.3 to 2.4.0
2024-08-05 07:24:54 +02:00
Lukasz Lenart 932eed204d Merge pull request #998 from apache/dependabot/maven/org.owasp-dependency-check-maven-10.0.3
Bump org.owasp:dependency-check-maven from 9.2.0 to 10.0.3
2024-08-05 07:23:24 +02:00
Lukasz Lenart e7cce1bcd7 Merge pull request #997 from apache/dependabot/maven/org.apache.maven.plugins-maven-project-info-reports-plugin-3.6.2
Bump org.apache.maven.plugins:maven-project-info-reports-plugin from 3.5.0 to 3.6.2
2024-08-05 07:22:53 +02:00
Lukasz Lenart 9280a478c3 Merge pull request #1012 from apache/dependabot/github_actions/actions/upload-artifact-4.3.5
Bump actions/upload-artifact from 4.3.4 to 4.3.5
2024-08-05 07:22:30 +02:00
Lukasz Lenart adbfab8cf1 Merge pull request #1011 from apache/dependabot/github_actions/github/codeql-action-3.25.15
Bump github/codeql-action from 2.22.11 to 3.25.15
2024-08-05 07:21:57 +02:00
dependabot[bot] b8da13c235 Bump actions/upload-artifact from 4.3.4 to 4.3.5
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.4 to 4.3.5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/0b2256b8c012f0828dc542b3febcab082c67f72b...89ef406dd8d7e03cfd12d9e0a4a378f454709029)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 01:55:15 +00:00
dependabot[bot] 0d3358b035 Bump github/codeql-action from 2.22.11 to 3.25.15
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.22.11 to 3.25.15.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Commits](https://github.com/github/codeql-action/compare/v2.22.11...v3.25.15)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-05 01:55:12 +00:00
Lukasz Lenart 935868c756 Merge pull request #1008 from apache/feature/WW-5451-null-iterator
WW-5451 Fixes NPE when iterator starts with null
2024-08-01 12:01:46 +02:00
Lukasz Lenart 479a9d86ed WW-5451 Fixes NPE when iterator starts with null 2024-07-31 16:53:01 +02:00
dependabot[bot] eeb1d8e0ca Bump ossf/scorecard-action from 2.3.3 to 2.4.0
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.3.3 to 2.4.0.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/dc50aa9510b46c811795eb24b2f1ba02a914e534...62b2cac7ed8198b15735ed49ab1e5cf35480ba46)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-29 01:44:54 +00:00
Lukasz Lenart e3e854a67b Merge pull request #1000 from apache/dependabot/maven/org.apache.commons-commons-lang3-3.15.0
Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.15.0
2024-07-25 20:05:11 +02:00
dependabot[bot] 7e5e49e811 Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.15.0
Bumps org.apache.commons:commons-lang3 from 3.14.0 to 3.15.0.

---
updated-dependencies:
- dependency-name: org.apache.commons:commons-lang3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-22 01:30:09 +00:00
dependabot[bot] 8c10a303d0 Bump org.owasp:dependency-check-maven from 9.2.0 to 10.0.3
Bumps [org.owasp:dependency-check-maven](https://github.com/jeremylong/DependencyCheck) from 9.2.0 to 10.0.3.
- [Release notes](https://github.com/jeremylong/DependencyCheck/releases)
- [Changelog](https://github.com/jeremylong/DependencyCheck/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jeremylong/DependencyCheck/compare/v9.2.0...v10.0.3)

---
updated-dependencies:
- dependency-name: org.owasp:dependency-check-maven
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-22 01:29:54 +00:00
dependabot[bot] dbd74ae3a3 Bump org.apache.maven.plugins:maven-project-info-reports-plugin
Bumps [org.apache.maven.plugins:maven-project-info-reports-plugin](https://github.com/apache/maven-project-info-reports-plugin) from 3.5.0 to 3.6.2.
- [Commits](https://github.com/apache/maven-project-info-reports-plugin/compare/maven-project-info-reports-plugin-3.5.0...maven-project-info-reports-plugin-3.6.2)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-project-info-reports-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-22 01:29:50 +00:00
Lukasz Lenart f977f0c0e5 [maven-release-plugin] prepare for next development iteration 2024-07-20 08:28:46 +02:00
Lukasz Lenart d6e30b45da [maven-release-plugin] prepare release STRUTS_6_6_0 2024-07-20 08:28:35 +02:00
Kusal Kithul-Godage 9195990b56 Merge pull request #986 from apache/WW-5440-convention
WW-5440 Fix OGNL allowlist compat with Convention plugin
2024-07-15 16:27:50 +10:00
Lukasz Lenart 0c4d66430e Merge pull request #994 from apache/dependabot/maven/maven-surefire-plugin.version-3.3.1
Bump maven-surefire-plugin.version from 3.2.5 to 3.3.1
2024-07-15 07:17:42 +02:00
Lukasz Lenart de0b3204ec Merge pull request #993 from apache/dependabot/maven/jackson.version-2.17.2
Bump jackson.version from 2.17.1 to 2.17.2
2024-07-15 07:17:21 +02:00
Kusal Kithul-Godage cec46792cf Merge branch 'master' into WW-5440-convention 2024-07-15 13:18:00 +10:00
dependabot[bot] 6d0fc2aa28 Bump maven-surefire-plugin.version from 3.2.5 to 3.3.1
Bumps `maven-surefire-plugin.version` from 3.2.5 to 3.3.1.

Updates `org.apache.maven.surefire:surefire-junit47` from 3.2.5 to 3.3.1

Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.2.5 to 3.3.1
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.5...surefire-3.3.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.surefire:surefire-junit47
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 01:14:29 +00:00
dependabot[bot] 1f46802ba2 Bump jackson.version from 2.17.1 to 2.17.2
Bumps `jackson.version` from 2.17.1 to 2.17.2.

Updates `com.fasterxml.jackson.core:jackson-core` from 2.17.1 to 2.17.2
- [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.17.1...jackson-core-2.17.2)

Updates `com.fasterxml.jackson.core:jackson-databind` from 2.17.1 to 2.17.2
- [Commits](https://github.com/FasterXML/jackson/commits)

Updates `com.fasterxml.jackson.dataformat:jackson-dataformat-xml` from 2.17.1 to 2.17.2
- [Commits](https://github.com/FasterXML/jackson-dataformat-xml/compare/jackson-dataformat-xml-2.17.1...jackson-dataformat-xml-2.17.2)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.core:jackson-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.fasterxml.jackson.core:jackson-databind
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: com.fasterxml.jackson.dataformat:jackson-dataformat-xml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 01:14:23 +00:00
Kusal Kithul-Godage 085471b408 Merge pull request #988 from apache/kusal-experimental
WW-5442 Enforce allowlist for OgnlReflectionProvider
2024-07-14 21:44:38 +10:00
Kusal Kithul-Godage 9ea9d566df Merge pull request #990 from apache/WW-5443-spring-bump
WW-5443 Bump Spring dependencies to 5.3.37
2024-07-14 21:44:28 +10:00
Kusal Kithul-Godage 5372aff1dd WW-5443 Bump Spring dependencies to 5.3.37 2024-07-14 14:16:37 +10:00
Kusal Kithul-Godage 92fc324f27 Merge pull request #987 from apache/WW-5428-more-logging
WW-5428 Stop further excessive logging in DevMode
2024-07-14 00:53:06 +10:00
Kusal Kithul-Godage b7b5bff13a WW-5442 Enforce allowlist for OgnlReflectionProvider 2024-07-14 00:47:38 +10:00
Kusal Kithul-Godage 27e4d0d47a WW-5440 Fix inconsistent indenting 2024-07-14 00:34:06 +10:00
Kusal Kithul-Godage cb62cb4e9a WW-5440 Fix OGNL allowlist compat with Convention plugin 2024-07-14 00:34:06 +10:00
Kusal Kithul-Godage abfb2f4568 WW-5428 Stop further excessive logging in DevMode 2024-07-13 23:41:33 +10:00
Kusal Kithul-Godage e9a1668199 Merge pull request #985 from apache/WW-5441-jasper
WW-5441 Bump net.sf.jasperreports:jasperreports to 6.21.3
2024-07-13 23:09:26 +10:00
Kusal Kithul-Godage 8b4c188d0f WW-5440 Fix Showcase App allowlist configuration 2024-07-13 21:57:26 +10:00
Kusal Kithul-Godage f9953938f7 WW-5440 Add missing annotations 2024-07-13 21:57:26 +10:00
Kusal Kithul-Godage 10edbce8d9 WW-5440 Fix MultipleFileUploadUsingArrayAction 2024-07-13 21:22:21 +10:00
Kusal Kithul-Godage 56c1291d2f WW-5440 Deprecate AnnotationParameterFilterInterceptor 2024-07-13 21:22:21 +10:00
Kusal Kithul-Godage fcc2c9d3ab WW-5441 Bump net.sf.jasperreports:jasperreports to 6.21.3 2024-07-13 18:52:57 +10:00
Lukasz Lenart 54e387dc6f [maven-release-plugin] prepare for next development iteration 2024-07-12 07:27:19 +02:00
378 changed files with 8860 additions and 3299 deletions
+11 -1
View File
@@ -11,9 +11,19 @@ notifications:
jira_options: link label worklog
github:
description: "Apache Struts is a free, open-source, MVC framework for creating elegant, modern Java web applications"
homepage: https://struts.apache.org/
del_branch_on_merge: true
protected_branches:
master:
main:
# contexts are the names of checks that must pass.
contexts:
- build
required_pull_request_reviews:
# it does not work because our github teams are private/secret, see INFRA-25666
require_code_owner_reviews: false
required_approving_review_count: 0
release/*:
# contexts are the names of checks that must pass.
contexts:
- build
+20 -13
View File
@@ -17,7 +17,8 @@ name: "CodeQL"
on:
push:
branches: [ "master" ]
branches:
- 'release/*'
pull_request:
permissions:
@@ -41,15 +42,21 @@ jobs:
matrix:
language: [ 'java' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
cache: 'maven'
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.28.8
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v3.28.8
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.28.8
with:
category: "/language:${{matrix.language}}"
+3 -3
View File
@@ -45,7 +45,7 @@ jobs:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # 2.3.3
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # 2.4.0
with:
results_file: results.sarif
results_format: sarif
@@ -57,13 +57,13 @@ jobs:
publish_results: true
- name: "Upload artifact"
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # 4.3.4
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # 4.4.3
with:
name: SARIF file
path: results.sarif
retention-days: 5
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@03e7845b7bfcd5e7fb63d1ae8c61b0e791134fab # 2.22.11
uses: github/codeql-action/upload-sarif@acb9cb18eec7e3a113ef83cff0be91e75cfd9526 # 2.22.11
with:
sarif_file: results.sarif
Vendored
+11 -54
View File
@@ -69,7 +69,7 @@ pipeline {
stages {
stage('Test & Coverage') {
steps {
sh './mvnw -B verify -Pcoverage -DskipAssembly --no-transfer-progress'
sh './mvnw -B verify -Pcoverage -DskipAssembly'
}
post {
always {
@@ -81,58 +81,15 @@ pipeline {
stage('Code Quality') {
when {
anyOf {
branch 'master'; branch 'release/struts-7-0-x'
branch 'release/struts-6-7-x'
}
}
steps {
withCredentials([string(credentialsId: 'asf-struts-sonarcloud', variable: 'SONARCLOUD_TOKEN')]) {
sh './mvnw -B -Pcoverage -DskipAssembly -Dsonar.login=${SONARCLOUD_TOKEN} verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar --no-transfer-progress'
sh './mvnw -B -Pcoverage -DskipAssembly -Dsonar.login=${SONARCLOUD_TOKEN} verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar'
}
}
}
stage('Build Source & JavaDoc') {
when {
branch 'release/struts-7-0-x'
}
steps {
dir("local-snapshots-dir/") {
deleteDir()
}
sh './mvnw -B source:jar javadoc:jar -DskipTests -DskipAssembly --no-transfer-progress'
}
}
stage('Deploy Snapshot') {
when {
branch 'release/struts-7-0-x'
}
steps {
withCredentials([file(credentialsId: 'lukaszlenart-repository-access-token', variable: 'CUSTOM_SETTINGS')]) {
sh './mvnw -s \${CUSTOM_SETTINGS} deploy -DskipTests -DskipAssembly --no-transfer-progress'
}
}
}
stage('Upload nightlies') {
when {
branch 'release/struts-7-0-x'
}
steps {
sh './mvnw -B package -DskipTests --no-transfer-progress'
sshPublisher(publishers: [
sshPublisherDesc(
configName: 'Nightlies',
transfers: [
sshTransfer(
remoteDirectory: '/struts/snapshot',
removePrefix: 'assembly/target/assembly/out',
sourceFiles: 'assembly/target/assembly/out/struts-*.zip',
cleanRemote: true
)
],
verbose: true
)
])
}
}
}
post {
always {
@@ -154,12 +111,12 @@ pipeline {
stages {
stage('Build') {
steps {
sh './mvnw -B clean install -DskipTests -DskipAssembly --no-transfer-progress'
sh './mvnw -B clean install -DskipTests -DskipAssembly'
}
}
stage('Test') {
steps {
sh './mvnw -B verify --no-transfer-progress'
sh './mvnw -B verify -DskipAssembly'
}
post {
always {
@@ -170,31 +127,31 @@ pipeline {
}
stage('Build Source & JavaDoc') {
when {
branch 'master'
branch 'release/struts-6-7-x'
}
steps {
dir("local-snapshots-dir/") {
deleteDir()
}
sh './mvnw -B source:jar javadoc:jar -DskipTests -DskipAssembly --no-transfer-progress'
sh './mvnw -B source:jar javadoc:jar -DskipTests -DskipAssembly'
}
}
stage('Deploy Snapshot') {
when {
branch 'master'
branch 'release/struts-6-7-x'
}
steps {
withCredentials([file(credentialsId: 'lukaszlenart-repository-access-token', variable: 'CUSTOM_SETTINGS')]) {
sh './mvnw -s \${CUSTOM_SETTINGS} deploy -DskipTests -DskipAssembly --no-transfer-progress'
sh './mvnw -s \${CUSTOM_SETTINGS} deploy -DskipTests -DskipAssembly'
}
}
}
stage('Upload nightlies') {
when {
branch 'master'
branch 'release/struts-6-7-x'
}
steps {
sh './mvnw -B package -DskipTests --no-transfer-progress'
sh './mvnw -B package -DskipTests'
sshPublisher(publishers: [
sshPublisherDesc(
configName: 'Nightlies',
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>6.5.0</version>
<version>6.7.4</version>
</parent>
<artifactId>struts2-apps</artifactId>
<packaging>pom</packaging>
+2 -2
View File
@@ -24,12 +24,12 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>6.5.0</version>
<version>6.7.4</version>
</parent>
<artifactId>struts2-rest-showcase</artifactId>
<packaging>war</packaging>
<version>6.5.0</version>
<version>6.7.4</version>
<name>Struts 2 Rest Showcase Webapp</name>
<description>Struts 2 Rest Showcase Example</description>
@@ -18,30 +18,30 @@
*/
package org.demo.rest.example;
import java.util.Collection;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.rest.DefaultHttpHeaders;
import org.apache.struts2.rest.HttpHeaders;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Validateable;
import com.opensymphony.xwork2.ValidationAwareSupport;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.rest.DefaultHttpHeaders;
import org.apache.struts2.rest.HttpHeaders;
import java.util.Collection;
@Results({
@Result(name="success", type="redirectAction", params = {"actionName" , "orders"})
})
public class OrdersController extends ValidationAwareSupport implements ModelDriven<Object>, Validateable{
public class OrdersController extends ValidationAwareSupport implements ModelDriven<Object>, Validateable {
private static final Logger log = LogManager.getLogger(OrdersController.class);
private Order model = new Order();
private String id;
private Collection<Order> list;
private OrdersService ordersService = new OrdersService();
private final OrdersService ordersService = new OrdersService();
// GET /orders/1
public HttpHeaders show() {
@@ -54,7 +54,7 @@ public class OrdersController extends ValidationAwareSupport implements ModelDri
return new DefaultHttpHeaders("index")
.disableCaching();
}
// GET /orders/1/edit
public String edit() {
return "edit";
@@ -101,13 +101,15 @@ public class OrdersController extends ValidationAwareSupport implements ModelDri
}
}
@StrutsParameter
public void setId(String id) {
if (id != null) {
this.model = ordersService.get(id);
}
this.id = id;
}
@Override
public Object getModel() {
return (list != null ? list : model);
}
@@ -18,11 +18,14 @@
*/
package org.demo.rest.example;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class OrdersService {
private static Map<String,Order> orders = new HashMap<String,Order>();
private static final Map<String,Order> orders = new HashMap<>();
private static int nextId = 6;
static {
orders.put("3", new Order("3", "Bob", 33));
+8 -2
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-apps</artifactId>
<version>6.5.0</version>
<version>6.7.4</version>
</parent>
<artifactId>struts2-showcase</artifactId>
@@ -137,6 +137,12 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
@@ -157,7 +163,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.3.0</version>
<version>3.5.1</version>
<configuration>
<includes>
<include>it.org.apache.struts2.showcase.*Test</include>
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.showcase.ajax.tree.Category;
//START SNIPPET: treeExampleDynamicJavaSelected
@@ -30,7 +31,7 @@ public class DynamicTreeSelectAction extends ActionSupport {
private long nodeId;
private Category currentCategory;
@StrutsParameter
public void setNodeId(long nodeId) {
this.nodeId = nodeId;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.ArrayList;
import java.util.LinkedHashMap;
@@ -74,6 +75,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _favouriteCartoonCharactersKeys;
}
@StrutsParameter
public void setFavouriteCartoonCharacters(List favouriteCartoonCharacters) {
_favouriteCartoonCharactersKeys = favouriteCartoonCharacters;
}
@@ -82,6 +84,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _notFavouriteCartoonCharactersKeys;
}
@StrutsParameter
public void setNotFavouriteCartoonCharacters(List notFavouriteCartoonCharacters) {
_notFavouriteCartoonCharactersKeys = notFavouriteCartoonCharacters;
}
@@ -108,6 +111,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _favouriteCarsKeys;
}
@StrutsParameter
public void setFavouriteCars(List favouriteCars) {
_favouriteCarsKeys = favouriteCars;
}
@@ -116,6 +120,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _notFavouriteCarsKeys;
}
@StrutsParameter
public void setNotFavouriteCars(List notFavouriteCars) {
_notFavouriteCarsKeys = notFavouriteCars;
}
@@ -142,6 +147,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _favouriteMotorcyclesKeys;
}
@StrutsParameter
public void setFavouriteMotorcycles(List favouriteMotorcycles) {
_favouriteMotorcyclesKeys = favouriteMotorcycles;
}
@@ -150,6 +156,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _notFavouriteMotorcyclesKeys;
}
@StrutsParameter
public void setNotFavouriteMotorcycles(List notFavouriteMotorcycles) {
_notFavouriteMotorcyclesKeys = notFavouriteMotorcycles;
}
@@ -176,6 +183,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _favouriteCountriesKeys;
}
@StrutsParameter
public void setFavouriteCountries(List favouriteCountries) {
_favouriteCountriesKeys = favouriteCountries;
}
@@ -184,6 +192,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _notFavouriteCountriesKeys;
}
@StrutsParameter
public void setNotFavouriteCountries(List notFavouriteCountries) {
_notFavouriteCountriesKeys = notFavouriteCountries;
}
@@ -205,6 +214,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _favouriteSportsKeys;
}
@StrutsParameter
public void setFavouriteSports(List favouriteSportsKeys) {
this._favouriteSportsKeys = favouriteSportsKeys;
}
@@ -213,6 +223,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _nonFavouriteSportsKeys;
}
@StrutsParameter
public void setNonFavouriteSports(List notFavouriteSportsKeys) {
this._nonFavouriteSportsKeys = notFavouriteSportsKeys;
}
@@ -222,6 +233,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _prioritisedFavouriteCartoonCharacters;
}
@StrutsParameter
public void setPrioritisedFavouriteCartoonCharacters(List prioritisedFavouriteCartoonCharacters) {
_prioritisedFavouriteCartoonCharacters = prioritisedFavouriteCartoonCharacters;
}
@@ -230,6 +242,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _prioritisedFavouriteCars;
}
@StrutsParameter
public void setPrioritisedFavouriteCars(List prioritisedFavouriteCars) {
_prioritisedFavouriteCars = prioritisedFavouriteCars;
}
@@ -239,6 +252,7 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _prioritisedFavouriteCountries;
}
@StrutsParameter
public void setPrioritisedFavouriteCountries(List prioritisedFavouriteCountries) {
_prioritisedFavouriteCountries = prioritisedFavouriteCountries;
}
@@ -264,12 +278,13 @@ public class LotsOfOptiontransferselectAction extends ActionSupport {
return _favouriteCities;
}
@StrutsParameter
public void setFavouriteCities(List favouriteCities) {
this._favouriteCities = favouriteCities;
}
// actions
@Override
public String input() throws Exception {
return SUCCESS;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
*
@@ -36,6 +37,7 @@ public class LotsOfRichtexteditorAction extends ActionSupport {
return this.description1;
}
@StrutsParameter
public void setDescription1(String description1) {
this.description1 = description1;
}
@@ -45,6 +47,7 @@ public class LotsOfRichtexteditorAction extends ActionSupport {
return this.description2;
}
@StrutsParameter
public void setDescription2(String description2) {
this.description2 = description2;
}
@@ -54,6 +57,7 @@ public class LotsOfRichtexteditorAction extends ActionSupport {
return this.description3;
}
@StrutsParameter
public void setDescription3(String description3) {
this.description3 = description3;
}
@@ -63,11 +67,12 @@ public class LotsOfRichtexteditorAction extends ActionSupport {
return this.description4;
}
@StrutsParameter
public void setDescription4(String description4) {
this.description4 = description4;
}
@Override
public String input() throws Exception {
return SUCCESS;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.ArrayList;
import java.util.LinkedHashMap;
@@ -75,11 +76,11 @@ public class MoreSelectsAction extends ActionSupport {
return list;
}
public List getPrioritisedFavouriteCartoonCharacters() {
return _prioritisedFavouriteCartoonCharacters;
}
@StrutsParameter
public void setPrioritisedFavouriteCartoonCharacters(List prioritisedFavouriteCartoonCharacters) {
_prioritisedFavouriteCartoonCharacters = prioritisedFavouriteCartoonCharacters;
}
@@ -88,15 +89,16 @@ public class MoreSelectsAction extends ActionSupport {
return _prioritisedFavouriteCars;
}
@StrutsParameter
public void setPrioritisedFavouriteCars(List prioritisedFavouriteCars) {
_prioritisedFavouriteCars = prioritisedFavouriteCars;
}
public List getPrioritisedFavouriteCountries() {
return _prioritisedFavouriteCountries;
}
@StrutsParameter
public void setPrioritisedFavouriteCountries(List prioritisedFavouriteCountries) {
_prioritisedFavouriteCountries = prioritisedFavouriteCountries;
}
@@ -105,6 +107,7 @@ public class MoreSelectsAction extends ActionSupport {
return favouriteNumbers;
}
@StrutsParameter
public void setFavouriteNumbers(List favouriteNumbers) {
this.favouriteNumbers = favouriteNumbers;
}
@@ -129,12 +132,13 @@ public class MoreSelectsAction extends ActionSupport {
return favouriteCities;
}
@StrutsParameter
public void setFavouriteCities(List favouriteCities) {
this.favouriteCities = favouriteCities;
}
// actions
@Override
public String input() throws Exception {
return SUCCESS;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.showcase.ajax.tree.Category;
public class ShowAjaxDynamicTreeAction extends ActionSupport {
@@ -34,6 +35,7 @@ public class ShowAjaxDynamicTreeAction extends ActionSupport {
return nodeId;
}
@StrutsParameter
public void setNodeId(int nodeId) {
this.nodeId = nodeId;
}
@@ -200,6 +200,7 @@ public class UITagExample extends ActionSupport implements Validateable {
return bestFriend;
}
@StrutsParameter
public void setBestFriend(String bestFriend) {
this.bestFriend = bestFriend;
}
@@ -231,6 +232,7 @@ public class UITagExample extends ActionSupport implements Validateable {
this.region = region;
}
@StrutsParameter
public void setPicture(File picture) {
this.picture = picture;
}
@@ -239,10 +241,12 @@ public class UITagExample extends ActionSupport implements Validateable {
return this.picture;
}
@StrutsParameter
public void setPictureContentType(String pictureContentType) {
this.pictureContentType = pictureContentType;
}
@StrutsParameter
public void setPictureFileName(String pictureFileName) {
this.pictureFileName = pictureFileName;
}
@@ -323,6 +327,7 @@ public class UITagExample extends ActionSupport implements Validateable {
return this.description;
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof VehicalType)) {
return false;
@@ -331,6 +336,7 @@ public class UITagExample extends ActionSupport implements Validateable {
}
}
@Override
public int hashCode() {
return key.hashCode();
}
@@ -354,6 +360,7 @@ public class UITagExample extends ActionSupport implements Validateable {
return this.description;
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof VehicalSpecific)) {
return false;
@@ -362,6 +369,7 @@ public class UITagExample extends ActionSupport implements Validateable {
}
}
@Override
public int hashCode() {
return key.hashCode();
}
@@ -21,6 +21,7 @@ package org.apache.struts2.showcase.action;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.showcase.dao.Dao;
import org.apache.struts2.showcase.model.IdEntity;
@@ -33,62 +34,62 @@ import java.util.Collection;
public abstract class AbstractCRUDAction extends ActionSupport {
private static final Logger log = LogManager.getLogger(AbstractCRUDAction.class);
private static final Logger log = LogManager.getLogger(AbstractCRUDAction.class);
private Collection availableItems;
private String[] toDelete;
private Collection availableItems;
private String[] toDelete;
protected abstract Dao getDao();
protected abstract Dao getDao();
public Collection getAvailableItems() {
return availableItems;
}
public Collection getAvailableItems() {
return availableItems;
}
public String[] getToDelete() {
return toDelete;
}
public String[] getToDelete() {
return toDelete;
}
@StrutsParameter
public void setToDelete(String[] toDelete) {
this.toDelete = toDelete;
}
public void setToDelete(String[] toDelete) {
this.toDelete = toDelete;
}
public String list() throws Exception {
this.availableItems = getDao().findAll();
if (log.isDebugEnabled()) {
log.debug("AbstractCRUDAction - [list]: " + (availableItems != null ? "" + availableItems.size() : "no") + " items found");
}
return execute();
}
public String list() throws Exception {
this.availableItems = getDao().findAll();
if (log.isDebugEnabled()) {
log.debug("AbstractCRUDAction - [list]: " + (availableItems != null ? "" + availableItems.size() : "no") + " items found");
}
return execute();
}
public String delete() throws Exception {
if (toDelete != null) {
int count = 0;
for (String s : toDelete) {
count = count + getDao().delete(s);
}
if (log.isDebugEnabled()) {
log.debug("AbstractCRUDAction - [delete]: {} items deleted.", count);
}
}
return SUCCESS;
}
public String delete() throws Exception {
if (toDelete != null) {
int count = 0;
for (int i = 0, j = toDelete.length; i < j; i++) {
count = count + getDao().delete(toDelete[i]);
}
if (log.isDebugEnabled()) {
log.debug("AbstractCRUDAction - [delete]: " + count + " items deleted.");
}
}
return SUCCESS;
}
/**
* Utility method for fetching already persistent object from storage for usage in params-prepare-params cycle.
*
* @param tryId The id to try to get persistent object for
* @param tryObject The object, induced by first params invocation, possibly containing id to try to get persistent
* object for
* @return The persistent object, if found. <tt>null</tt> otherwise.
*/
protected IdEntity fetch(Serializable tryId, IdEntity tryObject) {
IdEntity result = null;
if (tryId != null) {
result = getDao().get(tryId);
} else if (tryObject != null) {
result = getDao().get(tryObject.getId());
}
return result;
}
/**
* Utility method for fetching already persistent object from storage for usage in params-prepare-params cycle.
*
* @param tryId The id to try to get persistent object for
* @param tryObject The object, induced by first params invocation, possibly containing id to try to get persistent
* object for
* @return The persistent object, if found. <tt>null</tt> otherwise.
*/
protected IdEntity fetch(Serializable tryId, IdEntity tryObject) {
IdEntity result = null;
if (tryId != null) {
result = getDao().get(tryId);
} else if (tryObject != null) {
result = getDao().get(tryObject.getId());
}
return result;
}
}
@@ -21,6 +21,7 @@ package org.apache.struts2.showcase.action;
import com.opensymphony.xwork2.Preparable;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.showcase.application.TestDataProvider;
import org.apache.struts2.showcase.dao.Dao;
import org.apache.struts2.showcase.dao.EmployeeDao;
@@ -52,7 +53,7 @@ public class EmployeeAction extends AbstractCRUDAction implements Preparable {
public String execute() throws Exception {
if (getCurrentEmployee() != null && getCurrentEmployee().getOtherSkills() != null) {
setSelectedSkills(new ArrayList<String>());
setSelectedSkills(new ArrayList<>());
Iterator it = getCurrentEmployee().getOtherSkills().iterator();
while (it.hasNext()) {
getSelectedSkills().add(((Skill) it.next()).getName());
@@ -73,10 +74,12 @@ public class EmployeeAction extends AbstractCRUDAction implements Preparable {
return empId;
}
@StrutsParameter
public void setEmpId(Long empId) {
this.empId = empId;
}
@StrutsParameter(depth = 2)
public Employee getCurrentEmployee() {
return currentEmployee;
}
@@ -20,7 +20,11 @@ package org.apache.struts2.showcase.action;
import com.opensymphony.xwork2.ActionSupport;
import java.util.*;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ExampleAction extends ActionSupport {
public static final String CONSTANT = "Struts Rocks!";
@@ -46,7 +50,7 @@ public class ExampleAction extends ActionSupport {
}
public Map<String, Book> getBooks() {
Map<String, Book> books = new HashMap<String, Book>();
Map<String, Book> books = new HashMap<>();
books.put("Iliad", new Book("Iliad", "Homer"));
books.put("The Republic", new Book("The Replublic", "Plato"));
books.put("Thus Spake Zarathustra", new Book("Thus Spake Zarathustra",
@@ -79,4 +83,4 @@ class Book {
public void setAuthor(String author) {
this.author = author;
}
}
}
@@ -21,8 +21,13 @@ package org.apache.struts2.showcase.action;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.interceptor.annotations.After;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.io.*;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URL;
/**
@@ -62,6 +67,7 @@ public class JSPEvalAction extends ExampleAction {
}
}
@StrutsParameter
public void setJsp(String jsp) {
this.jsp = jsp;
}
@@ -46,6 +46,7 @@ public class SkillAction extends AbstractCRUDAction implements Preparable {
*
* @throws Exception thrown if a system level exception occurs.
*/
@Override
public void prepare() throws Exception {
Skill preFetched = (Skill) fetch(getSkillName(), getCurrentSkill());
if (preFetched != null) {
@@ -64,6 +65,7 @@ public class SkillAction extends AbstractCRUDAction implements Preparable {
return skillName;
}
@StrutsParameter
public void setSkillName(String skillName) {
this.skillName = skillName;
}
@@ -19,6 +19,7 @@
package org.apache.struts2.showcase.actionchaining;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class ActionChain1 extends ActionSupport {
@@ -26,6 +27,7 @@ public class ActionChain1 extends ActionSupport {
private String actionChain1Property1 = "Property Set In Action Chain 1";
@Override
public String input() throws Exception {
return SUCCESS;
}
@@ -34,6 +36,7 @@ public class ActionChain1 extends ActionSupport {
return actionChain1Property1;
}
@StrutsParameter
public void setActionChain1Property1(String actionChain1Property1) {
this.actionChain1Property1 = actionChain1Property1;
}
@@ -19,6 +19,7 @@
package org.apache.struts2.showcase.actionchaining;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class ActionChain2 extends ActionSupport {
@@ -27,6 +28,7 @@ public class ActionChain2 extends ActionSupport {
private String actionChain1Property1;
private String actionChain2Property1 = "Property Set in Action Chain 2";
@Override
public String execute() throws Exception {
return SUCCESS;
}
@@ -35,15 +37,16 @@ public class ActionChain2 extends ActionSupport {
return actionChain1Property1;
}
@StrutsParameter
public void setActionChain1Property1(String actionChain1Property1) {
this.actionChain1Property1 = actionChain1Property1;
}
public String getActionChain2Property1() {
return actionChain2Property1;
}
@StrutsParameter
public void setActionChain2Property1(String actionChain2Property1) {
this.actionChain2Property1 = actionChain2Property1;
}
@@ -19,6 +19,7 @@
package org.apache.struts2.showcase.actionchaining;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class ActionChain3 extends ActionSupport {
@@ -28,7 +29,7 @@ public class ActionChain3 extends ActionSupport {
private String actionChain2Property1;
private String actionChain3Property1 = "Property set in Action Chain 3";
@Override
public String execute() throws Exception {
return SUCCESS;
}
@@ -37,24 +38,25 @@ public class ActionChain3 extends ActionSupport {
return actionChain1Property1;
}
@StrutsParameter
public void setActionChain1Property1(String actionChain1Property1) {
this.actionChain1Property1 = actionChain1Property1;
}
public String getActionChain2Property1() {
return actionChain2Property1;
}
@StrutsParameter
public void setActionChain2Property1(String actionChain2Property1) {
this.actionChain2Property1 = actionChain2Property1;
}
public String getActionChain3Property1() {
return actionChain3Property1;
}
@StrutsParameter
public void setActionChain3Property1(String actionChain3Property1) {
this.actionChain3Property1 = actionChain3Property1;
}
@@ -21,10 +21,10 @@
package org.apache.struts2.showcase.ajax;
import com.opensymphony.xwork2.Action;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.io.Serializable;
public class AjaxTestAction implements Action, Serializable {
private static int counter = 0;
@@ -46,6 +46,7 @@ public class AjaxTestAction implements Action, Serializable {
return data;
}
@StrutsParameter
public void setData(String data) {
this.data = data;
}
@@ -21,16 +21,18 @@
package org.apache.struts2.showcase.ajax;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.ArrayList;
import java.util.List;
public class AutocompleterExampleAction extends ActionSupport {
private String select;
private List<String> options = new ArrayList<String>();
private final List<String> options = new ArrayList<>();
private static final long serialVersionUID = -8481638176160014396L;
@Override
public String execute() throws Exception {
if ("fruits".equals(select)) {
options.add("apple");
@@ -49,6 +51,7 @@ public class AutocompleterExampleAction extends ActionSupport {
return select;
}
@StrutsParameter
public void setSelect(String select) {
this.select = select;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase.ajax;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -51,6 +52,7 @@ public class Example4ShowPanelAction extends ActionSupport {
return gender;
}
@StrutsParameter
public void setGender(String gender) {
this.gender = gender;
}
@@ -59,6 +61,7 @@ public class Example4ShowPanelAction extends ActionSupport {
return name;
}
@StrutsParameter
public void setName(String name) {
this.name = name;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase.ajax;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class Example5Action extends ActionSupport {
@@ -37,6 +38,7 @@ public class Example5Action extends ActionSupport {
return name;
}
@StrutsParameter
public void setName(String name) {
this.name = name;
}
@@ -45,6 +47,7 @@ public class Example5Action extends ActionSupport {
return age;
}
@StrutsParameter
public void setAge(Integer age) {
this.age = age;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase.ajax.tree;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
*/
@@ -28,6 +29,7 @@ public class GetCategory extends ActionSupport {
private long catId;
private Category category;
@Override
public String execute() throws Exception {
if (catId < 1) {
// force the root
@@ -39,6 +41,7 @@ public class GetCategory extends ActionSupport {
return SUCCESS;
}
@StrutsParameter
public void setCatId(long catId) {
this.catId = catId;
}
@@ -24,6 +24,8 @@ package org.apache.struts2.showcase.ajax.tree;
/**
*/
public class Toggle extends GetCategory {
@Override
public String execute() throws Exception {
super.execute();
@@ -50,15 +50,12 @@ public class ChatRoomAction extends ActionSupport {
}
public Callable<String> receiveNewMessages() throws Exception {
return new Callable<String>() {
@Override
public String call() throws Exception {
while (lastIndex >= messages.size()) {
Thread.sleep(3000);
}
newMessages = messages.subList(lastIndex, messages.size());
return SUCCESS;
return () -> {
while (lastIndex >= messages.size()) {
Thread.sleep(3000);
}
newMessages = messages.subList(lastIndex, messages.size());
return SUCCESS;
};
}
@@ -21,11 +21,11 @@
package org.apache.struts2.showcase.chat;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.action.SessionAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.Map;
import org.apache.struts2.action.SessionAware;
public class ChatLoginAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = 1L;
@@ -43,6 +43,7 @@ public class ChatLoginAction extends ActionSupport implements SessionAware {
return this.name;
}
@StrutsParameter
public void setName(String name) {
this.name = name;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase.chat;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class CrudRoomAction extends ActionSupport {
@@ -36,6 +37,7 @@ public class CrudRoomAction extends ActionSupport {
return description;
}
@StrutsParameter
public void setDescription(String description) {
this.description = description;
}
@@ -44,6 +46,7 @@ public class CrudRoomAction extends ActionSupport {
return name;
}
@StrutsParameter
public void setName(String name) {
this.name = name;
}
@@ -21,11 +21,11 @@
package org.apache.struts2.showcase.chat;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.action.SessionAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.Map;
import org.apache.struts2.action.SessionAware;
public class EnterRoomAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = 1L;
@@ -38,6 +38,7 @@ public class EnterRoomAction extends ActionSupport implements SessionAware {
return this.roomName;
}
@StrutsParameter
public void setRoomName(String roomName) {
this.roomName = roomName;
}
@@ -21,11 +21,11 @@
package org.apache.struts2.showcase.chat;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.action.SessionAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.Map;
import org.apache.struts2.action.SessionAware;
public class ExitRoomAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = 1L;
@@ -38,6 +38,7 @@ public class ExitRoomAction extends ActionSupport implements SessionAware {
return roomName;
}
@StrutsParameter
public void setRoomName(String roomName) {
this.roomName = roomName;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase.chat;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.ArrayList;
import java.util.List;
@@ -30,13 +31,14 @@ public class MessagesAvailableInRoomAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private String roomName;
private ChatService chatService;
private List<ChatMessage> messagesAvailableInRoom = new ArrayList<ChatMessage>();
private final ChatService chatService;
private List<ChatMessage> messagesAvailableInRoom = new ArrayList<>();
public String getRoomName() {
return this.roomName;
}
@StrutsParameter
public void setRoomName(String roomName) {
this.roomName = roomName;
}
@@ -21,16 +21,16 @@
package org.apache.struts2.showcase.chat;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.action.SessionAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.Map;
import org.apache.struts2.action.SessionAware;
public class SendMessageToRoomAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = 1L;
private ChatService chatService;
private final ChatService chatService;
private String roomName;
private String message;
@@ -45,6 +45,7 @@ public class SendMessageToRoomAction extends ActionSupport implements SessionAwa
return this.roomName;
}
@StrutsParameter
public void setRoomName(String roomName) {
this.roomName = roomName;
}
@@ -53,11 +54,12 @@ public class SendMessageToRoomAction extends ActionSupport implements SessionAwa
return this.message;
}
@StrutsParameter
public void setMessage(String message) {
this.message = message;
}
@Override
public String execute() throws Exception {
User user = (User) session.get(ChatAuthenticationInterceptor.USER_SESSION_KEY);
try {
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase.chat;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.ArrayList;
import java.util.List;
@@ -29,8 +30,8 @@ public class UsersAvailableInRoomAction extends ActionSupport {
private static final long serialVersionUID = 1L;
private ChatService chatService;
private List<User> usersAvailableInRoom = new ArrayList<User>();
private final ChatService chatService;
private List<User> usersAvailableInRoom = new ArrayList<>();
private String roomName;
@@ -43,6 +44,7 @@ public class UsersAvailableInRoomAction extends ActionSupport {
return this.roomName;
}
@StrutsParameter
public void setRoomName(String roomName) {
this.roomName = roomName;
}
@@ -51,6 +53,7 @@ public class UsersAvailableInRoomAction extends ActionSupport {
return usersAvailableInRoom;
}
@Override
public String execute() throws Exception {
try {
usersAvailableInRoom = chatService.getUsersAvailableInRoom(roomName);
@@ -34,7 +34,7 @@ public class OperationsEnumAction extends ActionSupport {
private static final long serialVersionUID = -2229489704988870318L;
private List<OperationsEnum> selectedOperations = new LinkedList<OperationsEnum>();
private List<OperationsEnum> selectedOperations = new LinkedList<>();
public String input() throws Exception {
return SUCCESS;
@@ -53,7 +53,6 @@ public class OperationsEnumAction extends ActionSupport {
this.selectedOperations = selectedOperations;
}
public List<OperationsEnum> getAvailableOperations() {
return Arrays.asList(OperationsEnum.values());
}
@@ -37,6 +37,7 @@ public class FileUploadAction extends ActionSupport implements UploadedFilesAwar
private String fileName;
private String caption;
private String originalName;
private String inputName;
public String input() throws Exception {
return SUCCESS;
@@ -58,6 +59,10 @@ public class FileUploadAction extends ActionSupport implements UploadedFilesAwar
return originalName;
}
public String getInputName() {
return inputName;
}
public Object getUploadedFile() {
return uploadedFile.getContent();
}
@@ -85,5 +90,6 @@ public class FileUploadAction extends ActionSupport implements UploadedFilesAwar
this.fileName = uploadedFile.getName();
this.contentType = uploadedFile.getContentType();
this.originalName = uploadedFile.getOriginalName();
this.inputName = uploadedFile.getInputName();
}
}
@@ -28,12 +28,16 @@ import org.apache.struts2.dispatcher.multipart.UploadedFile;
import java.util.List;
/**
* Showcase action - mutiple file upload using array.
* Showcase action - multiple file upload using array.
*/
public class MultipleFileUploadUsingArrayAction extends ActionSupport implements UploadedFilesAware {
private List<UploadedFile> uploadedFiles;
public List<UploadedFile> getUpload() {
return this.uploadedFiles;
}
public String upload() throws Exception {
System.out.println("\n\n upload2");
System.out.println("files:");
@@ -22,6 +22,7 @@ package org.apache.struts2.showcase.freemarker;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.text.DateFormatSymbols;
@@ -34,6 +35,7 @@ public class StandardTagsAction extends ActionSupport implements Preparable {
private String[] gender;
private String[] months;
@Override
public void prepare() {
months = new DateFormatSymbols().getMonths();
name = StandardTagsAction.class.getName().substring(StandardTagsAction.class.getName().lastIndexOf(".") + 1);
@@ -44,6 +46,7 @@ public class StandardTagsAction extends ActionSupport implements Preparable {
return name;
}
@StrutsParameter
public void setName(String name) {
this.name = name;
}
@@ -52,15 +55,16 @@ public class StandardTagsAction extends ActionSupport implements Preparable {
return months;
}
@StrutsParameter
public void setMonths(String[] months) {
this.months = months;
}
public String[] getGender() {
return gender;
}
@StrutsParameter
public void setGender(String[] gender) {
this.gender = gender;
}
@@ -21,11 +21,11 @@
package org.apache.struts2.showcase.hangman;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.action.SessionAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.Map;
import org.apache.struts2.action.SessionAware;
public class GuessCharacterAction extends ActionSupport implements SessionAware {
private static final long serialVersionUID = 9050915577007590674L;
@@ -34,6 +34,7 @@ public class GuessCharacterAction extends ActionSupport implements SessionAware
private Character character;
private Hangman hangman;
@Override
public String execute() throws Exception {
hangman = (Hangman) session.get(HangmanConstants.HANGMAN_SESSION_KEY);
hangman.guess(character);
@@ -45,6 +46,7 @@ public class GuessCharacterAction extends ActionSupport implements SessionAware
return hangman;
}
@StrutsParameter
public void setCharacter(Character character) {
this.character = character;
}
@@ -22,6 +22,7 @@ package org.apache.struts2.showcase.modelDriven;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import org.apache.struts2.showcase.modelDriven.model.Gangster;
/**
* Action to demonstrate simple model-driven feature of the framework.
@@ -30,15 +31,18 @@ public class ModelDrivenAction extends ActionSupport implements ModelDriven {
private static final long serialVersionUID = 1271130427666936592L;
@Override
public String input() throws Exception {
return SUCCESS;
}
@Override
public String execute() throws Exception {
return SUCCESS;
}
public Object getModel() {
@Override
public Gangster getModel() {
return new Gangster();
}
}
@@ -18,7 +18,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.showcase.modelDriven;
package org.apache.struts2.showcase.modelDriven.model;
import java.io.Serializable;
@@ -23,10 +23,10 @@ package org.apache.struts2.showcase.person;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
@@ -42,13 +42,14 @@ public class EditPersonAction extends ActionSupport {
@Autowired
private PersonManager personManager;
private List<Person> persons = new ArrayList<Person>();
private List<Person> persons = new ArrayList<>();
/**
* A default implementation that does nothing an returns "success".
*
* @return {@link #INPUT}
*/
@Override
public String execute() throws Exception {
persons.addAll(personManager.getPeople());
return INPUT;
@@ -68,6 +69,7 @@ public class EditPersonAction extends ActionSupport {
return "list";
}
@StrutsParameter(depth = 2)
public List<Person> getPersons() {
return persons;
}
@@ -35,8 +35,9 @@ public class ListPeopleAction extends ActionSupport {
@Autowired
private PersonManager personManager;
private List<Person> people = new ArrayList<Person>();
private final List<Person> people = new ArrayList<>();
@Override
public String execute() {
people.addAll(personManager.getPeople());
@@ -23,6 +23,7 @@ package org.apache.struts2.showcase.person;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.springframework.beans.factory.annotation.Autowired;
@@ -38,12 +39,14 @@ public class NewPersonAction extends ActionSupport {
private PersonManager personManager;
private Person person;
@Override
public String execute() {
personManager.createPerson(person);
return "list";
}
@StrutsParameter(depth = 1)
public Person getPerson() {
return person;
}
@@ -23,6 +23,7 @@ package org.apache.struts2.showcase.source;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
import org.apache.struts2.action.ServletContextAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import javax.servlet.ServletContext;
import java.io.BufferedReader;
@@ -98,8 +99,9 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
/**
* @param className the className to set
*/
@StrutsParameter
public void setClassName(String className) {
if (className != null && className.trim().length() > 0) {
if (className != null && !className.trim().isEmpty()) {
this.className = className;
}
}
@@ -107,8 +109,9 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
/**
* @param config the config to set
*/
@StrutsParameter
public void setConfig(String config) {
if (config != null && config.trim().length() > 0) {
if (config != null && !config.trim().isEmpty()) {
this.config = config;
}
}
@@ -116,8 +119,9 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
/**
* @param page the page to set
*/
@StrutsParameter
public void setPage(String page) {
if (page != null && page.trim().length() > 0) {
if (page != null && !page.trim().isEmpty()) {
this.page = page;
}
}
@@ -125,6 +129,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
/**
* @param padding the padding to set
*/
@StrutsParameter
public void setPadding(int padding) {
this.padding = padding;
}
@@ -222,6 +227,7 @@ public class ViewSourceAction extends ActionSupport implements ServletContextAwa
return snippet;
}
@Override
public void withServletContext(ServletContext arg0) {
this.servletContext = arg0;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase.tag.nonui.actionPrefix;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class SubmitAction extends ActionSupport {
@@ -32,10 +33,12 @@ public class SubmitAction extends ActionSupport {
return text;
}
@StrutsParameter
public void setText(String text) {
this.text = text;
}
@Override
public String execute() throws Exception {
return SUCCESS;
}
@@ -23,8 +23,9 @@ import org.apache.struts2.dispatcher.PrepareOperations;
public class DebugTagAction extends ActionSupport {
@Override
public String execute() throws Exception {
PrepareOperations.overrideDevMode(true); // Just for Showcase, explicitly switch on for this action only
return SUCCESS;
}
}
}
@@ -22,6 +22,7 @@ package org.apache.struts2.showcase.tag.nonui.iteratortag;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Validateable;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
*
@@ -47,25 +48,25 @@ public class AppendIteratorTagDemo extends ActionSupport implements Validateable
}
}
public String getIteratorValue1() {
return iteratorValue1;
}
@StrutsParameter
public void setIteratorValue1(String iteratorValue1) {
this.iteratorValue1 = iteratorValue1;
}
public String getIteratorValue2() {
return iteratorValue2;
}
@StrutsParameter
public void setIteratorValue2(String iteratorValue2) {
this.iteratorValue2 = iteratorValue2;
}
@Override
public String input() throws Exception {
return SUCCESS;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase.tag.nonui.iteratortag;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
*/
@@ -37,34 +38,34 @@ public class IteratorGeneratorTagDemo extends ActionSupport {
return value;
}
@StrutsParameter
public void setValue(String value) {
this.value = value;
}
public Integer getCount() {
return count;
}
@StrutsParameter
public void setCount(Integer count) {
this.count = count;
}
public String getSeparator() {
return this.separator;
}
@StrutsParameter
public void setSeparator(String separator) {
this.separator = separator;
}
public String submit() throws Exception {
return SUCCESS;
}
@Override
public String input() throws Exception {
return SUCCESS;
}
@@ -22,6 +22,7 @@ package org.apache.struts2.showcase.tag.nonui.iteratortag;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Validateable;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
@@ -33,7 +34,7 @@ public class MergeIteratorTagDemo extends ActionSupport implements Validateable
private String iteratorValue1;
private String iteratorValue2;
@Override
public void validate() {
if (iteratorValue1 == null || iteratorValue1.trim().length() <= 0) {
addFieldError("iteratorValue1", "iterator value 1 cannot be empty");
@@ -47,25 +48,25 @@ public class MergeIteratorTagDemo extends ActionSupport implements Validateable
}
}
public String getIteratorValue1() {
return this.iteratorValue1;
}
@StrutsParameter
public void setIteratorValue1(String iteratorValue1) {
this.iteratorValue1 = iteratorValue1;
}
public String getIteratorValue2() {
return this.iteratorValue2;
}
@StrutsParameter
public void setIteratorValue2(String iteratorValue2) {
this.iteratorValue2 = iteratorValue2;
}
@Override
public String input() throws Exception {
return SUCCESS;
}
@@ -22,6 +22,7 @@ package org.apache.struts2.showcase.tag.nonui.iteratortag;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Validateable;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
*
@@ -34,7 +35,7 @@ public class SubsetIteratorTagDemo extends ActionSupport implements Validateable
private Integer count;
private Integer start;
@Override
public void validate() {
if (iteratorValue == null || iteratorValue.trim().length() <= 0) {
addFieldError("iteratorValue1", "iterator value 1 cannot be empty");
@@ -43,34 +44,34 @@ public class SubsetIteratorTagDemo extends ActionSupport implements Validateable
}
}
public String getIteratorValue() {
return this.iteratorValue;
}
@StrutsParameter
public void setIteratorValue(String iteratorValue) {
this.iteratorValue = iteratorValue;
}
public Integer getCount() {
return this.count;
}
@StrutsParameter
public void setCount(Integer count) {
this.count = count;
}
public Integer getStart() {
return this.start;
}
@StrutsParameter
public void setStart(Integer start) {
this.start = start;
}
@Override
public String input() throws Exception {
return SUCCESS;
}
@@ -78,6 +79,4 @@ public class SubsetIteratorTagDemo extends ActionSupport implements Validateable
public String submit() throws Exception {
return SUCCESS;
}
}
@@ -22,6 +22,7 @@ package org.apache.struts2.showcase.token;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.util.Date;
@@ -76,6 +77,7 @@ public class TokenAction extends ActionSupport {
return amount;
}
@StrutsParameter
public void setAmount(int amount) {
this.amount = amount;
}
@@ -30,6 +30,7 @@ public abstract class AbstractValidationActionSupport extends ActionSupport {
return "success";
}
@Override
public String input() throws Exception {
return "input";
}
@@ -18,8 +18,6 @@
*/
package org.apache.struts2.showcase.validation;
import java.sql.Date;
import com.opensymphony.xwork2.validator.annotations.DateRangeFieldValidator;
import com.opensymphony.xwork2.validator.annotations.EmailValidator;
import com.opensymphony.xwork2.validator.annotations.FieldExpressionValidator;
@@ -29,6 +27,9 @@ import com.opensymphony.xwork2.validator.annotations.RequiredFieldValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
import com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator;
import com.opensymphony.xwork2.validator.annotations.UrlValidator;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.sql.Date;
/**
* <!-- START SNIPPET: ajaxFormSubmit -->
@@ -72,9 +73,10 @@ public class AjaxFormSubmitAction extends AbstractValidationActionSupport {
}
@DateRangeFieldValidator(
min="01/01/1990",
max="01/01/2000",
min="01/01/1990",
max="01/01/2000",
message="must be a min 01-01-1990 max 01-01-2000 if supplied")
@StrutsParameter
public void setDateValidatorField(Date dateValidatorField) {
this.dateValidatorField = dateValidatorField;
}
@@ -84,6 +86,7 @@ public class AjaxFormSubmitAction extends AbstractValidationActionSupport {
}
@EmailValidator(message="must be a valid email if supplied")
@StrutsParameter
public void setEmailValidatorField(String emailValidatorField) {
this.emailValidatorField = emailValidatorField;
}
@@ -93,6 +96,7 @@ public class AjaxFormSubmitAction extends AbstractValidationActionSupport {
}
@IntRangeFieldValidator(min="1", max="10", message="must be integer min 1 max 10 if supplied")
@StrutsParameter
public void setIntegerValidatorField(Integer integerValidatorField) {
this.integerValidatorField = integerValidatorField;
}
@@ -102,8 +106,9 @@ public class AjaxFormSubmitAction extends AbstractValidationActionSupport {
}
@RegexFieldValidator(
regex="[^<>]+",
regex="[^<>]+",
message="regexValidatorField must match a regexp (.*\\.txt) if specified")
@StrutsParameter
public void setRegexValidatorField(String regexValidatorField) {
this.regexValidatorField = regexValidatorField;
}
@@ -113,6 +118,7 @@ public class AjaxFormSubmitAction extends AbstractValidationActionSupport {
}
@RequiredStringValidator(trim=true, message="required and must be string")
@StrutsParameter
public void setRequiredStringValidatorField(String requiredStringValidatorField) {
this.requiredStringValidatorField = requiredStringValidatorField;
}
@@ -122,6 +128,7 @@ public class AjaxFormSubmitAction extends AbstractValidationActionSupport {
}
@RequiredFieldValidator(message="required")
@StrutsParameter
public void setRequiredValidatorField(String requiredValidatorField) {
this.requiredValidatorField = requiredValidatorField;
}
@@ -131,10 +138,11 @@ public class AjaxFormSubmitAction extends AbstractValidationActionSupport {
}
@StringLengthFieldValidator(
minLength="2",
maxLength="4",
trim=true,
minLength="2",
maxLength="4",
trim=true,
message="must be a String of a specific greater than 1 less than 5 if specified")
@StrutsParameter
public void setStringLengthValidatorField(String stringLengthValidatorField) {
this.stringLengthValidatorField = stringLengthValidatorField;
}
@@ -144,10 +152,10 @@ public class AjaxFormSubmitAction extends AbstractValidationActionSupport {
}
@FieldExpressionValidator(
expression = "(fieldExpressionValidatorField == requiredValidatorField)",
expression = "(fieldExpressionValidatorField == requiredValidatorField)",
message = "must be the same as the Required Validator Field if specified")
public void setFieldExpressionValidatorField(
String fieldExpressionValidatorField) {
@StrutsParameter
public void setFieldExpressionValidatorField(String fieldExpressionValidatorField) {
this.fieldExpressionValidatorField = fieldExpressionValidatorField;
}
@@ -156,6 +164,7 @@ public class AjaxFormSubmitAction extends AbstractValidationActionSupport {
}
@UrlValidator(message="must be a valid url if supplied")
@StrutsParameter
public void setUrlValidatorField(String urlValidatorField) {
this.urlValidatorField = urlValidatorField;
}
@@ -26,6 +26,7 @@ import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.interceptor.validation.SkipValidation;
import org.hibernate.validator.constraints.ScriptAssert;
import org.hibernate.validator.constraints.URL;
@@ -95,6 +96,7 @@ public class BeanValidationExampleAction extends ActionSupport {
return dateValidatorField;
}
@StrutsParameter
public void setDateValidatorField(Date dateValidatorField) {
this.dateValidatorField = dateValidatorField;
}
@@ -103,6 +105,7 @@ public class BeanValidationExampleAction extends ActionSupport {
return emailValidatorField;
}
@StrutsParameter
public void setEmailValidatorField(String emailValidatorField) {
this.emailValidatorField = emailValidatorField;
}
@@ -111,6 +114,7 @@ public class BeanValidationExampleAction extends ActionSupport {
return integerValidatorField;
}
@StrutsParameter
public void setIntegerValidatorField(Integer integerValidatorField) {
this.integerValidatorField = integerValidatorField;
}
@@ -119,6 +123,7 @@ public class BeanValidationExampleAction extends ActionSupport {
return regexValidatorField;
}
@StrutsParameter
public void setRegexValidatorField(String regexValidatorField) {
this.regexValidatorField = regexValidatorField;
}
@@ -127,6 +132,7 @@ public class BeanValidationExampleAction extends ActionSupport {
return requiredStringValidatorField;
}
@StrutsParameter
public void setRequiredStringValidatorField(String requiredStringValidatorField) {
this.requiredStringValidatorField = requiredStringValidatorField;
}
@@ -135,6 +141,7 @@ public class BeanValidationExampleAction extends ActionSupport {
return requiredValidatorField;
}
@StrutsParameter
public void setRequiredValidatorField(String requiredValidatorField) {
this.requiredValidatorField = requiredValidatorField;
}
@@ -143,6 +150,7 @@ public class BeanValidationExampleAction extends ActionSupport {
return stringLengthValidatorField;
}
@StrutsParameter
public void setStringLengthValidatorField(String stringLengthValidatorField) {
this.stringLengthValidatorField = stringLengthValidatorField;
}
@@ -151,8 +159,8 @@ public class BeanValidationExampleAction extends ActionSupport {
return fieldExpressionValidatorField;
}
public void setFieldExpressionValidatorField(
String fieldExpressionValidatorField) {
@StrutsParameter
public void setFieldExpressionValidatorField(String fieldExpressionValidatorField) {
this.fieldExpressionValidatorField = fieldExpressionValidatorField;
}
@@ -160,6 +168,7 @@ public class BeanValidationExampleAction extends ActionSupport {
return urlValidatorField;
}
@StrutsParameter
public void setUrlValidatorField(String urlValidatorField) {
this.urlValidatorField = urlValidatorField;
}
@@ -20,6 +20,8 @@
*/
package org.apache.struts2.showcase.validation;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
*/
@@ -37,6 +39,7 @@ public class NonFieldValidatorsExampleAction extends AbstractValidationActionSup
return someText;
}
@StrutsParameter
public void setSomeText(String someText) {
this.someText = someText;
}
@@ -45,6 +48,7 @@ public class NonFieldValidatorsExampleAction extends AbstractValidationActionSup
return someTextRetype;
}
@StrutsParameter
public void setSomeTextRetype(String someTextRetype) {
this.someTextRetype = someTextRetype;
}
@@ -53,6 +57,7 @@ public class NonFieldValidatorsExampleAction extends AbstractValidationActionSup
return someTextRetypeAgain;
}
@StrutsParameter
public void setSomeTextRetypeAgain(String someTextRetypeAgain) {
this.someTextRetypeAgain = someTextRetypeAgain;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase.validation;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
*/
@@ -39,6 +40,7 @@ public class QuizAction extends ActionSupport {
return name;
}
@StrutsParameter
public void setName(String name) {
this.name = name;
}
@@ -47,6 +49,7 @@ public class QuizAction extends ActionSupport {
return age;
}
@StrutsParameter
public void setAge(int age) {
this.age = age;
}
@@ -55,6 +58,7 @@ public class QuizAction extends ActionSupport {
return answer;
}
@StrutsParameter
public void setAnswer(String answer) {
this.answer = answer;
}
@@ -21,6 +21,7 @@
package org.apache.struts2.showcase.validation;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
/**
* @version $Date$ $Id$
@@ -30,6 +31,7 @@ public class SubmitApplication extends ActionSupport {
private String name;
private Integer age;
@StrutsParameter
public void setName(String name) {
this.name = name;
}
@@ -38,6 +40,7 @@ public class SubmitApplication extends ActionSupport {
return this.name;
}
@StrutsParameter
public void setAge(Integer age) {
this.age = age;
}
@@ -23,12 +23,15 @@ package org.apache.struts2.showcase.validation;
// START SNIPPET: visitorValidatorsExample
import org.apache.struts2.interceptor.parameter.StrutsParameter;
public class VisitorValidatorsExampleAction extends AbstractValidationActionSupport {
private static final long serialVersionUID = 4375454086939598216L;
private User user;
@StrutsParameter(depth = 1)
public User getUser() {
return user;
}
@@ -21,11 +21,9 @@
package org.apache.struts2.showcase.xslt;
import com.opensymphony.xwork2.ActionSupport;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts2.action.ServletRequestAware;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
import java.util.Properties;
@@ -72,7 +70,7 @@ public class JVMAction implements ServletRequestAware {
this.info = info;
}
public class ImportantInfo {
public static class ImportantInfo {
private String classpath;
private Properties systemProperties;
@@ -40,7 +40,7 @@
</action>
<action name="doMultipleUploadUsingList" class="org.apache.struts2.showcase.fileupload.MultipleFileUploadUsingListAction" method="upload">
<result name="input">/WEB-INF/fileupload/multipleUploadUsingList.jsp</result>
<result name="input">/WEB-INF/fileupload/multipleUploadUsingList.jsp</result>
<result>/WEB-INF/fileupload/multiple-success.jsp</result>
</action>
@@ -50,7 +50,7 @@
</action>
<action name="doMultipleUploadUsingArray" class="org.apache.struts2.showcase.fileupload.MultipleFileUploadUsingArrayAction" method="upload">
<result name="input">/WEB-INF/fileupload/multipleUploadUsingArray.jsp</result>
<result name="input">/WEB-INF/fileupload/multipleUploadUsingArray.jsp</result>
<result>/WEB-INF/fileupload/multiple-success.jsp</result>
</action>
@@ -36,6 +36,15 @@
<constant name="struts.allowlist.enable" value="true" />
<constant name="struts.parameters.requireAnnotations" value="true" />
<constant name="struts.allowlist.packageNames" value="
org.apache.struts2.showcase.model,
org.apache.struts2.showcase.modelDriven.model
"/>
<constant name="struts.allowlist.classes" value="
org.apache.struts2.showcase.hangman.Hangman,
org.apache.struts2.showcase.hangman.HangmanConstants,
org.apache.struts2.showcase.hangman.Vocab
"/>
<constant name="struts.convention.package.locators.basePackage" value="org.apache.struts2.showcase" />
<constant name="struts.convention.result.path" value="/WEB-INF" />
@@ -41,7 +41,8 @@
<li>FileName: <s:property value="fileName" /></li>
<li>Original FileName: <s:property value="originalName" /></li>
<li>File: <s:property value="uploadedFile" /></li>
<li>Caption:<s:property value="caption" /></li>
<li>Caption: <s:property value="caption" /></li>
<li id="input-name">Input name: <s:property value="inputName" /></li>
</ul>
</div>
</div>
@@ -0,0 +1,88 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package it.org.apache.struts2.showcase;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class ConventionTest {
private WebClient webClient;
@Before
public void setUp() throws Exception {
webClient = new WebClient();
}
@After
public void tearDown() throws Exception {
webClient.close();
}
@Test
public void listPeople() throws Exception {
HtmlPage page = webClient.getPage(ParameterUtils.getBaseUrl() + "/person/list-people.action");
assertThat(page.asNormalizedText()).contains(
"3\tAlexandru\tPapesco\n" +
"4\tJay\tBoss\n" +
"5\tRainer\tHermanos\n"
);
}
@Test
public void editPeople() throws Exception {
HtmlPage page = webClient.getPage(ParameterUtils.getBaseUrl() + "/person/edit-person.action");
HtmlForm form = page.getForms().get(0);
form.getInputByName("persons(1).name").setValue("Lukasz");
form.getInputByName("persons(1).lastName").setValue("Lenart");
form.getInputByName("persons(2).name").setValue("Kusal");
form.getInputByName("persons(2).lastName").setValue("Kithul-Godage");
HtmlSubmitInput button = form.getInputByValue("Save all persons");
page = button.click();
assertThat(page.asNormalizedText()).contains(
"1\tLukasz\tLenart\n" +
"2\tKusal\tKithul-Godage\n"
);
}
@Test
public void createPerson() throws Exception {
HtmlPage page = webClient.getPage(ParameterUtils.getBaseUrl() + "/person/new-person!input.action");
HtmlForm form = page.getForms().get(0);
form.getInputByName("person.name").type("Lukasz");
form.getInputByName("person.lastName").type("Lenart");
HtmlSubmitInput button = form.getInputByValue("Create person");
page = button.click();
assertThat(page.asNormalizedText()).contains("6\tLukasz\tLenart\n");
}
}
@@ -25,10 +25,14 @@ import com.gargoylesoftware.htmlunit.html.HtmlForm;
import com.gargoylesoftware.htmlunit.html.HtmlInput;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
import org.junit.Assert;
import org.junit.Test;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
public class FileUploadTest {
@@ -45,9 +49,31 @@ public class FileUploadTest {
uploadInput.setValueAttribute(tempFile.getAbsolutePath());
final HtmlSubmitInput button = form.getInputByValue("Submit");
final HtmlPage resultPage = button.click();
DomElement errorMessage = resultPage.getFirstByXPath("//span[@class='errorMessage']");
Assert.assertNotNull(errorMessage);
Assert.assertEquals("File cannot be empty", errorMessage.getVisibleText());
assertNotNull(errorMessage);
assertEquals("File cannot be empty", errorMessage.getVisibleText());
}
}
@Test
public void testFileUpload() throws Exception {
try (final WebClient webClient = new WebClient()) {
final HtmlPage page = webClient.getPage(ParameterUtils.getBaseUrl() + "/fileupload/doUpload.action");
final HtmlForm form = page.getFormByName("doUpload");
HtmlInput captionInput = form.getInputByName("caption");
HtmlFileInput uploadInput = form.getInputByName("upload");
captionInput.type("some caption");
File tempFile = File.createTempFile("testEmptyFile", ".tmp");
Files.write(Paths.get(tempFile.toURI()), "some content".getBytes());
tempFile.deleteOnExit();
uploadInput.setValueAttribute(tempFile.getAbsolutePath());
final HtmlSubmitInput button = form.getInputByValue("Submit");
final HtmlPage resultPage = button.click();
DomElement inputName = resultPage.getElementById("input-name");
assertNotNull(inputName);
assertEquals("Input name: upload", inputName.getTextContent().trim());
}
}
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>6.5.0</version>
<version>6.7.4</version>
</parent>
<artifactId>struts2-assembly</artifactId>
+4 -4
View File
@@ -25,11 +25,11 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>6.5.0</version>
<version>6.7.4</version>
</parent>
<artifactId>struts2-bom</artifactId>
<version>6.5.0</version>
<version>6.7.4</version>
<packaging>pom</packaging>
<name>Struts 2 Bill of Materials</name>
@@ -44,7 +44,7 @@
</licenses>
<properties>
<struts-version.version>6.5.0</struts-version.version>
<struts-version.version>6.7.4</struts-version.version>
<maven.site.skip>true</maven.site.skip>
<maven.site.deploy.skip>true</maven.site.deploy.skip>
</properties>
@@ -190,7 +190,7 @@
</dependencyManagement>
<scm>
<tag>STRUTS_6_5_0</tag>
<tag>STRUTS_6_7_4</tag>
<connection>scm:git:https://gitbox.apache.org/repos/asf/struts.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/struts.git</developerConnection>
<url>https://github.com/apache/struts/</url>
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>6.5.0</version>
<version>6.7.4</version>
</parent>
<artifactId>struts2-osgi-admin-bundle</artifactId>
@@ -25,10 +25,11 @@ import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.config.Configuration;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.osgi.BundleAccessor;
import org.apache.struts2.osgi.host.OsgiHost;
import org.apache.struts2.osgi.StrutsOsgiListener;
import org.apache.struts2.action.ServletContextAware;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.osgi.BundleAccessor;
import org.apache.struts2.osgi.StrutsOsgiListener;
import org.apache.struts2.osgi.host.OsgiHost;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleException;
@@ -36,9 +37,8 @@ import javax.servlet.ServletContext;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
public class BundlesAction extends ActionSupport implements ServletContextAware {
@@ -114,6 +114,7 @@ public class BundlesAction extends ActionSupport implements ServletContextAware
return id;
}
@StrutsParameter
public void setId(String id) {
this.id = id;
}
@@ -21,25 +21,25 @@
package org.apache.struts2.osgi.admin.actions;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.felix.shell.ShellService;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.osgi.DefaultBundleAccessor;
import org.apache.struts2.osgi.interceptor.BundleContextAware;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
/**
* This action executes commands on the Felix Shell.
*
*
* The action is BundleContextAware so that if the OSGi interceptor is used the BundleContext
* can be provided for configurations where the DefaultBundleAccessor is insufficient.
*
*
*/
public class ShellAction extends ActionSupport implements BundleContextAware {
private String command;
@@ -77,6 +77,7 @@ public class ShellAction extends ActionSupport implements BundleContextAware {
return command;
}
@StrutsParameter
public void setCommand(String command) {
this.command = command;
}
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-osgi-bundles</artifactId>
<version>6.5.0</version>
<version>6.7.4</version>
</parent>
<artifactId>struts2-osgi-demo-bundle</artifactId>
@@ -33,6 +33,7 @@ import org.osgi.framework.BundleContext;
public class BundlesAction extends ActionSupport implements BundleContextAware {
private BundleContext bundleContext;
@Override
public void withBundleContext(BundleContext bundleContext) {
this.bundleContext = bundleContext;
}
@@ -26,6 +26,7 @@ import org.apache.struts2.convention.annotation.Actions;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.ResultPath;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
@Namespace("/osgi")
@ResultPath("/content/osgi")
@@ -41,6 +42,7 @@ public class HelloWorldAction extends ActionSupport {
return SUCCESS;
}
@StrutsParameter(depth = 1)
public Message getMessage() {
return message;
}
@@ -60,4 +62,4 @@ public class HelloWorldAction extends ActionSupport {
sb.append("}");
return sb.toString();
}
}
}
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>6.5.0</version>
<version>6.7.4</version>
</parent>
<artifactId>struts2-osgi-bundles</artifactId>
+1 -1
View File
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-parent</artifactId>
<version>6.5.0</version>
<version>6.7.4</version>
</parent>
<artifactId>struts2-core</artifactId>
<packaging>jar</packaging>
@@ -19,70 +19,10 @@
package com.opensymphony.xwork2;
/**
* All actions <b>may</b> implement this interface, which exposes the <code>execute()</code> method.
* <p>
* However, as of XWork 1.1, this is <b>not</b> required and is only here to assist users. You are free to create POJOs
* that honor the same contract defined by this interface without actually implementing the interface.
* </p>
* {@inheritDoc}
*
* @deprecated since 6.7.0, use {@link org.apache.struts2.action.Action} instead.
*/
public interface Action {
/**
* The action execution was successful. Show result
* view to the end user.
*/
public static final String SUCCESS = "success";
/**
* The action execution was successful but do not
* show a view. This is useful for actions that are
* handling the view in another fashion like redirect.
*/
public static final String NONE = "none";
/**
* The action execution was a failure.
* Show an error view, possibly asking the
* user to retry entering data.
*/
public static final String ERROR = "error";
/**
* <p>
* The action execution require more input
* in order to succeed.
* This result is typically used if a form
* handling action has been executed so as
* to provide defaults for a form. The
* form associated with the handler should be
* shown to the end user.
* </p>
*
* <p>
* This result is also used if the given input
* params are invalid, meaning the user
* should try providing input again.
* </p>
*/
public static final String INPUT = "input";
/**
* The action could not execute, since the
* user most was not logged in. The login view
* should be shown.
*/
public static final String LOGIN = "login";
/**
* Where the logic of the action is executed.
*
* @return a string representing the logical result of the execution.
* See constants in this interface for a list of standard result values.
* @throws Exception thrown if a system level exception occurs.
* <b>Note:</b> Application level exceptions should be handled by returning
* an error value, such as <code>Action.ERROR</code>.
*/
public String execute() throws Exception;
@Deprecated
public interface Action extends org.apache.struts2.action.Action {
}
@@ -18,263 +18,21 @@
*/
package com.opensymphony.xwork2;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.TextParseUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.StrutsException;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
/**
* <!-- START SNIPPET: description -->
*
* This result invokes an entire other action, complete with it's own interceptor stack and result.
*
* <!-- END SNIPPET: description -->
*
* <b>This result type takes the following parameters:</b>
*
* <!-- START SNIPPET: params -->
*
* <ul>
*
* <li><b>actionName (default)</b> - the name of the action that will be chained to</li>
*
* <li><b>namespace</b> - used to determine which namespace the Action is in that we're chaining. If namespace is null,
* this defaults to the current namespace</li>
*
* <li><b>method</b> - used to specify another method on target action to be invoked.
* If null, this defaults to execute method</li>
*
* <li><b>skipActions</b> - (optional) the list of comma separated action names for the
* actions that could be chained to</li>
*
* </ul>
*
* <!-- END SNIPPET: params -->
*
* <b>Example:</b>
*
* <pre><!-- START SNIPPET: example -->
* &lt;package name="public" extends="struts-default"&gt;
* &lt;!-- Chain creatAccount to login, using the default parameter --&gt;
* &lt;action name="createAccount" class="..."&gt;
* &lt;result type="chain"&gt;login&lt;/result&gt;
* &lt;/action&gt;
*
* &lt;action name="login" class="..."&gt;
* &lt;!-- Chain to another namespace --&gt;
* &lt;result type="chain"&gt;
* &lt;param name="actionName"&gt;dashboard&lt;/param&gt;
* &lt;param name="namespace"&gt;/secure&lt;/param&gt;
* &lt;/result&gt;
* &lt;/action&gt;
* &lt;/package&gt;
*
* &lt;package name="secure" extends="struts-default" namespace="/secure"&gt;
* &lt;action name="dashboard" class="..."&gt;
* &lt;result&gt;dashboard.jsp&lt;/result&gt;
* &lt;/action&gt;
* &lt;/package&gt;
* <!-- END SNIPPET: example --></pre>
*
* @author <a href='mailto:the_mindstorm[at]evolva[dot]ro'>Alexandru Popescu</a>
*/
public class ActionChainResult implements Result {
private static final Logger LOG = LogManager.getLogger(ActionChainResult.class);
/**
* The result parameter name to set the name of the action to chain to.
*/
public static final String DEFAULT_PARAM = "actionName";
/**
* The action context key to save the chain history.
*/
private static final String CHAIN_HISTORY = "CHAIN_HISTORY";
private ActionProxy proxy;
private String actionName;
private String namespace;
private String methodName;
/**
* The list of actions to skip.
*/
private String skipActions;
private ActionProxyFactory actionProxyFactory;
* @deprecated since 6.7.0, use {@link org.apache.struts2.result.ActionChainResult} instead.
*/
@Deprecated
public class ActionChainResult extends org.apache.struts2.result.ActionChainResult {
public ActionChainResult() {
super();
}
public ActionChainResult(String namespace, String actionName, String methodName) {
this.namespace = namespace;
this.actionName = actionName;
this.methodName = methodName;
super(namespace, actionName, methodName);
}
public ActionChainResult(String namespace, String actionName, String methodName, String skipActions) {
this.namespace = namespace;
this.actionName = actionName;
this.methodName = methodName;
this.skipActions = skipActions;
}
/**
* @param actionProxyFactory the actionProxyFactory to set
*/
@Inject
public void setActionProxyFactory(ActionProxyFactory actionProxyFactory) {
this.actionProxyFactory = actionProxyFactory;
}
/**
* Set the action name.
*
* @param actionName The action name.
*/
public void setActionName(String actionName) {
this.actionName = actionName;
}
/**
* sets the namespace of the Action that we're chaining to. if namespace
* is null, this defaults to the current namespace.
*
* @param namespace the name of the namespace we're chaining to
*/
public void setNamespace(String namespace) {
this.namespace = namespace;
}
/**
* Set the list of actions to skip.
* To test if an action should not throe an infinite recursion,
* only the action name is used, not the namespace.
*
* @param actions The list of action name separated by a white space.
*/
public void setSkipActions(String actions) {
this.skipActions = actions;
}
public void setMethod(String method) {
this.methodName = method;
}
public ActionProxy getProxy() {
return proxy;
}
/**
* Get the XWork chain history.
* The stack is a list of <code>namespace/action!method</code> keys.
*
* @return the chain history as string list
*/
public static LinkedList<String> getChainHistory() {
LinkedList<String> chainHistory = (LinkedList<String>) ActionContext.getContext().get(CHAIN_HISTORY);
// Add if not exists
if (chainHistory == null) {
chainHistory = new LinkedList<>();
ActionContext.getContext().put(CHAIN_HISTORY, chainHistory);
}
return chainHistory;
}
/**
* @param invocation the DefaultActionInvocation calling the action call stack
*/
public void execute(ActionInvocation invocation) throws Exception {
if (invocation == null) {
throw new IllegalArgumentException("Invocation cannot be null!");
}
String finalNamespace = namespace != null ? translateVariables(namespace) : invocation.getProxy()
.getNamespace();
String finalActionName = translateVariables(actionName);
String finalMethodName = methodName != null ? translateVariables(methodName) : null;
if (isInChainHistory(finalNamespace, finalActionName, finalMethodName)) {
addToHistory(finalNamespace, finalActionName, finalMethodName);
throw new StrutsException("Infinite recursion detected: " + ActionChainResult.getChainHistory());
}
if (ActionChainResult.getChainHistory().isEmpty() && invocation.getProxy() != null) {
addToHistory(finalNamespace, invocation.getProxy().getActionName(), invocation.getProxy().getMethod());
}
addToHistory(finalNamespace, finalActionName, finalMethodName);
Map<String, Object> extraContext = ActionContext.of()
.withValueStack(invocation.getInvocationContext().getValueStack())
.withParameters(invocation.getInvocationContext().getParameters())
.with(CHAIN_HISTORY, ActionChainResult.getChainHistory())
.getContextMap();
LOG.debug("Chaining to action {}", finalActionName);
proxy = actionProxyFactory.createActionProxy(finalNamespace, finalActionName, finalMethodName, extraContext);
proxy.execute();
}
protected String translateVariables(String text) {
return TextParseUtil.translateVariables(text, ActionContext.getContext().getValueStack());
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ActionChainResult that = (ActionChainResult) o;
return Objects.equals(actionName, that.actionName) && Objects.equals(methodName,
that.methodName) && Objects.equals(namespace, that.namespace);
}
@Override
public int hashCode() {
int result;
result = (actionName != null ? actionName.hashCode() : 0);
result = 31 * result + (namespace != null ? namespace.hashCode() : 0);
result = 31 * result + (methodName != null ? methodName.hashCode() : 0);
return result;
}
private boolean isInChainHistory(String namespace, String actionName, String methodName) {
LinkedList<? extends String> chainHistory = ActionChainResult.getChainHistory();
Set<String> skipActionsList = new HashSet<>();
if (skipActions != null && skipActions.length() > 0) {
String finalSkipActions = translateVariables(skipActions);
skipActionsList.addAll(TextParseUtil.commaDelimitedStringToSet(finalSkipActions));
}
if (!skipActionsList.contains(actionName)) {
return chainHistory.contains(makeKey(namespace, actionName, methodName));
}
return false;
}
private void addToHistory(String namespace, String actionName, String methodName) {
List<String> chainHistory = ActionChainResult.getChainHistory();
chainHistory.add(makeKey(namespace, actionName, methodName));
}
private String makeKey(String namespace, String actionName, String methodName) {
return namespace + "/" + actionName + (methodName != null ? "!" + methodName : "");
super(namespace, actionName, methodName, skipActions);
}
}
@@ -21,8 +21,6 @@ package com.opensymphony.xwork2;
import com.opensymphony.xwork2.conversion.impl.ConversionData;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.StrutsException;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.dispatcher.HttpParameters;
import org.apache.struts2.dispatcher.mapper.ActionMapping;
@@ -30,515 +28,249 @@ import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.PageContext;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/**
* <p>
* The ActionContext is the context in which an {@link Action} is executed. Each context is basically a
* container of objects an action needs for execution like the session, parameters, locale, etc.
* </p>
* {@inheritDoc}
*
* <p>
* The ActionContext is thread local which means that values stored in the ActionContext are
* unique per thread. See the {@link ThreadLocal} class for more information. The benefit of
* this is you don't need to worry about a user specific action context, you just get it:
* </p>
*
* <code>ActionContext context = ActionContext.getContext();</code>
*
* <p>
* Finally, because of the thread local usage you don't need to worry about making your actions thread safe.
* </p>
*
* @author Patrick Lightbody
* @author Bill Lynch (docs)
* @deprecated since 6.7.0, use {@link org.apache.struts2.ActionContext} instead.
*/
public class ActionContext implements Serializable {
@Deprecated
public class ActionContext extends org.apache.struts2.ActionContext {
private static final ThreadLocal<ActionContext> actionContext = new ThreadLocal<>();
/**
* Constant for the name of the action being executed.
*/
private static final String ACTION_NAME = "org.apache.struts2.ActionContext.name";
/**
* Constant for the {@link com.opensymphony.xwork2.util.ValueStack OGNL value stack}.
*/
private static final String VALUE_STACK = ValueStack.VALUE_STACK;
/**
* Constant for the action's session.
*/
private static final String SESSION = "org.apache.struts2.ActionContext.session";
/**
* Constant for the action's application context.
*/
private static final String APPLICATION = "org.apache.struts2.ActionContext.application";
/**
* Constant for the action's parameters.
*/
private static final String PARAMETERS = "org.apache.struts2.ActionContext.parameters";
/**
* Constant for the action's locale.
*/
private static final String LOCALE = "org.apache.struts2.ActionContext.locale";
/**
* Constant for the action's {@link com.opensymphony.xwork2.ActionInvocation invocation} context.
*/
private static final String ACTION_INVOCATION = "org.apache.struts2.ActionContext.actionInvocation";
/**
* Constant for the map of type conversion errors.
*/
private static final String CONVERSION_ERRORS = "org.apache.struts2.ActionContext.conversionErrors";
/**
* Constant for the container
*/
private static final String CONTAINER = "org.apache.struts2.ActionContext.container";
private final Map<String, Object> context;
/**
* Creates a new ActionContext initialized with another context.
*
* @param context a context map.
*/
protected ActionContext(Map<String, Object> context) {
this.context = context;
private ActionContext(org.apache.struts2.ActionContext actualContext) {
super(actualContext.getContextMap());
}
/**
* Creates a new ActionContext based on passed in Map
*
* @param context a map with context values
* @return new ActionContext
*/
public static ActionContext of(Map<String, Object> context) {
if (context == null) {
throw new IllegalArgumentException("Context cannot be null!");
public static ActionContext adapt(org.apache.struts2.ActionContext actualContext) {
if (actualContext instanceof ActionContext) {
return (ActionContext) actualContext;
}
return new ActionContext(context);
return actualContext != null ? new ActionContext(actualContext) : null;
}
public static ActionContext of(Map<String, Object> context) {
return adapt(org.apache.struts2.ActionContext.of(context));
}
/**
* Creates a new ActionContext based on empty Map
*
* @return new ActionContext
*/
public static ActionContext of() {
return of(new HashMap<>());
return adapt(org.apache.struts2.ActionContext.of());
}
/**
* Binds the provided context with the current thread
*
* @param actionContext context to bind to the thread
* @return context which was bound to the thread
*/
public static ActionContext bind(ActionContext actionContext) {
ActionContext.setContext(actionContext);
return ActionContext.getContext();
return adapt(org.apache.struts2.ActionContext.bind(actionContext));
}
public static boolean containsValueStack(Map<String, Object> context) {
return context != null && context.containsKey(VALUE_STACK);
return org.apache.struts2.ActionContext.containsValueStack(context);
}
/**
* Binds this context with the current thread
*
* @return this context which was bound to the thread
*/
public ActionContext bind() {
ActionContext.setContext(this);
return ActionContext.getContext();
}
/**
* Wipes out current ActionContext, use wisely!
*/
public static void clear() {
actionContext.remove();
org.apache.struts2.ActionContext.clear();
}
/**
* Sets the action context for the current thread.
*
* @param context the action context.
*/
private static void setContext(ActionContext context) {
actionContext.set(context);
}
/**
* Returns the ActionContext specific to the current thread.
*
* @return the ActionContext for the current thread, is never <tt>null</tt>.
*/
public static ActionContext getContext() {
return actionContext.get();
return adapt(org.apache.struts2.ActionContext.getContext());
}
@Override
public ActionContext bind() {
super.bind();
return this;
}
/**
* Sets the action invocation (the execution state).
*
* @param actionInvocation the action execution state.
*/
public ActionContext withActionInvocation(ActionInvocation actionInvocation) {
put(ACTION_INVOCATION, actionInvocation);
return withActionInvocation((org.apache.struts2.ActionInvocation) actionInvocation);
}
@Override
public ActionContext withActionInvocation(org.apache.struts2.ActionInvocation actionInvocation) {
super.withActionInvocation(actionInvocation);
return this;
}
/**
* Gets the action invocation (the execution state).
*
* @return the action invocation (the execution state).
*/
@Override
public ActionInvocation getActionInvocation() {
return (ActionInvocation) get(ACTION_INVOCATION);
return ActionInvocation.adapt(super.getActionInvocation());
}
/**
* Sets the action's application context.
*
* @param application the action's application context.
*/
@Override
public ActionContext withApplication(Map<String, Object> application) {
put(APPLICATION, application);
super.withApplication(application);
return this;
}
/**
* Returns a Map of the ServletContext when in a servlet environment or a generic application level Map otherwise.
*
* @return a Map of ServletContext or generic application level Map
*/
@SuppressWarnings("unchecked")
@Override
public Map<String, Object> getApplication() {
return (Map<String, Object>) get(APPLICATION);
return super.getApplication();
}
/**
* Gets the context map.
*
* @return the context map.
*/
@Override
public Map<String, Object> getContextMap() {
return context;
return super.getContextMap();
}
/**
* Sets conversion errors which occurred when executing the action.
*
* @param conversionErrors a Map of errors which occurred when executing the action.
*/
@Override
public ActionContext withConversionErrors(Map<String, ConversionData> conversionErrors) {
put(CONVERSION_ERRORS, conversionErrors);
super.withConversionErrors(conversionErrors);
return this;
}
/**
* Gets the map of conversion errors which occurred when executing the action.
*
* @return the map of conversion errors which occurred when executing the action or an empty map if
* there were no errors.
*/
@SuppressWarnings("unchecked")
@Override
public Map<String, ConversionData> getConversionErrors() {
Map<String, ConversionData> errors = (Map<String, ConversionData>) get(CONVERSION_ERRORS);
if (errors == null) {
errors = withConversionErrors(new HashMap<>()).getConversionErrors();
}
return errors;
return super.getConversionErrors();
}
/**
* Sets the Locale for the current action.
*
* @param locale the Locale for the current action.
*/
@Override
public ActionContext withLocale(Locale locale) {
put(LOCALE, locale);
super.withLocale(locale);
return this;
}
/**
* Gets the Locale of the current action. If no locale was ever specified the platform's
* {@link java.util.Locale#getDefault() default locale} is used.
*
* @return the Locale of the current action.
*/
@Override
public Locale getLocale() {
Locale locale = (Locale) get(LOCALE);
if (locale == null) {
locale = Locale.getDefault();
withLocale(locale);
}
return locale;
return super.getLocale();
}
/**
* Sets the name of the current Action in the ActionContext.
*
* @param actionName the name of the current action.
*/
@Override
public ActionContext withActionName(String actionName) {
put(ACTION_NAME, actionName);
super.withActionName(actionName);
return this;
}
/**
* Gets the name of the current Action.
*
* @return the name of the current action.
*/
@Override
public String getActionName() {
return (String) get(ACTION_NAME);
return super.getActionName();
}
/**
* Sets the action parameters.
*
* @param parameters the parameters for the current action.
*/
@Override
public ActionContext withParameters(HttpParameters parameters) {
put(PARAMETERS, parameters);
super.withParameters(parameters);
return this;
}
/**
* Returns a Map of the HttpServletRequest parameters when in a servlet environment or a generic Map of
* parameters otherwise.
*
* @return a Map of HttpServletRequest parameters or a multipart map when in a servlet environment, or a
* generic Map of parameters otherwise.
*/
@Override
public HttpParameters getParameters() {
return (HttpParameters) get(PARAMETERS);
return super.getParameters();
}
/**
* Sets a map of action session values.
*
* @param session the session values.
*/
@Override
public ActionContext withSession(Map<String, Object> session) {
put(SESSION, session);
super.withSession(session);
return this;
}
/**
* Gets the Map of HttpSession values when in a servlet environment or a generic session map otherwise.
*
* @return the Map of HttpSession values when in a servlet environment or a generic session map otherwise.
*/
@SuppressWarnings("unchecked")
@Override
public Map<String, Object> getSession() {
return (Map<String, Object>) get(SESSION);
return super.getSession();
}
/**
* Sets the OGNL value stack.
*
* @param valueStack the OGNL value stack.
*/
public ActionContext withValueStack(ValueStack valueStack) {
put(VALUE_STACK, valueStack);
return withValueStack((org.apache.struts2.util.ValueStack) valueStack);
}
@Override
public ActionContext withValueStack(org.apache.struts2.util.ValueStack valueStack) {
super.withValueStack(valueStack);
return this;
}
/**
* Gets the OGNL value stack.
*
* @return the OGNL value stack.
*/
@Override
public ValueStack getValueStack() {
return (ValueStack) get(VALUE_STACK);
return ValueStack.adapt(super.getValueStack());
}
/**
* Gets the container for this request
*
* @param container The container
*/
@Override
public ActionContext withContainer(Container container) {
put(CONTAINER, container);
super.withContainer(container);
return this;
}
/**
* Sets the container for this request
*
* @return The container
*/
@Override
public Container getContainer() {
return (Container) get(CONTAINER);
return super.getContainer();
}
@Override
public <T> T getInstance(Class<T> type) {
Container cont = getContainer();
if (cont != null) {
return cont.getInstance(type);
} else {
throw new StrutsException("Cannot find an initialized container for this request.");
}
return super.getInstance(type);
}
/**
* Returns a value that is stored in the current ActionContext by doing a lookup using the value's key.
*
* @param key the key used to find the value.
* @return the value that was found using the key or <tt>null</tt> if the key was not found.
*/
@Override
public Object get(String key) {
return context.get(key);
return super.get(key);
}
/**
* Stores a value in the current ActionContext. The value can be looked up using the key.
*
* @param key the key of the value.
* @param value the value to be stored.
*/
@Override
public void put(String key, Object value) {
context.put(key, value);
super.put(key, value);
}
/**
* Gets ServletContext associated with current action
*
* @return current ServletContext
*/
@Override
public ServletContext getServletContext() {
return (ServletContext) get(StrutsStatics.SERVLET_CONTEXT);
return super.getServletContext();
}
/**
* Assigns ServletContext to action context
*
* @param servletContext associated with current request
* @return ActionContext
*/
@Override
public ActionContext withServletContext(ServletContext servletContext) {
put(StrutsStatics.SERVLET_CONTEXT, servletContext);
super.withServletContext(servletContext);
return this;
}
/**
* Gets ServletRequest associated with current action
*
* @return current ServletRequest
*/
@Override
public HttpServletRequest getServletRequest() {
return (HttpServletRequest) get(StrutsStatics.HTTP_REQUEST);
return super.getServletRequest();
}
/**
* Assigns ServletRequest to action context
*
* @param request associated with current request
* @return ActionContext
*/
@Override
public ActionContext withServletRequest(HttpServletRequest request) {
put(StrutsStatics.HTTP_REQUEST, request);
super.withServletRequest(request);
return this;
}
/**
* Gets ServletResponse associated with current action
*
* @return current ServletResponse
*/
@Override
public HttpServletResponse getServletResponse() {
return (HttpServletResponse) get(StrutsStatics.HTTP_RESPONSE);
return super.getServletResponse();
}
/**
* Assigns ServletResponse to action context
*
* @param response associated with current request
* @return ActionContext
*/
@Override
public ActionContext withServletResponse(HttpServletResponse response) {
put(StrutsStatics.HTTP_RESPONSE, response);
super.withServletResponse(response);
return this;
}
/**
* Gets PageContext associated with current action
*
* @return current PageContext
*/
@Override
public PageContext getPageContext() {
return (PageContext) get(StrutsStatics.PAGE_CONTEXT);
return super.getPageContext();
}
/**
* Assigns PageContext to action context
*
* @param pageContext associated with current request
* @return ActionContext
*/
@Override
public ActionContext withPageContext(PageContext pageContext) {
put(StrutsStatics.PAGE_CONTEXT, pageContext);
super.withPageContext(pageContext);
return this;
}
/**
* Gets ActionMapping associated with current action
*
* @return current ActionMapping
*/
@Override
public ActionMapping getActionMapping() {
return (ActionMapping) get(StrutsStatics.ACTION_MAPPING);
return super.getActionMapping();
}
/**
* Assigns ActionMapping to action context
*
* @param actionMapping associated with current request
* @return ActionContext
*/
@Override
public ActionContext withActionMapping(ActionMapping actionMapping) {
put(StrutsStatics.ACTION_MAPPING, actionMapping);
super.withActionMapping(actionMapping);
return this;
}
/**
* Assigns an extra context map to action context
*
* @param extraContext to add to the current action context
* @return ActionContext
*/
@Override
public ActionContext withExtraContext(Map<String, Object> extraContext) {
if (extraContext != null) {
context.putAll(extraContext);
}
super.withExtraContext(extraContext);
return this;
}
/**
* Adds arbitrary key to action context
*
* @param key a string
* @param value an object
* @return ActionContext
*/
@Override
public ActionContext with(String key, Object value) {
put(key, value);
super.with(key, value);
return this;
}
}
@@ -21,24 +21,50 @@ package com.opensymphony.xwork2;
import com.opensymphony.xwork2.util.ValueStack;
/**
* Provides hooks for handling key action events
* {@inheritDoc}
*
* @deprecated since 6.7.0, use {@link org.apache.struts2.ActionEventListener} instead.
*/
public interface ActionEventListener {
/**
* Called after an action has been created.
*
* @param action The action
* @param stack The current value stack
* @return The action to use
*/
public Object prepare(Object action, ValueStack stack);
/**
* Called when an exception is thrown by the action
*
* @param t The exception/error that was thrown
* @param stack The current value stack
* @return A result code to execute, can be null
*/
public String handleException(Throwable t, ValueStack stack);
@Deprecated
public interface ActionEventListener extends org.apache.struts2.ActionEventListener {
@Override
default Object prepare(Object action, org.apache.struts2.util.ValueStack stack) {
return prepare(action, ValueStack.adapt(stack));
}
@Override
default String handleException(Throwable t, org.apache.struts2.util.ValueStack stack) {
return handleException(t, ValueStack.adapt(stack));
}
Object prepare(Object action, ValueStack stack);
String handleException(Throwable t, ValueStack stack);
static ActionEventListener adapt(org.apache.struts2.ActionEventListener actualListener) {
if (actualListener instanceof ActionEventListener) {
return (ActionEventListener) actualListener;
}
return actualListener != null ? new LegacyAdapter(actualListener) : null;
}
class LegacyAdapter implements ActionEventListener {
private final org.apache.struts2.ActionEventListener adaptee;
private LegacyAdapter(org.apache.struts2.ActionEventListener adaptee) {
this.adaptee = adaptee;
}
@Override
public Object prepare(Object action, ValueStack stack) {
return adaptee.prepare(action, stack);
}
@Override
public String handleException(Throwable t, ValueStack stack) {
return adaptee.handleException(t, stack);
}
}
}
@@ -22,158 +22,125 @@ import com.opensymphony.xwork2.interceptor.PreResultListener;
import com.opensymphony.xwork2.util.ValueStack;
/**
* An {@link ActionInvocation} represents the execution state of an {@link Action}. It holds the Interceptors and the Action instance.
* By repeated re-entrant execution of the <code>invoke()</code> method, initially by the {@link ActionProxy}, then by the Interceptors, the
* Interceptors are all executed, and then the {@link Action} and the {@link Result}.
* {@inheritDoc}
*
* @author Jason Carreira
* @see com.opensymphony.xwork2.ActionProxy
* @deprecated since 6.7.0, use {@link org.apache.struts2.ActionInvocation} instead.
*/
public interface ActionInvocation {
@Deprecated
public interface ActionInvocation extends org.apache.struts2.ActionInvocation {
/**
* Get the Action associated with this ActionInvocation.
*
* @return the Action
*/
Object getAction();
/**
* Gets whether this ActionInvocation has executed before.
* This will be set after the Action and the Result have executed.
*
* @return <tt>true</tt> if this ActionInvocation has executed before.
*/
boolean isExecuted();
/**
* Gets the ActionContext associated with this ActionInvocation. The ActionProxy is
* responsible for setting this ActionContext onto the ThreadLocal before invoking
* the ActionInvocation and resetting the old ActionContext afterwards.
*
* @return the ActionContext.
*/
@Override
ActionContext getInvocationContext();
/**
* Get the ActionProxy holding this ActionInvocation.
*
* @return the ActionProxy.
*/
ActionProxy getProxy();
/**
* If the ActionInvocation has been executed before and the Result is an instance of {@link ActionChainResult}, this method
* will walk down the chain of <code>ActionChainResult</code>s until it finds a non-chain result, which will be returned. If the
* ActionInvocation's result has not been executed before, the Result instance will be created and populated with
* the result params.
*
* @return the result.
* @throws Exception can be thrown.
*/
@Override
Result getResult() throws Exception;
/**
* Gets the result code returned from this ActionInvocation.
*
* @return the result code
*/
String getResultCode();
@Override
ActionProxy getProxy();
/**
* Sets the result code, possibly overriding the one returned by the
* action.
*
* <p>
* The "intended" purpose of this method is to allow PreResultListeners to
* override the result code returned by the Action.
* </p>
*
* <p>
* If this method is used before the Action executes, the Action's returned
* result code will override what was set. However the Action could (if
* specifically coded to do so) inspect the ActionInvocation to see that
* someone "upstream" (e.g. an Interceptor) had suggested a value as the
* result, and it could therefore return the same value itself.
* </p>
*
* <p>
* If this method is called between the Action execution and the Result
* execution, then the value set here will override the result code the
* action had returned. Creating an Interceptor that implements
* {@link PreResultListener} will give you this opportunity.
* </p>
*
* <p>
* If this method is called after the Result has been executed, it will
* have the effect of raising an IllegalStateException.
* </p>
*
* @param resultCode the result code.
* @throws IllegalStateException if called after the Result has been executed.
* @see #isExecuted()
*/
void setResultCode(String resultCode);
/**
* Gets the ValueStack associated with this ActionInvocation.
*
* @return the ValueStack
*/
@Override
ValueStack getStack();
/**
* Register a {@link PreResultListener} to be notified after the Action is executed and
* before the Result is executed.
*
* <p>
* The ActionInvocation implementation must guarantee that listeners will be called in
* the order in which they are registered.
* </p>
*
* <p>
* Listener registration and execution does not need to be thread-safe.
* </p>
*
* @param listener the listener to add.
*/
@Override
default void addPreResultListener(org.apache.struts2.interceptor.PreResultListener listener) {
addPreResultListener(PreResultListener.adapt(listener));
}
void addPreResultListener(PreResultListener listener);
/**
* Invokes the next step in processing this ActionInvocation.
*
* <p>
* If there are more Interceptors, this will call the next one. If Interceptors choose not to short-circuit
* ActionInvocation processing and return their own return code, they will call invoke() to allow the next Interceptor
* to execute. If there are no more Interceptors to be applied, the Action is executed.
* If the {@link ActionProxy#getExecuteResult()} method returns <tt>true</tt>, the Result is also executed.
* </p>
*
* @throws Exception can be thrown.
* @return the return code.
*/
String invoke() throws Exception;
@Override
default void setActionEventListener(org.apache.struts2.ActionEventListener listener) {
setActionEventListener(ActionEventListener.adapt(listener));
}
/**
* Invokes only the Action (not Interceptors or Results).
*
* <p>
* This is useful in rare situations where advanced usage with the interceptor/action/result workflow is
* being manipulated for certain functionality.
* </p>
*
* @return the return code.
* @throws Exception can be thrown.
*/
String invokeActionOnly() throws Exception;
/**
* Sets the action event listener to respond to key action events.
*
* @param listener the listener.
*/
void setActionEventListener(ActionEventListener listener);
void init(ActionProxy proxy) ;
@Override
default void init(org.apache.struts2.ActionProxy proxy) {
init(ActionProxy.adapt(proxy));
}
void init(ActionProxy proxy);
static ActionInvocation adapt(org.apache.struts2.ActionInvocation actualInvocation) {
if (actualInvocation instanceof ActionInvocation) {
return (ActionInvocation) actualInvocation;
}
return actualInvocation != null ? new LegacyAdapter(actualInvocation) : null;
}
class LegacyAdapter implements ActionInvocation {
private final org.apache.struts2.ActionInvocation adaptee;
private LegacyAdapter(org.apache.struts2.ActionInvocation adaptee) {
this.adaptee = adaptee;
}
@Override
public Object getAction() {
return adaptee.getAction();
}
@Override
public boolean isExecuted() {
return adaptee.isExecuted();
}
@Override
public ActionContext getInvocationContext() {
return ActionContext.adapt(adaptee.getInvocationContext());
}
@Override
public ActionProxy getProxy() {
return ActionProxy.adapt(adaptee.getProxy());
}
@Override
public Result getResult() throws Exception {
return Result.adapt(adaptee.getResult());
}
@Override
public String getResultCode() {
return adaptee.getResultCode();
}
@Override
public void setResultCode(String resultCode) {
adaptee.setResultCode(resultCode);
}
@Override
public ValueStack getStack() {
return ValueStack.adapt(adaptee.getStack());
}
@Override
public void addPreResultListener(PreResultListener listener) {
adaptee.addPreResultListener(listener);
}
@Override
public String invoke() throws Exception {
return adaptee.invoke();
}
@Override
public String invokeActionOnly() throws Exception {
return adaptee.invokeActionOnly();
}
@Override
public void setActionEventListener(ActionEventListener listener) {
adaptee.setActionEventListener(listener);
}
@Override
public void init(ActionProxy proxy) {
adaptee.init(proxy);
}
}
}
@@ -20,88 +20,75 @@ package com.opensymphony.xwork2;
import com.opensymphony.xwork2.config.entities.ActionConfig;
/**
* ActionProxy is an extra layer between XWork and the action so that different proxies are possible.
*
* <p>
* An example of this would be a remote proxy, where the layer between XWork and the action might be RMI or SOAP.
* </p>
*
* @author Jason Carreira
*/
public interface ActionProxy {
@Deprecated
public interface ActionProxy extends org.apache.struts2.ActionProxy {
/**
* Gets the Action instance for this Proxy.
*
* @return the Action instance
*/
Object getAction();
/**
* Gets the alias name this ActionProxy is mapped to.
*
* @return the alias name
*/
String getActionName();
/**
* Gets the ActionConfig this ActionProxy is built from.
*
* @return the ActionConfig
*/
ActionConfig getConfig();
/**
* Sets whether this ActionProxy should also execute the Result after executing the Action.
*
* @param executeResult <tt>true</tt> to also execute the Result.
*/
void setExecuteResult(boolean executeResult);
/**
* Gets the status of whether the ActionProxy is set to execute the Result after the Action is executed.
*
* @return the status
*/
boolean getExecuteResult();
/**
* Gets the ActionInvocation associated with this ActionProxy.
*
* @return the ActionInvocation
*/
@Override
ActionInvocation getInvocation();
/**
* Gets the namespace the ActionConfig for this ActionProxy is mapped to.
*
* @return the namespace
*/
String getNamespace();
static ActionProxy adapt(org.apache.struts2.ActionProxy actualProxy) {
if (actualProxy instanceof ActionProxy) {
return (ActionProxy) actualProxy;
}
return actualProxy != null ? new LegacyAdapter(actualProxy) : null;
}
/**
* Execute this ActionProxy. This will set the ActionContext from the ActionInvocation into the ActionContext
* ThreadLocal before invoking the ActionInvocation, then set the old ActionContext back into the ThreadLocal.
*
* @return the result code returned from executing the ActionInvocation
* @throws Exception can be thrown.
* @see ActionInvocation
*/
String execute() throws Exception;
class LegacyAdapter implements ActionProxy {
/**
* Gets the method name to execute, or <tt>null</tt> if no method has been specified (meaning <code>execute</code> will be invoked).
*
* @return the method to execute
*/
String getMethod();
private final org.apache.struts2.ActionProxy adaptee;
/**
* Gets status of the method value's initialization.
*
* @return true if the method returned by getMethod() is not a default initializer value.
*/
boolean isMethodSpecified();
private LegacyAdapter(org.apache.struts2.ActionProxy adaptee) {
this.adaptee = adaptee;
}
@Override
public Object getAction() {
return adaptee.getAction();
}
@Override
public String getActionName() {
return adaptee.getActionName();
}
@Override
public ActionConfig getConfig() {
return adaptee.getConfig();
}
@Override
public void setExecuteResult(boolean executeResult) {
adaptee.setExecuteResult(executeResult);
}
@Override
public boolean getExecuteResult() {
return adaptee.getExecuteResult();
}
@Override
public ActionInvocation getInvocation() {
return ActionInvocation.adapt(adaptee.getInvocation());
}
@Override
public String getNamespace() {
return adaptee.getNamespace();
}
@Override
public String execute() throws Exception {
return adaptee.execute();
}
@Override
public String getMethod() {
return adaptee.getMethod();
}
@Override
public boolean isMethodSpecified() {
return adaptee.isMethodSpecified();
}
}
}
@@ -18,342 +18,11 @@
*/
package com.opensymphony.xwork2;
import com.opensymphony.xwork2.conversion.impl.ConversionData;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.interceptor.ValidationAware;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.StrutsConstants;
import java.io.Serializable;
import java.util.*;
/**
* Provides a default implementation for the most common actions.
* See the documentation for all the interfaces this class implements for more detailed information.
* @deprecated since 6.7.0, use {@link org.apache.struts2.ActionSupport} instead.
*/
public class ActionSupport implements Action, Validateable, ValidationAware, TextProvider, LocaleProvider, Serializable {
private static final Logger LOG = LogManager.getLogger(ActionSupport.class);
private final ValidationAwareSupport validationAware = new ValidationAwareSupport();
private transient TextProvider textProvider;
private transient LocaleProvider localeProvider;
protected Container container;
@Override
public void setActionErrors(Collection<String> errorMessages) {
validationAware.setActionErrors(errorMessages);
}
@Override
public Collection<String> getActionErrors() {
return validationAware.getActionErrors();
}
@Override
public void setActionMessages(Collection<String> messages) {
validationAware.setActionMessages(messages);
}
@Override
public Collection<String> getActionMessages() {
return validationAware.getActionMessages();
}
@Override
public void setFieldErrors(Map<String, List<String>> errorMap) {
validationAware.setFieldErrors(errorMap);
}
@Override
public Map<String, List<String>> getFieldErrors() {
return validationAware.getFieldErrors();
}
@Override
public Locale getLocale() {
return getLocaleProvider().getLocale();
}
@Override
public boolean isValidLocaleString(String localeStr) {
return getLocaleProvider().isValidLocaleString(localeStr);
}
@Override
public boolean isValidLocale(Locale locale) {
return getLocaleProvider().isValidLocale(locale);
}
@Override
public Locale toLocale(String localeStr) {
return getLocaleProvider().toLocale(localeStr);
}
@Override
public boolean hasKey(String key) {
return getTextProvider().hasKey(key);
}
@Override
public String getText(String aTextName) {
return getTextProvider().getText(aTextName);
}
@Override
public String getText(String aTextName, String defaultValue) {
return getTextProvider().getText(aTextName, defaultValue);
}
@Override
public String getText(String aTextName, String defaultValue, String obj) {
return getTextProvider().getText(aTextName, defaultValue, obj);
}
@Override
public String getText(String aTextName, List<?> args) {
return getTextProvider().getText(aTextName, args);
}
@Override
public String getText(String key, String[] args) {
return getTextProvider().getText(key, args);
}
@Override
public String getText(String aTextName, String defaultValue, List<?> args) {
return getTextProvider().getText(aTextName, defaultValue, args);
}
@Override
public String getText(String key, String defaultValue, String[] args) {
return getTextProvider().getText(key, defaultValue, args);
}
@Override
public String getText(String key, String defaultValue, List<?> args, ValueStack stack) {
return getTextProvider().getText(key, defaultValue, args, stack);
}
@Override
public String getText(String key, String defaultValue, String[] args, ValueStack stack) {
return getTextProvider().getText(key, defaultValue, args, stack);
}
/**
* Dedicated method to support I10N and conversion errors
*
* @param key message which contains formatting string
* @param expr that should be formatted
* @return formatted expr with format specified by key
*/
public String getFormatted(String key, String expr) {
Map<String, ConversionData> conversionErrors = ActionContext.getContext().getConversionErrors();
if (conversionErrors.containsKey(expr)) {
String[] vals = (String[]) conversionErrors.get(expr).getValue();
return vals[0];
} else {
final ValueStack valueStack = ActionContext.getContext().getValueStack();
final Object val = valueStack.findValue(expr);
return getText(key, Arrays.asList(val));
}
}
@Override
public ResourceBundle getTexts() {
return getTextProvider().getTexts();
}
@Override
public ResourceBundle getTexts(String aBundleName) {
return getTextProvider().getTexts(aBundleName);
}
@Override
public void addActionError(String anErrorMessage) {
validationAware.addActionError(anErrorMessage);
}
@Override
public void addActionMessage(String aMessage) {
validationAware.addActionMessage(aMessage);
}
@Override
public void addFieldError(String fieldName, String errorMessage) {
validationAware.addFieldError(fieldName, errorMessage);
}
public String input() throws Exception {
return INPUT;
}
/**
* A default implementation that does nothing an returns "success".
*
* <p>
* Subclasses should override this method to provide their business logic.
* </p>
*
* <p>
* See also {@link com.opensymphony.xwork2.Action#execute()}.
* </p>
*
* @return returns {@link #SUCCESS}
* @throws Exception can be thrown by subclasses.
*/
@Override
public String execute() throws Exception {
return SUCCESS;
}
@Override
public boolean hasActionErrors() {
return validationAware.hasActionErrors();
}
@Override
public boolean hasActionMessages() {
return validationAware.hasActionMessages();
}
@Override
public boolean hasErrors() {
return validationAware.hasErrors();
}
@Override
public boolean hasFieldErrors() {
return validationAware.hasFieldErrors();
}
/**
* Clears field errors. Useful for Continuations and other situations
* where you might want to clear parts of the state on the same action.
*/
public void clearFieldErrors() {
validationAware.clearFieldErrors();
}
/**
* Clears action errors. Useful for Continuations and other situations
* where you might want to clear parts of the state on the same action.
*/
public void clearActionErrors() {
validationAware.clearActionErrors();
}
/**
* Clears messages. Useful for Continuations and other situations
* where you might want to clear parts of the state on the same action.
*/
public void clearMessages() {
validationAware.clearMessages();
}
/**
* Clears all errors. Useful for Continuations and other situations
* where you might want to clear parts of the state on the same action.
*/
public void clearErrors() {
validationAware.clearErrors();
}
/**
* Clears all errors and messages. Useful for Continuations and other situations
* where you might want to clear parts of the state on the same action.
*/
public void clearErrorsAndMessages() {
validationAware.clearErrorsAndMessages();
}
/**
* A default implementation that validates nothing.
* Subclasses should override this method to provide validations.
*/
@Override
public void validate() {
// A default implementation that validates nothing
}
@Override
public Object clone() throws CloneNotSupportedException {
return super.clone();
}
/**
* <!-- START SNIPPET: pause-method -->
* Stops the action invocation immediately (by throwing a PauseException) and causes the action invocation to return
* the specified result, such as {@link #SUCCESS}, {@link #INPUT}, etc.
*
* <p>
* The next time this action is invoked (and using the same continuation ID), the method will resume immediately
* after where this method was called, with the entire call stack in the execute method restored.
* </p>
*
* <p>
* Note: this method can <b>only</b> be called within the {@link #execute()} method.
* </p>
*
* <!-- END SNIPPET: pause-method -->
*
* @param result the result to return - the same type of return value in the {@link #execute()} method.
*/
public void pause(String result) {
}
/**
* If called first time it will create {@link com.opensymphony.xwork2.TextProviderFactory},
* inject dependency (if {@link com.opensymphony.xwork2.inject.Container} is accesible) into in,
* then will create new {@link com.opensymphony.xwork2.TextProvider} and store it in a field
* for future references and at the returns reference to that field
*
* @return reference to field with TextProvider
*/
protected TextProvider getTextProvider() {
if (textProvider == null) {
final TextProviderFactory tpf = getContainer().getInstance(TextProviderFactory.class);
textProvider = tpf.createInstance(getClass());
}
return textProvider;
}
protected LocaleProvider getLocaleProvider() {
if (localeProvider == null) {
final LocaleProviderFactory localeProviderFactory = getContainer().getInstance(LocaleProviderFactory.class);
localeProvider = localeProviderFactory.createLocaleProvider();
}
return localeProvider;
}
/**
* TODO: This a temporary solution, maybe we should consider stop injecting container into beans
*/
protected Container getContainer() {
if (container == null) {
container = ActionContext.getContext().getContainer();
if (container != null) {
boolean devMode = Boolean.parseBoolean(container.getInstance(String.class, StrutsConstants.STRUTS_DEVMODE));
if (devMode) {
LOG.warn("Container is null, action was created manually? Fallback to ActionContext");
} else {
LOG.debug("Container is null, action was created manually? Fallback to ActionContext");
}
} else {
LOG.warn("Container is null, action was created out of ActionContext scope?!?");
}
}
return container;
}
@Inject
public void setContainer(Container container) {
this.container = container;
}
@Deprecated
public class ActionSupport extends org.apache.struts2.ActionSupport implements Action, Validateable, ValidationAware {
}
@@ -36,6 +36,7 @@ import ognl.NoSuchPropertyException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.StrutsException;
import org.apache.struts2.result.ActionChainResult;
import java.util.ArrayList;
import java.util.Iterator;
@@ -248,12 +249,15 @@ public class DefaultActionInvocation implements ActionInvocation {
Interceptor interceptor = interceptorMapping.getInterceptor();
if (interceptor instanceof WithLazyParams) {
interceptor = lazyParamInjector.injectParams(interceptor, interceptorMapping.getParams(), invocationContext);
} else if (interceptor instanceof Interceptor.LegacyAdapter && ((Interceptor.LegacyAdapter) interceptor).getAdaptee() instanceof WithLazyParams) {
org.apache.struts2.interceptor.Interceptor adaptee = ((Interceptor.LegacyAdapter) interceptor).getAdaptee();
lazyParamInjector.injectParams(adaptee, interceptorMapping.getParams(), invocationContext);
}
if (interceptor instanceof ConditionalInterceptor) {
resultCode = executeConditional((ConditionalInterceptor) interceptor);
} else {
LOG.debug("Executing normal interceptor: {}", interceptorMapping.getName());
resultCode = interceptor.intercept(this);
resultCode = interceptor.intercept((org.apache.struts2.ActionInvocation) this);
}
} else {
resultCode = invokeActionOnly();
@@ -294,9 +298,9 @@ public class DefaultActionInvocation implements ActionInvocation {
}
protected String executeConditional(ConditionalInterceptor conditionalInterceptor) throws Exception {
if (conditionalInterceptor.shouldIntercept(this)) {
if (conditionalInterceptor.shouldIntercept((org.apache.struts2.ActionInvocation) this)) {
LOG.debug("Executing conditional interceptor: {}", conditionalInterceptor.getClass().getSimpleName());
return conditionalInterceptor.intercept(this);
return conditionalInterceptor.intercept((org.apache.struts2.ActionInvocation) this);
} else {
LOG.debug("Interceptor: {} is disabled, skipping to next", conditionalInterceptor.getClass().getSimpleName());
return this.invoke();
@@ -374,7 +378,7 @@ public class DefaultActionInvocation implements ActionInvocation {
result = createResult();
if (result != null) {
result.execute(this);
result.execute((org.apache.struts2.ActionInvocation) this);
} else if (resultCode != null && !Action.NONE.equals(resultCode)) {
throw new ConfigurationException("No result defined for action " + getAction().getClass().getName()
+ " and result " + getResultCode(), proxy.getConfig());
@@ -19,18 +19,8 @@
package com.opensymphony.xwork2;
/**
* ModelDriven Actions provide a model object to be pushed onto the ValueStack
* in addition to the Action itself, allowing a FormBean type approach like Struts.
*
* @author Jason Carreira
* @deprecated since 6.7.0, use {@link org.apache.struts2.ModelDriven} instead.
*/
public interface ModelDriven<T> {
/**
* Gets the model to be pushed onto the ValueStack instead of the Action itself.
*
* @return the model
*/
T getModel();
@Deprecated
public interface ModelDriven<T> extends org.apache.struts2.ModelDriven<T> {
}
@@ -19,19 +19,8 @@
package com.opensymphony.xwork2;
/**
* Preparable Actions will have their <code>prepare()</code> method called if the {@link com.opensymphony.xwork2.interceptor.PrepareInterceptor}
* is applied to the ActionConfig.
*
* @author Jason Carreira
* @see com.opensymphony.xwork2.interceptor.PrepareInterceptor
* @deprecated since 6.7.0, use {@link org.apache.struts2.Preparable} instead.
*/
public interface Preparable {
/**
* This method is called to allow the action to prepare itself.
*
* @throws Exception thrown if a system level exception occurs.
*/
void prepare() throws Exception;
@Deprecated
public interface Preparable extends org.apache.struts2.Preparable {
}
@@ -18,33 +18,39 @@
*/
package com.opensymphony.xwork2;
import java.io.Serializable;
/**
* All results (except for <code>Action.NONE</code>) of an {@link Action} are mapped to a View implementation.
* {@inheritDoc}
*
* <p>
* Examples of Views might be:
* </p>
*
* <ul>
* <li>SwingPanelView - pops up a new Swing panel</li>
* <li>ActionChainView - executes another action</li>
* <li>SerlvetRedirectView - redirects the HTTP response to a URL</li>
* <li>ServletDispatcherView - dispatches the HTTP response to a URL</li>
* </ul>
*
* @author plightbo
* @deprecated since 6.7.0, use {@link org.apache.struts2.result.Result} instead.
*/
public interface Result extends Serializable {
@Deprecated
public interface Result extends org.apache.struts2.result.Result {
@Override
default void execute(org.apache.struts2.ActionInvocation invocation) throws Exception {
execute(ActionInvocation.adapt(invocation));
}
/**
* Represents a generic interface for all action execution results.
* Whether that be displaying a webpage, generating an email, sending a JMS message, etc.
*
* @param invocation the invocation context.
* @throws Exception can be thrown.
*/
void execute(ActionInvocation invocation) throws Exception;
static Result adapt(org.apache.struts2.result.Result actualResult) {
if (actualResult instanceof Result) {
return (Result) actualResult;
}
return actualResult != null ? new LegacyAdapter(actualResult) : null;
}
class LegacyAdapter implements Result {
private final org.apache.struts2.result.Result adaptee;
private LegacyAdapter(org.apache.struts2.result.Result adaptee) {
this.adaptee = adaptee;
}
@Override
public void execute(ActionInvocation invocation) throws Exception {
adaptee.execute(ActionInvocation.adapt(invocation));
}
}
}
@@ -19,9 +19,8 @@
package com.opensymphony.xwork2;
/**
* Simple marker interface to indicate an object should <b>not</b> have its properties copied during chaining.
*
* @see com.opensymphony.xwork2.interceptor.ChainingInterceptor
* @deprecated since 6.7.0, use {@link org.apache.struts2.Unchainable} instead.
*/
public interface Unchainable {
@Deprecated
public interface Unchainable extends org.apache.struts2.Unchainable {
}
@@ -19,17 +19,8 @@
package com.opensymphony.xwork2;
/**
* Provides an interface in which a call for a validation check can be done.
*
* @author Jason Carreira
* @see ActionSupport
* @see com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor
* @deprecated since 6.7.0, use {@link org.apache.struts2.Validateable} instead.
*/
public interface Validateable {
/**
* Performs validation.
*/
void validate();
@Deprecated
public interface Validateable extends org.apache.struts2.Validateable {
}
@@ -21,7 +21,12 @@ package com.opensymphony.xwork2;
import com.opensymphony.xwork2.interceptor.ValidationAware;
import java.io.Serializable;
import java.util.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* Provides a default implementation of ValidationAware. Returns new collections for
@@ -72,13 +77,7 @@ public class ValidationAwareSupport implements ValidationAware, Serializable {
public synchronized void addFieldError(String fieldName, String errorMessage) {
final Map<String, List<String>> errors = internalGetFieldErrors();
List<String> thisFieldErrors = errors.get(fieldName);
if (thisFieldErrors == null) {
thisFieldErrors = new ArrayList<>();
errors.put(fieldName, thisFieldErrors);
}
List<String> thisFieldErrors = errors.computeIfAbsent(fieldName, k -> new ArrayList<>());
thisFieldErrors.add(errorMessage);
}
@@ -19,18 +19,21 @@
package com.opensymphony.xwork2.config;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
/**
* ConfigurationUtil
*
*
* @author Jason Carreira Created May 23, 2003 11:22:49 PM
*/
public class ConfigurationUtil {
@@ -83,4 +86,12 @@ public class ConfigurationUtil {
return parents;
}
public static Set<Class<?>> getAllClassTypes(Class<?> clazz) {
HashSet<Class<?>> classes = new HashSet<>();
classes.add(clazz);
classes.addAll(ClassUtils.getAllSuperclasses(clazz));
classes.addAll(ClassUtils.getAllInterfaces(clazz));
return classes;
}
}
@@ -36,8 +36,16 @@ public class InterceptorMapping implements Serializable {
private Interceptor interceptor;
private final Map<String, String> params;
public InterceptorMapping(String name, org.apache.struts2.interceptor.Interceptor interceptor) {
this(name, Interceptor.adapt(interceptor));
}
public InterceptorMapping(String name, org.apache.struts2.interceptor.Interceptor interceptor, Map<String, String> params) {
this(name, Interceptor.adapt(interceptor), params);
}
public InterceptorMapping(String name, Interceptor interceptor) {
this(name, interceptor, new HashMap<String, String>());
this(name, interceptor, new HashMap<>());
}
public InterceptorMapping(String name, Interceptor interceptor, Map<String, String> params) {
@@ -38,7 +38,7 @@ import java.util.Map;
*/
public class ResultConfig extends Located implements Serializable {
protected Map<String,String> params;
protected Map<String, String> params;
protected String className;
protected String name;
@@ -63,7 +63,7 @@ public class ResultConfig extends Located implements Serializable {
return name;
}
public Map<String,String> getParams() {
public Map<String, String> getParams() {
return params;
}
@@ -140,7 +140,7 @@ public class ResultConfig extends Located implements Serializable {
return this;
}
public Builder addParams(Map<String,String> params) {
public Builder addParams(Map<String, String> params) {
target.params.putAll(params);
return this;
}
@@ -66,7 +66,6 @@ import com.opensymphony.xwork2.factory.ActionFactory;
import com.opensymphony.xwork2.factory.ConverterFactory;
import com.opensymphony.xwork2.factory.DefaultActionFactory;
import com.opensymphony.xwork2.factory.DefaultInterceptorFactory;
import com.opensymphony.xwork2.factory.DefaultResultFactory;
import com.opensymphony.xwork2.factory.DefaultUnknownHandlerFactory;
import com.opensymphony.xwork2.factory.DefaultValidatorFactory;
import com.opensymphony.xwork2.factory.InterceptorFactory;
@@ -109,6 +108,7 @@ import org.apache.struts2.StrutsConstants;
import org.apache.struts2.conversion.StrutsConversionPropertiesProcessor;
import org.apache.struts2.conversion.StrutsTypeConverterCreator;
import org.apache.struts2.conversion.StrutsTypeConverterHolder;
import org.apache.struts2.factory.StrutsResultFactory;
import org.apache.struts2.ognl.OgnlGuard;
import org.apache.struts2.ognl.ProviderAllowlist;
import org.apache.struts2.ognl.StrutsOgnlGuard;
@@ -363,7 +363,7 @@ public class DefaultConfiguration implements Configuration {
// TODO: SpringObjectFactoryTest fails when these are SINGLETON
.factory(ObjectFactory.class, Scope.PROTOTYPE)
.factory(ActionFactory.class, DefaultActionFactory.class, Scope.PROTOTYPE)
.factory(ResultFactory.class, DefaultResultFactory.class, Scope.PROTOTYPE)
.factory(ResultFactory.class, StrutsResultFactory.class, Scope.PROTOTYPE)
.factory(InterceptorFactory.class, DefaultInterceptorFactory.class, Scope.PROTOTYPE)
.factory(ValidatorFactory.class, DefaultValidatorFactory.class, Scope.PROTOTYPE)
.factory(ConverterFactory.class, StrutsConverterFactory.class, Scope.PROTOTYPE)
@@ -45,7 +45,6 @@ import com.opensymphony.xwork2.util.location.LocatableProperties;
import com.opensymphony.xwork2.util.location.Location;
import com.opensymphony.xwork2.util.location.LocationUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -109,6 +108,11 @@ public abstract class XmlDocConfigurationProvider implements ConfigurationProvid
this.valueSubstitutor = valueSubstitutor;
}
@Inject
public void setProviderAllowlist(ProviderAllowlist providerAllowlist) {
this.providerAllowlist = providerAllowlist;
}
public XmlDocConfigurationProvider(Document... documents) {
this.documents = Arrays.asList(documents);
}
@@ -135,11 +139,6 @@ public abstract class XmlDocConfigurationProvider implements ConfigurationProvid
this.configuration = configuration;
}
private void registerAllowlist() {
providerAllowlist = configuration.getContainer().getInstance(ProviderAllowlist.class);
providerAllowlist.registerAllowlist(this, allowlistClasses);
}
@Override
public void destroy() {
if (providerAllowlist != null) {
@@ -149,9 +148,8 @@ public abstract class XmlDocConfigurationProvider implements ConfigurationProvid
protected Class<?> allowAndLoadClass(String className) throws ClassNotFoundException {
Class<?> clazz = loadClass(className);
allowlistClasses.add(clazz);
allowlistClasses.addAll(ClassUtils.getAllSuperclasses(clazz));
allowlistClasses.addAll(ClassUtils.getAllInterfaces(clazz));
allowlistClasses.addAll(ConfigurationUtil.getAllClassTypes(clazz));
providerAllowlist.registerAllowlist(this, allowlistClasses);
return clazz;
}
@@ -333,7 +331,6 @@ public abstract class XmlDocConfigurationProvider implements ConfigurationProvid
}
declaredPackages.clear();
registerAllowlist();
configuration = null;
}
@@ -70,13 +70,18 @@ public class DefaultInterceptorFactory implements InterceptorFactory {
reflectionProvider.setProperties(params, o);
}
Interceptor interceptor = null;
if (o instanceof Interceptor) {
Interceptor interceptor = (Interceptor) o;
interceptor.init();
return interceptor;
interceptor = (Interceptor) o;
} else if (o instanceof org.apache.struts2.interceptor.Interceptor) {
interceptor = Interceptor.adapt((org.apache.struts2.interceptor.Interceptor) o);
}
throw new ConfigurationException("Class [" + interceptorClassName + "] does not implement Interceptor", interceptorConfig);
if (interceptor == null) {
throw new ConfigurationException("Class [" + interceptorClassName + "] does not implement Interceptor", interceptorConfig);
}
interceptor.init();
return interceptor;
} catch (InstantiationException e) {
cause = e;
message = "Unable to instantiate an instance of Interceptor class [" + interceptorClassName + "].";
@@ -20,17 +20,22 @@ package com.opensymphony.xwork2.factory;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.reflection.ReflectionException;
import com.opensymphony.xwork2.util.reflection.ReflectionExceptionHandler;
import com.opensymphony.xwork2.util.reflection.ReflectionProvider;
import org.apache.struts2.factory.StrutsResultFactory;
import java.util.Map;
/**
* Default implementation
*
* @deprecated since 6.7.0, use {@link StrutsResultFactory} instead.
*/
@Deprecated
public class DefaultResultFactory implements ResultFactory {
private ObjectFactory objectFactory;
@@ -51,19 +56,29 @@ public class DefaultResultFactory implements ResultFactory {
Result result = null;
if (resultClassName != null) {
result = (Result) objectFactory.buildBean(resultClassName, extraContext);
Object o = objectFactory.buildBean(resultClassName, extraContext);
Map<String, String> params = resultConfig.getParams();
if (params != null) {
for (Map.Entry<String, String> paramEntry : params.entrySet()) {
try {
reflectionProvider.setProperty(paramEntry.getKey(), paramEntry.getValue(), result, extraContext, true);
reflectionProvider.setProperty(paramEntry.getKey(), paramEntry.getValue(), o, extraContext, true);
} catch (ReflectionException ex) {
if (result instanceof ReflectionExceptionHandler) {
((ReflectionExceptionHandler) result).handle(ex);
if (o instanceof ReflectionExceptionHandler) {
((ReflectionExceptionHandler) o).handle(ex);
}
}
}
}
if (o instanceof Result) {
result = (Result) o;
} else if (o instanceof org.apache.struts2.result.Result) {
result = Result.adapt((org.apache.struts2.result.Result) o);
}
if (result == null) {
throw new ConfigurationException("Class [" + resultClassName + "] does not implement Result", resultConfig);
}
}
return result;
@@ -242,6 +242,41 @@ class ContainerImpl implements Container {
return toArray(parameterInjectors);
}
/**
* Gets parameter injectors with nulls for optional dependencies.
*
* @param member to which the parameters belong
* @param annotations on the parameters
* @param parameterTypes parameter types
* @return injections
*/
<M extends AccessibleObject & Member> ParameterInjector<?>[] getParametersInjectorsWithNulls(
M member,
Annotation[][] annotations,
Class<?>[] parameterTypes,
String defaultName
) throws MissingDependencyException {
final List<ParameterInjector<?>> parameterInjectors = new ArrayList<>();
final Iterator<Annotation[]> annotationsIterator = Arrays.asList(annotations).iterator();
for (Class<?> parameterType : parameterTypes) {
Inject annotation = findInject(annotationsIterator.next());
String name = annotation == null ? defaultName : annotation.value();
Key<?> key = Key.newInstance(parameterType, name);
try {
parameterInjectors.add(createParameterInjector(key, member));
} catch (MissingDependencyException e) {
if (annotation != null && annotation.required()) {
throw e;
} else {
parameterInjectors.add(createNullParameterInjector(key, member));
}
}
}
return toArray(parameterInjectors);
}
<T> ParameterInjector<T> createParameterInjector(Key<T> key, Member member) throws MissingDependencyException {
final InternalFactory<? extends T> factory = getFactory(key);
if (factory == null) {
@@ -252,6 +287,23 @@ class ContainerImpl implements Container {
return new ParameterInjector<>(externalContext, factory);
}
<T> ParameterInjector<T> createNullParameterInjector(Key<T> key, Member member) throws MissingDependencyException {
final InternalFactory<? extends T> factory = new InternalFactory<T>() {
@Override
public T create(InternalContext context) {
return null;
}
@Override
public Class<? extends T> type() {
return key.getType();
}
};
final ExternalContext<T> externalContext = ExternalContext.newInstance(member, key, this);
return new ParameterInjector<>(externalContext, factory);
}
private ParameterInjector<?>[] toArray(List<ParameterInjector<?>> parameterInjections) {
return parameterInjections.toArray(new ParameterInjector[0]);
}
@@ -361,7 +413,7 @@ class ContainerImpl implements Container {
Inject inject, ContainerImpl container, Constructor<T> constructor) throws MissingDependencyException {
return constructor.getParameterTypes().length == 0
? null // default constructor.
: container.getParametersInjectors(
: container.getParametersInjectorsWithNulls(
constructor,
constructor.getParameterAnnotations(),
constructor.getParameterTypes(),

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