I lost track of the attributions (I *think* Bill O'Keefe was the original
poster), but essentially:

>>On Thu, 24 Jun 1999, James Duncan Davidson wrote:
>>>> I looked through the servlet spec, and didn't see any way to do
>>>> this, but I just want to know for sure.  Bascially, I'm looking
>>>> for a way to reload a servlet without shutting down the web
>>>> server.  I don't want to use the dynamic reloading facility,
>>>> since I don't
>
> >I think te original poster wants to load on demand a new version of the
> >servlet's class - a method like:
> >
> > ServletContext.markObsolete(Servlet myservlet);
> >
> >in order to inform the context to reload (through class loader)
> >when a new request comes.
> >This  opposed with expensive dynamic reloading provided by some web servers .
> >
> >There is no such method in JSDK.
> >Cezar.
>
> Yes, this is basically what I wanted to do.  Since there doesn't
> appear to be such a method, do you have any idea how this could
> be implemented?  Or, it this basically something that would have
> to be added to each servlet engine?  Thanks,

     Depending on why you want to do this, couldn't you achieve much
of the same effect by having the servlet instantiate and keep around a
separate class to do all of the dirty work, then having some way of
telling the servlet to throw away that class and reinstantiate it?

     I'm not sure how the library loading works in this case.  I.e.
given the following series of events:

     myservlet.class
     dirtywork.class <-- version 1

     start up servletengine
     servletengine loads in myservlet.class
     servletengine loads in dirtywork.class
     browser requests myservlet
     servletengine invokes myservlet.init
     myservlet.init calls myservlet.setupdirtywork
     mysevlet.setupdirtywork sets up dirtywork object

     overwrite dirtwork.class with new version

     poke myservlet.setupdirtywork somehow to get it to:
          throw away old dirtywork object
          reinstantiate dirtywork

     Does the servlet engine reload the class from disk or does it go
with some cached version of dirtywork.class that's already in memory?


Steven J. Owens
[EMAIL PROTECTED]
[EMAIL PROTECTED]

___________________________________________________________________________
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

Reply via email to