...
- Set "struts.devMode" to "true"
- Set "struts.class.reloading.watchList" to a comma separated list of directories, or jar files (absolute or relative 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>
Letting the reloading class loader handle all the classes can lead to ClassCastException(s) because instances of the same classes loaded by different class loaders can not be assigned to each other. To prevent this problem we suggest that struts.class.reloading.acceptClasses
is used to limit the classes loaded by the reloading class loader, so only actions are handled by it. This constant supports a list of regular expressions:
Code Block | ||
---|---|---|
| ||
<constant name="struts.class.reloading.acceptClasses" value="com\.myproject\.example\.actions\.*" />
|
Warning |
---|
This feature is experimental, and should never be used in production systems. |
...
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 or relative paths to jars or directories |
| List regular expressions of accepted class names |
| Comma separated list regular expressions of classes that will be loaded by the reloading class loader(we suggest to add regular expressions so only action classes are handled by the reloading class loader) |
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.