On Thu, 29 Apr 1999, Donald Ball wrote:

> > Technically, because we use a custom class loader, in order to load a
> > class which is not in the system classpath, one must use
> > 
> > this.getClassLoader().loadClass()
> 
> Just out of curiousity, should this statement work across servlet engines?
> I'm using it in my RouterServlet class to load helper modules - A) because
> System.getClassLoader doesn't work on JDK-1.1.x for Linux and B) it
> automagically reloads my helper classes when they change. I've never been
> certain that it was a safe thing to do though.

Well, there's no guarantee that this will reload classes, even if the
current class is reloadable, but it's always safe -- that is, it should
always load a class and function at a basic level.  It's certainly quite
valid wrt the Java language (probably better than Class.forName()).

In general, I believe you will get the same reloading w/in other servlet
engines (assuming they support class reloading) -- but I've never tried w/
another servlet engine, other than JRun.

Ed




-- --------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to