• 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

XML files needed for developing using Spring MVC and Hibernate?

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are the XML files needed for developing an application using Spring MVC and Hibernate
 
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
There is no answer to your question. What do you exactly mean?

I might have 2 xml files, or I might have 20 xml files in my Spring MVC/Hibernate application. or any number in between.

Mark
 
Gaurav Sandil
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mean to say that I have seen some code where they have used applicationContext.xml and DispatcherServlet.xml(usually Servlet name follwed by-servlet.xml) and seen some examples where they used only one.
What are the uses of these two xml files.
 
Mark Spritzler
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

Gaurav Sandil wrote:I mean to say that I have seen some code where they have used applicationContext.xml and DispatcherServlet.xml(usually Servlet name follwed by-servlet.xml) and seen some examples where they used only one.
What are the uses of these two xml files.



Cool, that makes more sense.

So with you have xxx-servlet-xml, that typically has just the Web Layer beans.

The applicationContext.xml has the middle tier beans like your services and repositories, as well as importing the xml files that have your infrastructure beans like dataSource and transactionManager.

Each of these files is actually loaded by different classes making two different ApplicationContext instances. One for the middle tier beans and one for the web layer beans which separates them in a good way. The Web Layer will have full access to beans in the middle tier, but not the other way around. But you do not want your middle tier to see any beans from your web layer. You should be able to call down the stack, but not up.

When you have seen it where they only have one file and one loading of the application context, those people are just not separating out the layers. You can do this and everything works, but I personally don't recommend it.

Mark
 
Gaurav Sandil
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Mark..
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic