PDA

View Full Version : How to refer a applicationContext.xml contain in a jar?



jplaurent@serial.ch
Jul 27th, 2006, 01:56 AM
In my Web application, some beans spring are define in a xml file applicationContext-fwk.xml. This xml file is in a jar : fwk.jar.
How I should configure the contextConfigLocation to refer to this file?

I try
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>fwk.jar!applicationContex-fwk.xml</param-value>
</context-param>
But doesn't work...
Thanks,

Andreas Senft
Jul 27th, 2006, 02:07 AM
If the jar is in the classpath you might try

<param-value>classpath:applicationContex-fwk.xml</param-value>

Regards,
Andreas

jplaurent@serial.ch
Jul 27th, 2006, 04:32 AM
Thanks, it's working!
Another post discuss about this issue
http://forum.springframework.org/showthread.php?t=27179