title: getInitParameterNames() does not get init-parameters
body: <p>I'm taking my first steps on web developing using servlets. Now I'm trying to retrieve some init-parameters of a servlet as well as context ones. They are declared on web.xml as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"&gt;
      &lt;display-name&gt;JediWebTutorial&lt;/display-name&gt;
      **&lt;context-param&gt;
          &lt;param-name&gt;contextParam&lt;/param-name&gt;
          &lt;param-value&gt;contextValue&lt;/param-value&gt;
      &lt;/context-param&gt;**
      &lt;servlet&gt;
          &lt;servlet-name&gt;GreeterServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;jedi.servlets.GreeterServlet&lt;/servlet-class&gt;
          **&lt;init-param&gt;
              &lt;param-name&gt;servletParam&lt;/param-name&gt;
              &lt;param-value&gt;servletValue&lt;/param-value&gt;    
          &lt;/init-param&gt;**
      &lt;/servlet&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;GetParameterValuesServlet&lt;/servlet-name&gt;
  ...
  </code></pre>
  
  <p>I'm trying to get it within the GreeterServlet, in the doGet method, like this:</p>
  
  <pre><code>protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  
      ServletConfig config = getServletConfig();
      ServletContext context = config.getServletContext();
      Enumeration&lt;String&gt; servletParams = config.getInitParameterNames();
      Enumeration&lt;String&gt; contextParams = context.getInitParameterNames();
  
      for (String param : Collections.list(servletParams)) {
          System.out.println(param);
      }
  
      for (String param : Collections.list(contextParams)) {
          System.out.println(param);
      }
  ...
  </code></pre>
  
  <p>As expected, console shows the name "contextParam". However, it does not print the "servletParam" name. </p>
  
  <p>I'm struggling with it for hours and have assured that the  node is inside  and I'm not overriding init() method of GreeterServlet in any way (as it was reported as the cause of the problem in some cases on many discussion lists). I haven't found similar case on web - maybe for it's a too simple matter that I'm too beginer. Anyway, thanks for anybody who bother to take a look at it!</p>
  
  <p>By the way, if helpful, I'm using TomCat 7.0.34 and Eclipse Helios.</p>