MyEclipse: DWRSpringJPAExample (moving applicationContext.xml)

douglasmhurst - Jan 07, 2009 - 05:43 PM
Post subject: DWRSpringJPAExample (moving applicationContext.xml)
This example uses only index.jsp with no backing bean. It also places applicationContext.xml in the WEB-INF directory... which seems to be the only way it will work with DWR for some reason.

I placed my applicationContext.xml in my src directory (I think it does this by default? Where should it go?)

I need to move applicationContext.xml to WEB-INF from src to make DWR work, but when I do, my application doesn't work because...

beanFactory = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));

... no longer finds applicationContext.xml in src where it expected it.

Is there a way to move applicationContext.xml to WEB-INF from src and get things pointed the correct direction?
support-rkalla - Jan 08, 2009 - 07:33 PM
Post subject: RE: DWRSpringJPAExample (moving applicationContext.xml)
Douglas, in my limited experience with Spring, I noticed that depending on where you are loading your bean config file from, you use a different Resource implementation to do it. I guess there has to be one for Web Projects or direct File/Directory references and you just point it at WEB-INF/applicationContext.xml instead of the src dir -- but yes, the ClassPath loader won't work in that case.
All times are GMT - 6 Hours
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits