views:

140

answers:

1

Hi. When we upload a .class file or a servlet to the server, the web server restarts. This does not happen when we upload a JSP. Is there a way to configure Resin so that it dynamically loads the class without restarting the web server?

+1  A: 

To my knowledge, Resin is the only servlet engine that can reload classes if they change. To do that, you need to use the <compiling-loader> that configures an auto-compiling WEB-INF/classes-style class loader. This compiling-loader will automatically compile Java code into .class files loading them.

Below, an example of WEB-INF/web-resin.xml:

<web-app xmlns="http://caucho.com/ns/resin"&gt;
  <prologue>
    <class-loader>
      <compiling-loader path="WEB-INF/classes"
                        source="WEB-INF/src"/>
    </class-loader>
  </prologue>
</web-app>

My understanding is that Resin will check each and every source file and, if they have changed from the .class time/date/size in WEB-INF/classes, then Resin unloads the current class from the JVM, recompiles the .java file, then reloads that class.

Pascal Thivent