Jan 10th, 2013, 01:39 PM
Context import with classpath*:foo-*-context.xml
I would like to import additional context only if it exists on classpath to load a "plugin". I cannot use exact name in import tag as exception would occur when file is not found (plugin may not be loaded and app should work). I wanted to use wildcard expressions to load plugin context from classpath (packed in jar). However I find classpath*:foo-*-context.xml not finding context that is in my plugin jar (that is on the classpath). Context is in jar's root directory - I am using tomcat and spring 3.0.5. Is it normal that classpath* does not work with wildcards in context names? Or maybe it works in newer version?
I am also thinking about alternative solution like attaching into spring's context load process with some custom class and would look for my custom plugin context with even exact name and load it and does not throw exception when plugin is not loaded. Do you have any hint how I could achive it?