• 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown

XML configuration files

Ranch Hand
Posts: 73
  • 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?

Saloon Keeper
Posts: 26537
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.
    Bookmark Topic Watch Topic
  • New Topic