I tried working with
Servlets ServletConfig. As I understood the
GenericServlet
gets the parameters automatically and using getServletConfig() brings
the config.
Now I have a servlet that extends from HttpServlet.
in it I have the init() method and in this method I call the
getServletConfig() but I get
a ServletConfig instance with no parameters !!!
What am I doing wrong ?
The parameters are set in the web.xml file descriptor.
<context-param>
<param-name>telephone</param-name>
<param-value>1234</param-value>
</context-param>
Now the problem with the getInitParameter() is that it doesn't bring the value
of "telephone" for example.
Furthermore the :
servletConfig.getInitParameterNames().hasMoreElements()
retruns false !!