Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

XML configuration files

 
Ranch Hand
Posts: 61
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

I had the following questions.

1. What is the difference between Spring configuration files(eg. HelloWeb-servlet.xml), web.xml, applicationContext.xml and Beans.xml?
2. Is there anything called servlet configuration file? If yes, what is the difference between servlet configuration file and Spring configuration file?

Thanks
 
Saloon Keeper
Posts: 24541
168
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The web.xml file - or more specifically, the /WEB-INF/web.xml file is what in JEE is known as the server-independent deployment descriptor. Along with the server-dependent deployment descriptor, they describe the overall configuration of every JEE web application. The server-dependent deployment descriptor's name and location vary with which brand of webapp server you are using. For example, for the Tomcat webapp server, it's a Context XML file and it can be located and named in a variety of ways. If you're interested, check the Tomcat server documentation.

The web.xml file is, approximately speaking, a "servlet configuration file", although it does much more than that. It also may not physically exist in modern webapps, since a lot of the information in it can now be supplied from annotations on the Java webapp classes.

All of the above information is independent of Spring and it applies whether you are using Spring (or Spring Boot) or not.

As far as Spring's configuration files go, again, modern apps carry a lot of that information in annotations. You can configure Spring in a lot of ways, in fact. For webapps, however, the usual setup is to define the beans in the application's WEB-INF/applicationContext.xml file. I believe Beans.xml has been used for non-web (standalone) Spring apps.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic