Is there a way to tell Spring to load classes from a given URL while instantiating the beans? I need to load classes from a location that is not in the classpath. If I were using pure Java, I could use URLClassLoader but how can I achieve this in Spring? I am using Spring 3.0
Is there a way to tell Spring to load classes from a given URL
Share
All Spring classes that extend
DefaultResourceLoadercan have an explicitClassLoaderreference set (viaDefaultResourceLoader.setClassLoader(ClassLoader).AbstractApplicationContexthappens to be one of those classes. So all ApplicationContext implementations that extend it (likeClassPathXmlApplicationContextandFileSystemXmlApplicationContext) can use an injectedClassLoaderreference.