java - Tomcat start datetime info -



java - Tomcat start datetime info -

is there simple way how info when tomcat started? know in tomcat log file, other option?

thank you

not far know. can solve differently (and container independent!) help of servletcontextlistener.

@weblistener public class config implements servletcontextlistener { @override public void contextinitialized(servletcontextevent event) { event.getservletcontext().setattribute("startupdate", new date()); } // ... }

this way it's available in jsp as

class="lang-xml prettyprint-override"><p>webapp startup date: ${startupdate}</p>

(formatting can done jstl <fmt:formatdate>)

or in servlet as

date startupdate = (date) getservletcontext().getattribute("startupdate"); // ...

java tomcat

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -