File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes ApplicationContext.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "ApplicationContext.xml" Watch "ApplicationContext.xml" New topic
Author

ApplicationContext.xml

abhi jitnag
Greenhorn

Joined: Oct 17, 2010
Posts: 12
In dispatcher-servlet we can do whatever we do in ApplicationContext.xml .

So why ApplicationContext.xml is used ?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 16624

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

Joined: Oct 17, 2010
Posts: 12
Thank you.
 
 
subject: ApplicationContext.xml
 
Threads others viewed
Exception during application startup
Spring with Hibernate Integration
Data Leakage in Struts 2
Web application
Struts2 and Spring integration
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture