I am trying to manage my spring project configuration and utilizing the <import ../> tag feels like a good way to do that.
But it appears to _ONLY_ accept relative paths (even if a leading "/" character exists in the file reference).
It appears to prepend the current working directory to the front of the path it tries to open and then ask the class loader resource manager for it. In the case of configuring something from /WEB-INF/springtest-servlet.xml this means that:
<import resource="/foobar.xml"/>
Becomes an error for java.io.FileNotFoundException on "/WEB-INF/foobar.xml". From what I can see both of these things together are fatally wrong.
So what is the visable <import/> tag usage ?
What would others people think to making this feature more useful with an enchancement proposal to:
* use relative paths (as now) when there is no leading slash in the given path to use.
* use absolute paths when a leading slash is given in the path to use.
* keep <import resource=""/> for loading from the classloader.
* allow other forms like <import file="path/filename.xml"/> this would attempt to load the file from the current working directory (relating to where the config file that contains the <import../> is).
* allow other forms like <import file="/path/filename.xml"/> this would attempt to load the file from the root directory of the web-app.
Can any one point me to the documentation covering the <import/> tag ? Unfortunately a search on "spring import" yeilds too much noise also the spring manual is not available to be loaded as one huge HTML page to allow me to use the search facility within my browser. The search on the spring websites is a "news / press release search" not a "documentation search".


.
Reply With Quote
