I've never tried what you explain, but can't you pass the servlet's
ServletContext as a parameter when creating your worker (and implentation)
classes?
Like, set your worker classes to receive a ServletContext interface in it's
constructor and then create the worker class inside the servlet by doing
something like this:
Worker worker = new Worker(this.getServletContext());
[ Matthias Carlsson ]
[ Programmer (Java, CGI/Perl, Javascript, HTML) ] [ Web Designer ]
[ E-Mail : [EMAIL PROTECTED] ] [ ICQ: 1430647 ]
[ http://home1.swipnet.se/~w-18931/programming/ ]
> -----Ursprungligt meddelande-----
> Fr�n: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]F�r robert young
> Skickat: den 18 oktober 2000 17:37
> Till: [EMAIL PROTECTED]
> �mne: ServletContext & newInstance
>
>
> the system with which i am working was designed such that
> the servlets in the code base do little but instantiate
> 'worker' classes. these are created dynamically using
> newInstance(). then the actual implementation classes are
> instantiated [with newInstance()] by these objects.
>
> it would be really useful to stuff stuff into the ServletContext,
> from the implementation classes. ServletContext is, i think,
> visible to the implementation classes at runtime, since they are
> created in the scope of the originating servlet. or not?
>
> i've not found any syntax that will compile. is there any
> way to reference the ServletContext in this scenario?
>
> thanx,
> robert young
>
> __________________________________________________________________
> _________
> 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