Hi Rich,

This one is a bit of a problem.  It seems that the
tomcat server will never be able to get the right
dates unless it looks at the source code which may not
be in your war file.  

I would think a way to do what you suggest is to
integrate this into your build process.  On each of
your jsp files give them a name in the page scope like

String thefilename = "displaypage1";

Have a java properties file (lastmoddates) that is
created during the build process that lists the last
modification time for each file by the filename.  Read
the properties file into the application scope.  Each
file you have would get the property it needs from the
'thefilename' string.  

The only difficulty would be generating the properties
file (lastmoddates) during the build process.  You
could probably write a simple script to do it then
integrate it with ant. It might take a day or so to
complete this and the rest of the process.

Of course you could use XML instead of a properties
file :-)  Just kidding, XML is too much work for this.

Later,

Bill Gooding




--- "Richard O. Hammer" <[EMAIL PROTECTED]>
wrote:
> Using JSP, I would like to have an update report at
> the bottoms of my
> pages with a message such as: "This page last
> updated on March 18,
> 1995".  I want it to be honest, telling the
> save-date of the jsp file, 
> the date when I actually last edited the file.
> 
> I hoped that I would achieve this by using the code
> below, which I 
> think should capture the date when the servlet was
> compiled, which I 
> thought would be close enough to the date when I
> most recently saved 
> the file.  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.
> 
> So, I'm looking for suggestions.  How can I automate
> the honest 
> updating of my "page updated" reports?
> 
> Thank you,
> Rich Hammer
> Hillsborough, N.C.
> 
> 
> Near the bottoms of my JSPs I am using this line:
> <[EMAIL PROTECTED] file="updateReport.jsp" %>
> 
> 
> And here is that file, updateReport.jsp:
> 
> <%@ page
> import="java.text.DateFormat,java.util.Date" %>
> <%!
>     static DateFormat dateFormat =
> DateFormat.getDateInstance(DateFormat.LONG);
>     static String compileDate =
> dateFormat.format(new Date());
> %>
> <center
>       style= "font-size: smaller; font-family:
> sans-serif;
>               font-style: italic; text-align:
> center;"
>    >
>     This page last updated on <%= compileDate %>
> </center>
> 
> 
> 
> 
> _______________________________________________
> Juglist mailing list
> [EMAIL PROTECTED]
>
http://trijug.org/mailman/listinfo/juglist_trijug.org


__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

_______________________________________________
Juglist mailing list
[EMAIL PROTECTED]
http://trijug.org/mailman/listinfo/juglist_trijug.org

Reply via email to