tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnny Kewl" <>
Subject Re: retrieving tomcat info from within a war
Date Thu, 24 Jul 2008 09:56:28 GMT

----- Original Message ----- 
From: "Jerry Atrick" <>
To: <>
Sent: Wednesday, July 23, 2008 10:51 PM
Subject: retrieving tomcat info from within a war

> Is there a way to retrieve tomcat version/info from within a War file? I
> actually would prefer this to be web container agnostic, but I'm working
> with Tomcat, so that's where I will start.
> I know that the manager does almost exactly what I want when going to:
> http://localhost:8080/manager/serverinfo
> but for the life of me, I can't seem to find it in the src.

They hide it in a property file....

heres the code

        try {
            InputStream is = ServerInfo.class.getResourceAsStream
            Properties props = new Properties();
            serverInfo = props.getProperty("");
            serverBuilt = props.getProperty("server.built");
            serverNumber = props.getProperty("server.number");
        } catch (Throwable t) {}

The rest of that stuff OS etc is just Java properties


sInfo += "JVM Vendor: " + System.getProperty("java.vm.vendor") + "\n";


I wonder what would happen if you ran this against Glassfish.... I bet it 
works... coz TC is probably hiding in there somewhere ;)

agnosticism thru theft... ha ha

Have fun..

The most powerful application server on earth.
The only real POJO Application Server.
See it in Action :

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message