-
Bug
-
Resolution: Fixed
-
Low
-
8.0.0-struts-m020
-
Severity 3 - Minor
-
1
-
The Confluence DC development team has added a section for confluence-compat-lib usage with Struts2. The layer for Struts2 compatibility has been added in 1.5.0 of confluence-compat-lib.
We would like to say thank you for everyone who provided feedback for the compatibility layer and would continue to watch the ticket/community post for the same.
Regards,
The Confluence DC Team
Issue Summary
Since Struts 2 upgrade is a breaking change, plugins would require a compatibility layer to keep a single version running across 7.x/8.x of Confluence.
We can provide it to cover >90% of the cases. This would help in reducing friction in Vendor adoption of 8.0
Few compatibility layers required inside confluence-compat-lib would need to cater for:
- Constants
- ActionContext/ServletActionContext
- VelocityUtils bridge for static methods(if needed)
This is reproducible on Data Center: (yes)
Steps to Reproduce
- Use Struts based Confluence 8.0
Expected Results
Single version of plugin using ServletActionContext can work with both Confluence 7.x and 8.x
Actual Results
Currently, two different versions are required.
Workaround
Currently there is no known workaround for this behavior. Plugins would need two versions for compatibility.
- causes
-
CONFSERVER-80174 Fix for ActionContextCompatManager.setParameters method in compat-lib
-
- Closed
-
- mentioned in
-
Page Failed to load
Form Name |
---|
f68b7568bf9b:
Instead of waiting for the Confluence team to implement specific features, we've found it useful to implement our own code that gets dynamically loaded based on the Confluence version being used...then you can implement whatever you need.
You need to declare all of the relevant version-specific packages you are using as 'resolution:="optional"' imports in the pom's <Import-Package>, and then create a FactoryBean like the following that will load the implementation appropriate to the Confluence version in use.
For example, as written in the following snippet, you can freely inject a "FrameworkManager" into any other part of your code. The underlying bean will be instantiated as either a StrutsFrameworkManager or an XworkFrameworkManager class, from which you can then import classes that are only available in one Confluence version or another (such as creating Xwork/Struts interceptors).
This example is written using the Spring scanner, but it can presumably be adjusted for Java spring config.
To make this work, "FrameworkManager" needs to be created as an interface, and then StrutsFrameworkManager/XworkFrameworkManager need to be created as classes that implement that interface. Do not tag these two remaining classes with the @Component annotation, because you want them optionally loaded by the FactoryBean below, rather than being instantiated on startup. (You can tag their constructors with @Inject though.)