It does nothing useful to catch a NullPointerException (unless
you have no idea of what your are doing); you have to accommodate
the possibility in your code.
Let's see the original source code and how you are changing it.
Cheers!
Mark
----- Original Message -----
From: "roy woods" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 16, 2001 7:53 AM
Subject: ServletContext causing problems
> Hi all
>
> I try to use the ServletContext in a simple way
> following the way Jason Hunter uses in his book page
> 271
> I copied his code:
>
> getServletContext().log(e,"my error stuff");
>
> The code compiles and everything ok but when I try to
> introduce an syntex error in my SQL query then I get
> the following exception on my browser. Anyone knows
> why?
>
> I changed the
>
> Error: 500
>
> Location: /servlet/Library
>
> Internal Servlet Error:
>
> java.lang.NullPointerException:
> at
>
javax.servlet.GenericServlet.getServletContext(GenericServlet.jav
a:205)
> at Library$HtmlSQLResult4.toString(Compiled
> Code)
>
>
> I would appreciate any help really
>
> roy
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
>
>
_________________________________________________________________
__________
> 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
>
___________________________________________________________________________
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