tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: Init Parameter
Date Fri, 19 Sep 2003 15:14:28 GMT

Strange... Make sure the context-param and init-param names are

Yoav Shapira
Millennium ChemInformatics

>-----Original Message-----
>From: Mailing List Servlet []
>Sent: Friday, September 19, 2003 11:11 AM
>Subject: Init Parameter
>Hello everybody,
>I started to learn servlets few times ago. Everything was working
>until I tried to get my <init-param> from my web.xml file.
>I receive all the time a null value when I ask the value of my
>String driver = getServletConfig().getInitParameter("driver").
>If I put the parameter in a <context-param>, no problem, it works.
>String driver = getServletContext().getInitParameter("driver");
>Can someone help me. Thanks
>Here is my web.xml file:
>  <context-param>
>    <param-name>driver</param-name>
>    <param-value>12345</param-value>
>  </context-param>
>  <servlet>
>    <servlet-name>techSupport</servlet-name>
>    <servlet-class>techSupportServlet</servlet-class>
>    <init-param>
>      <param-name>driver</param-name>
>      <param-value>54321</param-value>
>    </init-param>
>  </servlet>
>  <servlet-mapping>
>    <servlet-name>techSupport</servlet-name>
>    <url-pattern>/techSupport</url-pattern>
>  </servlet-mapping>
>To unsubscribe, e-mail:
>For additional commands, e-mail:

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

View raw message