tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Grunzke <eric.grun...@gmail.com>
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
jsp:

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

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.

-Eric


Landon Fabbricino wrote:
> 
> Not sure if this helps you or not.
> 
> You could use the following.
> 
> www.yourdomain.com/jspfile.jsp?jsp_precompile=true
> 
> You may be able to use this to your advantage somehow.
> 
> Landon Fabbricino
> IT Applications
> 
> Phone: 403.225.7515
> Fax: 403.225.7604
> lfabbric@agrium.com
> 

-- 
View this message in context: http://www.nabble.com/Programmatically-Force-JSP-Reload-tp21715300p21718708.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message