"Margarita Romero S." wrote:
> Hi, I wrote an generic servlet which belongs to a package called
> "database". When I call this generic servlet from Netscape Enterprise
> Server 4.0. I obtain "nullpointerexception" when I use servlet runner
> It does work, why? My sentence is this: ConfigBDServlet DBConfig =
> (ConfigBDServlet)
>
> getServletConfig().getServletContext().getServlet("database.ConfigBDServlet"); What
> can I do?Greetings and thanks in advance,
>
> Margarita
Most likely this is caused by the fact that your servlet runner is based
on the 2.0 servlet API, while the Netscape servlet support is based on
version 2.1 or later. As of 2.1, the getServlet() method is deprecated,
and required to return null (for valid security reasons that have been
much discussed).
If you need access to the servlet instance just to get at shared data,
the recommended approach is to store your data objects (such as JDBC
connections or connection pools) as servlet context attributes. That
way, they are available to all servlets (and JSP pages) within the
current web application.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html