tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harry Chen <hch...@csee.umbc.edu>
Subject getServletContext() returns null
Date Sat, 01 Jul 2000 00:31:54 GMT
Hi. I got my servlets start running just fine. I can even do servlet
renaming. But for some reason, everytime i try to call getServletContext()
or getServletConfig() in either doGet() or doPost() method, it always
return NullPointerException. 

Any idea?  thanks.

Here is a clip of my web.xml file.
-------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app 
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" 
    "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"
>

<web-app>
   
    <context-param>
      <param-name>Manufacture</param-name>
      <param-value>My Company</param-value>      

      <param-name>Version</param-name>
      <param-value>1.0</param-value>

    </context-param>

    <servlet>
      <servlet-name>StoreMgr</servlet-name>
      <servlet-class>StoreManagerServlet</servlet-class>

      <init-param>
        <param-name>StoreName</param-name>
        <param-value>Banana Republic</param-value>
      </init-param>        
   </servlet>

</web-app>



- Harry


---
Harry L. Chen			
hchen4@cs.umbc.edu
http://www.cs.umbc.edu/~hchen4
University Of Maryland Baltimore County

Public PGP Key is available upon request


Mime
View raw message