Richard O. Hammer wrote:
But it looks like the servlet gets recompiled every time I restart
Tomcat, or, to be more specific, the date which this shows is the first
date after Tomcat has been restarted on which the page is accessed.
I can't say if the servlet is getting recompiled each time you restart,
but I can say that a static variable declared in this manner is initialized
when the class is loaded (or prior to the first object instantiation, at least).
You can verify this behavior with any static variable assigned by a method
call by setting a breakpoint on the variable in a debugger.
Thus - you will see a date that corresponds to the first time the class
is loaded...which happens when the first time the servlet is invoked
after Tomcat is restarted. It may happen later, as well, since the
servlet container is free to unload any class that is not in use. The
variable would then be re-initialized the next time the servlet is used.
You might try some sort of pre-processing (maybe via Ant) to insert
the file modification date prior compiling and deploying the code.
If you're using a SCM, you might be able to use a SCM-specific code
in the source file to insert the check-in date when you commit the
file (CVS can do this, I think - it'll insert the revision#, I've
never tried to insert a date).
--
*********************************
Chris Merrill
[EMAIL PROTECTED]
*********************************
_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org