tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Grunzke <>
Subject Re: Programmatically Force JSP Reload
Date Thu, 29 Jan 2009 00:45:41 GMT

Thanks for the response, but that doesn't appear to solve my problem.  I'm
not really concerned with when jsps are compiled, or even when they are
loaded, but rather when they are reloaded.  Allow me to provide a sample

<%@page import="load.test.Car"%>
    out.write(Car.get("Mustang").getTopSpeed() + "<br/>");

This code will execute with no difficulties, until the domain model changes
for the type Car.  Once changed, my framework will reload the definition of
Car, but tomcat will not reload the jsp, because it is unchanged.  The next
visit to the jsp will throw a ClassCastException, as Car.get() in the jsp
will return the new class definition of Car, but attempt to cast it to the
old definition of Car that the jsp still has in memory.  I can manually fake
it by overwriting the jsp with an identical copy of itself, which tomcat
detects and then reloads.  This (along with additional sandboxing I've done)
proves that the jsp classes hold on to stale definitions.  Thus I need to
reload (but not necessarily recompile) jsp classes when I reload domain
classes, and I need to be able to do it programmatically.


Landon Fabbricino wrote:
> Not sure if this helps you or not.
> You could use the following.
> You may be able to use this to your advantage somehow.
> Landon Fabbricino
> IT Applications
> Phone: 403.225.7515
> Fax: 403.225.7604

View this message in context:
Sent from the Tomcat - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message