Hello Mr Hunter
To begin with, I have two files. I have the init() in
the main file and I am not overwritting anything. My
init is set like this
public void init(ServletConfig config) throws
ServletException{
super.init(config);
The class that contains the above code is the main one
and the HtmlSQLResult.java is just used as a helper
class that prints the result in HTML table.
In HtmlSQLResult.java class I have no init() at all
and it is in that class I am using the
getServletContext().log("error",e). I guess I don't
need to have two init methods in both classes. Do I?
--- Jason Hunter <[EMAIL PROTECTED]> wrote:
> I suspect you overrode init(ServletConfig) without
> calling
> super.init(config).
>
> -jh-
>
> roy woods wrote:
> >
> > 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.java: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
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.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