• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

init parameters

 
Don Bosco
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between the init parameters returned by methods(getInitParameter) in ServletContext and ServletConfig???
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looking at the API, we see that ServletContext init parameters are "context wide" - in other words, apply to the entire "web application" - the api says they are created with a context-param entry in web.xml as a child of the web-app element. (I can't say I have ever seen them used, but they look useful.)
Whereas ServletConfig init parameters are specific to the servlet and come from the init-param tags in the web.xml section for a particular servlet.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic