File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes getInitParamater() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
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://aspose.com/file-tools
 
subject: getInitParamater() method
 
Similar Threads
Sharpen your Pencil - Page 323 in HFEJB
NX: When should I throw DuplicateKeyException?
Changin font in a JTextArea
garbage collection
Finalization Method