Announcement Announcement Module
Collapse
No announcement yet.
Loading file system resources relative to application context configuration. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Loading file system resources relative to application context configuration.

    Using FileSystemXmlApplicationContext, is there any way loading file system resources by specifying a path relative to the application context configuration location (instead of relative to current working directory)?

    Specifically, I would like to use an absulote path only once in my (standalone) application when instantiating my FileSystemXmlApplicationContext, and use path locations relative to the application context location in my bean properties set ups (they are using files located in the same folder as of the application context configuration files).

  • #2
    Try ClasspathXmlApplicationContext if you have your xml files into your package structure, or in default package.

    Comment


    • #3
      Actually, I wrote an independent component provided with a jar and configuration xml files, the client can put each of them wherever he likes, the only thing my component needs to be set with, is the absulote path to the spring xml.

      Anyway, I solved it by adding the user provided folder to classpath (using a URLClassLoader set to that folder), and loading ClassPathXmlApplicationContext using that class loader.

      Comment

      Working...
      X