Announcement Announcement Module
Collapse
No announcement yet.
import statement in xml file with classpath in web context Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • import statement in xml file with classpath in web context

    Hi,

    Settings :
    Spring version 1.2 rc2
    Tomcat version 4.1
    Struts version 1.2.4

    I have a web app using struts as MVC framework.
    I use the spring plugin to load a applicationContext.xml file.

    In my applicationContext.xml file I use the <import resource=""/> statement to import other xml files.
    Until now I had all my xml file in the WEB-INF/spring directory.
    But now I have a jar file (not developped by me) containing a spring context file in com.client.spring.ApplicationContext.xml.
    This jar is in WEB-INF/lib.

    My question is :
    How can I specify the <import resource=""/> statement to check in the classpath ? (I tried <import
    resource="classpath:com.client.spring.ApplicationC ontext.xml"/>)

    thanks

    paskos

  • #2
    This syntax works for me:

    <import resource="classpath:/com/foo/app/config/applicationContext.xml"/>

    The leading slash is required, however Spring IDE (and as a result, MyEclipse) consider this invalid. But it'll work at runtime.

    -Chris

    Comment

    Working...
    X