Hey everybody -

I am trying to get Tomcat to dynamically compile JSPs that are uploaded through a web interface. I am using the org.apache.jasper.JspC ant task trough code to do it.

After a bit of work, I am able to get the file parsed and compiled into the proper directory, which as far as I know is:
<TOMCAT_HOME>/work/Catalina/mysite/org/apache/jsp/WEB_INF/tiles/public/layouts/
(I got this based on the fact that if I update the .jsp file by hand and wait for the scheduled jasper compile, the file in this directory gets updated.)


Both the .class and the .java files are updated with a time stamp of right around when the upload occurred, and if I view source on the .java file, it contains whatever change I uploaded into the .jsp file, so everything seems like it should work.

When browsing the site though, the updated version of the file is not used. If I restart the site (either through manager stop/start or reload, or through restarting tomcat) the new file is then used. Waiting for the scheduled jasper compile does NOT recompile the file (as would be expected I think...) If I change the .jsp file by hand after my upload/compile process, and wait for the scheduled jasper compile, the hand-updated version of the file is used.

It seems as though I am missing something when I do my compile. I looked through the JspC (and related) code, and it seems as though if any files were changed, it reloads the JSPServlet, and this somehow makes the updated files be used.

So - I guess the questions I have are:
- Does tomcat cache the compiled JSPs somewhere?
- If so, how to reload that cache?
- Does that fact that the newly-compiled file is always called from a <jsp:include page="xxx.jsp" /> make a difference?
- Is there a way to use the "running" jsp compiler instead of using the JspC ant task - I think using the JSPServlet would solve all my problems actually, but I see no way to call it from my code.



Thanks, Matt

PS - I am 99.9999% sure that this is not a browser/proxy caching issue. It happens on multiple browsers/computers, and I see no other caching issues on the site when changes are made, this is the only time/place.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to