File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can we use a xml file to configure a servlet?

 
Sarath Mohan
Ranch Hand
Posts: 213
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13047
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic