mirror of
https://github.com/apache/struts.git
synced 2026-08-07 15:46:57 +00:00
Make the class reloading implementation work with convention. (use the reloading class loader when an instance is requested using the class name)
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@794116 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
+4
@@ -209,4 +209,8 @@ public class ClassReloadingXMLWebApplicationContext extends XmlWebApplicationCon
|
||||
|
||||
public void onStop(FilesystemAlterationObserver filesystemAlterationObserver) {
|
||||
}
|
||||
|
||||
public ReloadingClassLoader getReloadingClassLoader() {
|
||||
return classLoader;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,10 +92,15 @@ public class StrutsSpringObjectFactory extends SpringObjectFactory {
|
||||
if ("true".equals(devMode)
|
||||
&& StringUtils.isNotBlank(watchList)
|
||||
&& appContext instanceof ClassReloadingXMLWebApplicationContext) {
|
||||
//prevent class caching
|
||||
useClassCache = false;
|
||||
|
||||
ClassReloadingXMLWebApplicationContext reloadingContext = (ClassReloadingXMLWebApplicationContext) appContext;
|
||||
reloadingContext.setupReloading(watchList.split(","), acceptClasses, servletContext);
|
||||
LOG.info("Class reloading is enabled. Make sure this is not used on a production environment!", watchList);
|
||||
|
||||
setClassLoader(reloadingContext.getReloadingClassLoader());
|
||||
|
||||
//we need to reload the context, so our isntance of the factory is picked up
|
||||
reloadingContext.refresh();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user