• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

ApplicationContext.xml

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In dispatcher-servlet we can do whatever we do in ApplicationContext.xml .

So why ApplicationContext.xml is used ?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

abhi jitnag wrote:In dispatcher-servlet we can do whatever we do in ApplicationContext.xml .

So why ApplicationContext.xml is used ?



Because Dispatcher Servlet is for the Web Layer/Tier, and the ContextLoaderListener/applicationContext.xml is for the middle tier. And just like in code, it is best to have seperation of concerns.

In many cases the teams working on the web layer know nothing about the middle tier and what beans to define for it. And the middle tier team provides a jar file tot he web tier with a Spring configuration already.

Yes, you can put all configuration in one big monolithic xml file and put it in your xxx-servlet.xml file, but that is one huge expensive xml file to maintain.

Mark
 
abhi jitnag
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic