aspose file tools*
The moose likes XML and Related Technologies and the fly likes Can we use a xml file to configure a servlet? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Can we use a xml file to configure a servlet?" Watch "Can we use a xml file to configure a servlet?" New topic
Author

Can we use a xml file to configure a servlet?

Sarath Mohan
Ranch Hand

Joined: Mar 17, 2001
Posts: 213
Hi friends,
Can we use an xml file to configure a servlet? I mean i need to pass some parameters that will configure my servlet.
Is it possible thru an XML file.
Plz help me

Sarath Mohan
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Sure - it is a great way to pass configuration information. Far superior to using properties if configuration is at all complex.
Of course, you have to initialize the servlet with a pointer to the file in the web.xml file for the application.
On the other hand, if your configuration data just consists or a few name - value pairs, use <init-param> tags in web.xml.
Bill

------------------
author of:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can we use a xml file to configure a servlet?