• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Application context

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I recently came across a question that when is the context file of spring loaded?

I replied that for a standalone application it would load whenever the main method is called.
And for a web application it would be loaded on startup.

Could anyone please provide me with the correct answer with explanation if these are wrong?
 
Ranch Hand
Posts: 608
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For a standalone application (and web too really) the context is loaded whenever the applicationContext object is created in the program,



For a web application this is normally taken care by the DispatcherServlet or the ContextLoaderListener. Which is why you normally don't need to instantiate the applicationContext manually for web apps!
reply
    Bookmark Topic Watch Topic
  • New Topic