Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

getDate on a resource

Dmitry Beransky

2003-12-13


Hi,

In my application i need to determine the last modification date of a
resource. I'm doing this with the following few lines of code:

    URL resource = context.getResource(uri);
    URLConnection conn = resource.openConnection();
    Date date = new Date(conn.getDate());


however, the date returned is 0. A call to getResource() returns a url
looking like "jndi:/localhost/reclass/layout.jsp".

Am I not doing this right? What's the proper way to find out a resource's
date?

I'm running Tomcat 4.1.27.


Thanks
Dmitry


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.