File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How to get server startup info Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to get server startup info" Watch "How to get server startup info" New topic

How to get server startup info

Clarence Dy

Joined: Aug 30, 2006
Posts: 2

Is there a way for a servlet to get the time stamp on when the app server (or the JVM) was started? Is this even possible?

I was looking into deploying another app with a servlet that loads on startup. Basically this servlet would just carry the date/time stamp when it started.

My other application would then need to talk to this servlet using other communication methods. This seem like a crude solution and I was hoping to know if there's an easier way. Thank you.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63852

Why would you use a servlet for this when you could just use a context listener to place the timestamp in application context?

[Asking smart questions] [About Bear] [Books by Bear]
Rashid Mayes
Ranch Hand

Joined: Jan 11, 2006
Posts: 160
Try using

it sounds like you are interested in




There are several other beans you can use to get more information. Start by looking at the*.

Here is another exampe.

Rashid Mayes -
Clarence Dy

Joined: Aug 30, 2006
Posts: 2
Thank you very much, Rashid! This is very helpful.

I agree. Here's the link:
subject: How to get server startup info
It's not a secret anymore!