I was looking at spring mvc source example (pet clinic) and was a bit confused. How I'm suppose to instantiate beans (getBean method) without having an application context. How spring does autowiring without it.
Asked
Active
Viewed 512 times
1
-
Which example are you referring to? – minion Feb 13 '15 at 14:58
-
There *is* a context, and you should almost never use `getBean` directly. – chrylis -cautiouslyoptimistic- Feb 13 '15 at 15:04
-
@minion I use this example https://github.com/spring-projects/spring-petclinic/ – flgdev Feb 13 '15 at 15:06
-
Application context is created automatically during application bootstrap phase. Take a look at this post for more details: http://stackoverflow.com/a/21714524/1291150 – Bohuslav Burghardt Feb 13 '15 at 15:08
-
classpath:spring/mvc-core-config.xml contains your webapp context configuration and classpath:spring/business-config.xml, classpath:spring/tools-config.xml contains your business layer configuration. What are you looking for exactly? – minion Feb 13 '15 at 15:10