I want to use spring for a non-web Java project. Where should the context file go? How do I identify their locations to the Spring container?
I'm sure there are various choices, but with a web application it is typical to put things in WEB-INF
, and to declare the locations in the web.xml
. How is this done in a stand-alone app?
location : src/main/resources/
then you can be precise by adding directories like moduleName/spring-application.xml
Put it in a resources
folder. And use ClassPathXmlApplicationContext
to load them. Use packages as your java classes use. E.g. src/main/resources/com/myapp/somemodule/context.xml
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With