I think you want ServletContext.getInitParameter here. That is used with the "context-param" element (global to your web app). ServletConfig.getInitParameter is used with the "init-param" element (specific to one Servlet).

In addition to the JavaDocs, you should read the Servlet specification, which tells you how Servlets and Servlet containers are supposed to work. Trust me, it is required reading:

http://www.jcp.org/aboutJava/communityprocess/final/jsr154/

Erik




Bill Siggelkow wrote:

MyServlet extends HttpServlet {
public void init (ServletConfig config) {
String paramValue = config.getInitParameter("myContextParamName");
}
}

Personally, I have found the JavaDocs invaluable for this kind of stuff; you can find the Servlet 2.4 Javadocs online at http://jakarta.apache.org/tomcat/tomcat-5.0-doc/servletapi/index.html.

-Bill Siggelkow

Nishant wrote:

hi
can anyone tell me how can i get context-param parameter in my servlet .
thanks in advance
Regards
Nishant Patil
Software Engineer
Cybage Softwares Pvt. Ltd. (A CMM Level 3 Company)
West Avenue, Kalyaninagar
Pune - 411006
Ph. +91-20-4044700/4041700 Extn 355
[EMAIL PROTECTED]
www.cybage.com
"There is difference between knowing the Path and walking on the Path"



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to