You have overridden init(ServletConfig) so you should store the servletConfig somewhere, or call the parent's init method.
In your init(): Either ctx = cfg.getServletContext(); Or super.init(cfg);
Overriding the init() method will prevent the default mechanism, so HttpServlet won't store the ServletConfig for you. That's why getServletContext() will cause NullPointerException. [ January 26, 2006: Message edited by: Satou kurinosuke ]
Christophe Verré wrote:You have overridden init(ServletConfig) so you should store the servletConfig somewhere, or call the parent's init method.
In your init():
Either ctx = cfg.getServletContext();
Or super.init(cfg);
Overriding the init() method will prevent the default mechanism, so HttpServlet won't store the ServletConfig for you. That's why getServletContext() will cause NullPointerException.
[ January 26, 2006: Message edited by: Satou kurinosuke ]
Thank you very much Mr Verré.
Four years later, you always helps someone else.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.