Then the classpath is determined by your runtime configuration, which in turn is influenced by how your project is configured. For example, if you have multiple source directories, they'll all get compiled to the configured output directory (there are several ways to configure output directories).
posted 9 years ago
lets imagin i don't like to put my xml file to src folder.
so i need it to put Diretly to project folder.
1)if i did that way how can i use ClassPathXmlApplicationContext to load beans?
2)or is there any other best way to do this other than using src folder?
As long as the file is on the classpath it doesn't matter where it is. For example, a Maven application would put config files in src/main/resource. So you could create another source directory and put it there. Putting it at the root level of your project itself, in my opinion, is a bad idea.
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad: