• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

dispatcher servlet vs application context.xml

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
I have some basic doubts .
what is the difference between dispatcher servlet and application context.xml ?
If we are using Spring MVC, then along with handler mappings, can we declare Spring support beans (Dao,session ...)also in Dispatcher Servlet ?
which one is needed for applications ? Spring allows only one (either dispatcher or applicationcontext) per application ?
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Indu,
1. As you a aware of Dispatcher-servlet.xml is for the spring handler mapping and applicationContext.xml is for the application beans such as the DAO, sessions.. 2. Yes, you can declare spring support beans in dispatcher-servlet.xml, but its not a good practice though.. 3. Generally, if you use spring MVC, you need dispatcher-servlet.xml. If the application needs DAO access, mail sessions, then they can be defined in applicationContext.xml.. 4. No, spring does not limit to one per application, you can have as many xml as you want and initailize using a contextloaderlistener..
 
indu iyengar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Prasad for your detailed explanation
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic