Hello,
I'm new here, so all the normal disclaimers...
I wrote a servlet and needed to read some configuration, so I overrode
init(ServletConfig config). I forgot to invoke super(config) and then tried
invoking getServletContext() and got a NPE. It took me some (a lot actually)
time to figure out why...
My question is why can't a descriptive exception be thrown when invoking
anything that presumes that config is set? I refer to GenericServlet, where
a few methods rely on getServletConfig() to return a non-null value, and act
on it. TMHO the return value should be checked and a descriptive exception
be thrown ("servlet should be initialized" or whatever), instead of the NPE.
Thanks,
Zohar.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]