On Thu, 18 Jul 2002, Tony LaPaso wrote:

> Date: Thu, 18 Jul 2002 00:38:51 -0500
> From: Tony LaPaso <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>
> Subject: Re: ??? Tomcat Bug? -- Throws NullPointerException ???
>
> Actually, you are wrong but your comments helped me find the
> general cause of the problem...it is not a bug in
> Tomcat...comments below....
>
>
> ----- Original Message -----
> From: "Jacob Kjome" <[EMAIL PROTECTED]>
>
>
>
> > Just because you are creating an inner class within a servlet
> does not mean
> > that that inner class now gets access to the ServletConfig.
>
> Yes, I should have access to it -- inner classes have access to
> their parent's fields. In this case my inner class *should* have
> complete access to the ServletConfig object stored in
> GenericServlet.
>
> By the time my init() is called, the ServletConfig object has
> already beens set by GenericServlet.init(ServletConfig config).
>
> The problem is that the ServletConfig object in GenericServlet is
> transient. When I serialize the Inner object the following
> objects get serialized as well:
>
>   1. My Servlet
>   2. GenericServlet (contains the transient ServletConfig object)
>
> I have more investigation to do....
>

Wouldn't it be just as easy to pass the ServletConfig object to the
contructor for your inner class?  Serializing and deserializing Servlet
classes is not going to be of much use.

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to