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

getInitParamater() method

 
Mathew Sam
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between getinitParameter() method in ServletContext and in ServletConfig ?
Can we use either of this to get the value of init patrametes ?

Sam
 
suresh thallam
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
by using context.getInitParameter() we can access context-wide initialized parameters. These parameters are defined in web.xml using <context-param> tags. These values are accessiable to all the servlets and jsps present in the context.
By using config.getInitParameter() we can access the initialization parameters defined for that servlet only. These are specific to that servlet only. These are defined in web.xml like this
<servlet><init-param><param-name>user</param-name><param-value>suresh</param-value></servlet>

Suresh
 
Mathew Sam
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Suresh
Sam
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic