I don't think the init parameters are available via the method you're using until after  the servlet is initialized. Try using this signature for init

public void init(ServletConfig config) throws ServletException

and then using the getParameterNames method on the ServletConfig object.

On 1/31/07, John Hawkins < hawkins_j@btconnect.com> wrote:

My servlet isn't picking up the init params. Am I doing something wrong?

Additionally - can I change these params in the geronimo-web.xml file so they change at deployment?

My servlet init method

public void init() throws ServletException
// I used to get a specific param but that failed too so I moved to this test case
Enumeration names = getServletContext().getInitParameterNames();
System.out.println("Printing out init params");

outputs this to stdio ->
Printing out init params

but no params !

This is the web.xml....

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"

<display-name>my servlet</display-name>
<description>Test servlet</description>
<distributable> </distributable>

Here's my geronimo-web.xml... .

<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1">
<dep:environment xmlns:dep=" http://geronimo.apache.org/xml/ns/deployment-1.1">
<dep:dependencies />
<dep:hidden-classes />
<dep:non-overridable-classes />