...
- Application packages can be divided into bundles
- Supports Velocity and FreeMarker templates
- Supports Struts Spring integration
Missing Features
- No GUI for bundle administration
- Probably can't access application classes from bundles, including Spring classes
- No support for any results other than Velocity
Simple Usage
To If your actions do not extend ActionSupport, and you are not using Spring then convert your jar that contains Actions, Velocity files, and a struts.xml
file into a bundle, add a few lines in the jar's manifest.mf:
...
Now the jar is ready to be deployed. Drop the jar into the /WEB-INF/classes/bundles
directory and it will automatically be installed when the application starts up.
Advanced Usage
If your actions extend ActionSupport, or use other classes distributed with Struts, you will have to listen their package names in the jar's manifest.mf:
No Format |
---|
Import-Package: com.opensymphony.xwork2
|
If you want to use the Spring as the object factory for your actions, then follow these steps:
- Copy all these jar files into
/WEB-INF/classes/bundles
- Make sure that the following properties are set(with the listed values) or not set at all in struts.xml or struts.properties in your webapp:
Code Block | ||||
---|---|---|---|---|
| ||||
<constant name="struts.objectFactory" value="osgi" />
<constant name="struts.objectFactory.delegate" value="spring" />
<constant name="struts.freemarker.manager.classname" value="org.apache.struts2.osgi.BundleFreemarkerManager" />
|
Example
Here is how an example architecture would look:
...