This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes getInitParamater() method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "getInitParamater() method" Watch "getInitParamater() method" New topic
Author

getInitParamater() method

Mathew Sam
Ranch Hand

Joined: Dec 19, 2001
Posts: 124
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

Joined: Sep 08, 2002
Posts: 2
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

Joined: Dec 19, 2001
Posts: 124
Thanks Suresh
Sam
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: getInitParamater() method
 
Similar Threads
garbage collection
Changin font in a JTextArea
Sharpen your Pencil - Page 323 in HFEJB
Finalization Method
NX: When should I throw DuplicateKeyException?