PDA

View Full Version : Accessing application-context residing in a jar


jayaramanettar
Apr 23rd, 2007, 11:23 AM
Hi,

I am developing a web application using Spring and Struts.

I am seperating the framework of my application from the rest of the application, so that I will be re-use the framework in another web application directly.

For this, I want to seperate the generic spring configurations from the rest of the application specific configurations. And I am planning to have a jar file with the framework including an application-context xml with the generic spring configurations.

I am using ContextLoaderListener to load the application contexts and now, I have to set contextConfigLocation to point to my generic application-context within the jar and another application specific application-context in WEB-INF.

This is where I am having the problem. I don't know how I should specify the path to my generic application-context residing in framework.jar in WEB-INF/lib.

I tried using WEB-INF/lib/framework.jar!/application-context-root.xml but it is not working. It gives me FileNotFoundException.

Can someone help me on this?

Regards,
Jayarama Nettar.

Joris Kuipers
Apr 23rd, 2007, 02:58 PM
try this instead:

classpath:/application-context-root.xml



Joris

jayaramanettar
Apr 24th, 2007, 01:33 AM
Hi Joris,

This works. Thank you very much.

Regards,
Jayarama Nettar.