Commit Graph

164 Commits

Author SHA1 Message Date
Lukasz Lenart 1fef0e1f9b fix(convention): WW-5593 handle NoClassDefFoundError in action class scanning (#1469)
The PackageBasedActionConfigBuilder now catches NoClassDefFoundError in
addition to ClassNotFoundException when scanning for action classes.
This prevents application startup failures when classes have missing
optional dependencies (e.g., test classes depending on JUnit).

Changes:
- Add NoClassDefFoundError to catch block in getActionClassTest()
- Improve error message to suggest missing dependencies
- Add unit tests for both exception types

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-14 20:01:25 +01:00
Lukasz Lenart 6d778ac9b7 fix(convention): WW-5594 exclude root package classes with wildcard patterns (#1468)
The exclusion pattern "org.apache.struts2.*" was not properly excluding
classes directly in the root package (like XWorkTestCase) because:

1. PackageBasedActionConfigBuilder extracts package names using
   substringBeforeLast(className, ".") which produces "org.apache.struts2"
   (no trailing dot)
2. The wildcard pattern requires a literal "." before "*"
3. Result: Pattern doesn't match root package classes

Fix: Enhanced checkExcludePackages() to automatically handle patterns
ending with ".*" by also checking if the package name equals the base
pattern (without ".*").

Now "org.apache.struts2.*" properly excludes both:
- Classes in root package: org.apache.struts2.XWorkTestCase
- Classes in subpackages: org.apache.struts2.dispatcher.SomeClass

Closes [WW-5594](https://issues.apache.org/jira/browse/WW-5594)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-14 19:41:59 +01:00
Lukasz Lenart 6131c9364e Fixes site and JavaDocs generation (#1419) 2025-11-22 16:55:18 +01:00
Lukasz Lenart b34665046c Improves code quality
Uses existing function to split input using comma
2025-02-02 17:22:42 +01:00
Lukasz Lenart 83cb936c3a WW-5459 Moves ActionChainResult into org.apache.struts2.result package 2024-11-02 15:23:54 +01:00
Lukasz Lenart dd6bb139f7 WW-5459 Moves Action interface into org.apache.struts2.action package 2024-11-02 15:09:51 +01:00
Kusal Kithul-Godage 87df4a229d WW-3714 Move new Result class into result package 2024-11-02 23:09:41 +11:00
Kusal Kithul-Godage a43f8a5239 Merge remote-tracking branch 'origin/master' into 7.0.x/merge-master-2024-11-02 2024-11-02 14:17:56 +11:00
Kusal Kithul-Godage fe46ad9f4a WW-5478 Deprecate DefaultResultFactory 2024-11-02 14:01:36 +11:00
Kusal Kithul-Godage 32bc4045ba WW-3714 Moves all classes from com.opensymphony.xwork2 into org.apache.struts2 2024-11-01 19:02:21 +11:00
Kusal Kithul-Godage aec78dd161 WW-5411 Misc code cleanup 2024-07-25 21:16:56 +10:00
Kusal Kithul-Godage 7b84357686 Merge remote-tracking branch 'origin/master' into 7.0.x/merge-master-2024-07-20 2024-07-20 13:36:38 +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 f9953938f7 WW-5440 Add missing annotations 2024-07-13 21:57:26 +10:00
Lukasz Lenart d8090ef9d8 Merge remote-tracking branch 'origin/master' into merge-master-to-7xx-2024-01-04
# Conflicts:
#	Jenkinsfile
#	bundles/admin/src/main/resources/osgi/admin/shell.ftl
#	bundles/admin/src/main/resources/osgi/admin/viewBundle.ftl
#	bundles/admin/src/main/resources/osgi/admin/viewBundles.ftl
#	plugins/velocity/src/main/java/org/apache/struts2/views/velocity/components/AbstractDirective.java
2024-01-04 10:21:52 +01:00
Lukasz Lenart cc78033d3d WW-5383 Updates RegEx to excludes JARs by default 2024-01-04 06:49:10 +01:00
jdyer1 2202e5fbbb WW-5141
- initial attempt to update references javax>jakarta and get things to compile
2023-12-16 10:39:28 +01:00
Kusal Kithul-Godage dc43c891da WW-5334 Extract ConventionJUnit4Test into correct module 2023-08-20 22:19:28 +10:00
Lukasz Lenart c99526ce1f WW-5296 Uses proper DTDs 2023-05-16 20:22:03 +02:00
Lukasz Lenart f0f9e42fa9 WW-5304 Drops deprecated methods and fields in ActionContext 2023-04-10 15:12:11 +02:00
Lukasz Lenart 3774ffa7c3 WW-5234 Improves DTD definitions to use proper URL 2022-09-27 09:21:03 +02:00
Lukasz Lenart 86b45e96fc WW-5207 Uses ASM 9 by default 2022-08-08 17:00:42 +02:00
Lukasz Lenart 273776e13b WW-4789 WW-3788 Introduces helper methods to allow build fluent API 2020-04-07 07:59:11 +02:00
Lukasz Lenart 1bfa1ce6d1 WW-4789 WW-3788 Adds instance bind() to simplify bind operation 2020-04-05 07:46:56 +02:00
Lukasz Lenart 1a8c751b9a WW-4789 WW-3788 Uses bind() instead of bound() 2020-04-05 07:46:56 +02:00
Lukasz Lenart f4aa4ee09a WW-4789 WW-3788 ActionContext refactoring 2020-04-05 07:46:56 +02:00
Lukasz Lenart 140bea2e1c WW-5003 Drops XWorkException and uses StrutsException instead 2019-12-27 09:09:42 +01:00
Yasser Zamani 9d4e720922 upgrade to ASM 7
fixes WW-5005

(cherry picked from commit 3eb68be)
2019-02-04 14:28:16 +03:30
Lukasz Lenart 699f5d6c79 [WW-4938] Uses container to create an instance of the class (#295)
* WW-4938 Uses container to create an instance of the class

* WW-4938 Adds a test to proof that @Inject works on constructor

* WW-4938 Adds missing header

* Update core/src/test/java/com/opensymphony/xwork2/mock/InjectableAction.java

Co-Authored-By: lukaszlenart <lukasz.lenart@gmail.com>

* Update core/src/test/java/com/opensymphony/xwork2/mock/DummyTextProvider.java

Co-Authored-By: lukaszlenart <lukasz.lenart@gmail.com>
2018-12-18 15:55:42 +03:30
Sebastian Peters 80e50c1367 Remove unused private methods 2018-11-20 21:13:12 +01:00
Philipp Heidelbach 8b4755dc49 WW-4930 Add test run with enabled SMI inheritance 2018-11-15 13:15:17 +01:00
Philipp Heidelbach 38b96b11fe WW-4930 Add constant to enable smi inheritance between parent package configs and its children 2018-11-14 14:54:57 +01:00
Lukasz Lenart f1610537c8 Merge pull request #177 from aleksandr-m/feature/WW-4875
WW-4875 Add ability to use Java based configuration
2018-03-16 14:23:06 +01:00
Lukasz Lenart a9899b6622 Introduces new method find all annotations 2018-01-26 11:47:10 +01:00
Aleksandr Mashchenko 9f082b264c Make ConventionConstantConfig inherit map of constants from ConstantConfig 2017-11-21 22:26:52 +02:00
Aleksandr Mashchenko 302b53d43c WW-4875 Add convention constant configuration 2017-11-21 20:45:42 +02:00
Stefaan Dutry 0bde78cc36 changed Map iterations to use entrySet when both key and value are used 2017-11-13 21:13:27 +01:00
Lukasz Lenart 8b95838c58 Adds proper XML header 2017-10-22 12:29:13 +02:00
Lukasz Lenart a03373022d Adds missing header with license 2017-10-21 18:40:42 +02:00
Lukasz Lenart e7c65fb0b4 Adds missing header with license 2017-10-21 17:47:51 +02:00
Lukasz Lenart 73359c480b Adds missing header with license 2017-10-21 11:24:48 +02:00
Lukasz Lenart cb389d292d Fixes Maven site generation 2017-10-20 09:05:29 +02:00
Lukasz Lenart 2acf0ab16e Reverts changes introduced with WW-4827 and adds default constructors 2017-09-26 08:47:10 +02:00
Lukasz Lenart 81718c62bd WW-4827 Injects Container in constructor 2017-08-03 09:01:26 +02:00
Aleksandr Mashchenko 6f91d0776a Inject Container in constructor of the ObjectFactory 2017-07-27 22:22:33 +03:00
Lukasz Lenart 855be0e36c Updates header with license 2017-07-07 11:31:45 +02:00
Lukasz Lenart 89d9342e53 Fixes small typo 2017-07-07 11:28:14 +02:00
Lukasz Lenart f585d7920e Extracts constants 2017-07-07 11:13:44 +02:00
Lukasz Lenart b5be431f54 Converts comments into logging statements 2017-07-07 11:01:03 +02:00
Lukasz Lenart f522fbc454 Extract common code 2017-07-07 10:58:26 +02:00