...
To use session-scoped components with Spring and Struts, see the Spring Session Components Workarounds analysis.
Class Reloading
The Spring plugin can be configured to automatically reload classes that change in the file system. This feature will enable code changes to be "hot deployed" without having to restart the web container. To enable this feature follow these steps:
- Set "struts.devMode" to "true"
- Set "struts.class.reloading.watchList" to a comma separated list of directories, or jar files (absolute paths)
- Add this to web.xml:
Code Block type xml <context-param> <param-name>contextClass</param-name> <param-value>org.apache.struts2.spring.ClassReloadingXMLWebApplicationContext</param-value> </context-param>
- Add Apache Commons JCI FAM to the classpath. If you are using maven, add this to pom.xml
Code Block type xml <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-jci-fam</artifactId> <version>1.0</version> </dependency>
Warning |
---|
This feature is experimental, and should never be used in production systems. |
Settings
The following settings can be customized. See the developer guide.
Setting | Description | Default | Possible Values |
---|---|---|---|
| The autowire strategy |
|
|
| Whether the autowire strategy should always be used, or if the framework should try to guess the best strategy based on the situation |
|
|
| Whether to have Spring use its class cache or not |
|
|
| List of jar files or directories to watch for changes |
| Comma separated list of absolute paths to jars or directories |
Installation
This plugin can be installed by copying the plugin jar into your application's /WEB-INF/lib
directory. No other files need to be copied or created.