-
Apr 16th, 2008, 09:40 AM
#1
Problem opening applicationContext.xml
hey all,
i have a class that due to design issue must get reference to the applicationContext.xml file explicitly to use the getBean method, the problem is that the file cant open the file, the .class file is located in the classes folder under WEB-INF... i dunno how to give it a relative path to the file,
i tried:
1- applicationContext.xml
2- WEB-INF/applicationContext.xml
but always says file does not exist.....any help??
thanks
-
Apr 16th, 2008, 09:44 AM
#2
One way would be to use WebApplicationUtils to resolve the WebApplicationContext.
A more elegant solution would be for your class to implement BeanFactoryAware. That way the context would be injected into your class, freeing you from the lookup.
Regards,
Andreas
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules