| Author |
getServletConfig() and getServletContext()
|
jose chiramal
Ranch Hand
Joined: Feb 12, 2010
Posts: 266
|
|
<init-param>
<param-name>adminEmail</param-name>
<param-value>abc@yz.com</param-value>
</init-param>
In the servlet code I have :
out.println(getServletConfig().getInitParameter("adminEmail"));
how can we invoke getServletConfig() just like that ?? Does every servlet inherit a getServletConfig() method ???
Also in case of <context-param> i have in servlet code :
out.println(getServletContext().getInitParameter("sthg"));
how can we invoke getServletContext() just like that ??
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56213
|
|
|
Did you check the Javadocs for your answer?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Brij Garg
Ranch Hand
Joined: Apr 29, 2008
Posts: 234
|
|
|
Please check Servlet, ServletConfig, ServletContext interface and GenericServlet class in JAVA API
|
 |
 |
|
|
subject: getServletConfig() and getServletContext()
|
|
|