Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 34364 invoked from network); 24 Jul 2008 09:57:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jul 2008 09:57:19 -0000 Received: (qmail 30276 invoked by uid 500); 24 Jul 2008 09:57:06 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 30253 invoked by uid 500); 24 Jul 2008 09:57:06 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 30242 invoked by uid 99); 24 Jul 2008 09:57:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jul 2008 02:57:06 -0700 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [196.25.240.81] (HELO ctb-mesg-1-3.saix.net) (196.25.240.81) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jul 2008 09:56:09 +0000 Received: from animal (dsl-241-204-88.telkomadsl.co.za [41.241.204.88]) by ctb-mesg-1-3.saix.net (Postfix) with SMTP id 603B6219DA for ; Thu, 24 Jul 2008 11:55:52 +0200 (SAST) Message-ID: <001501c8ed73$8e92b3a0$0300000a@animal> From: "Johnny Kewl" To: "Tomcat Users List" References: <43e37d2e0807231351h16da6de5s453f58658fe3d2f9@mail.gmail.com> Subject: Re: retrieving tomcat info from within a war Date: Thu, 24 Jul 2008 11:56:28 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 x-mimeole: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Antivirus: avast! (VPS 080602-0, 2008/06/02), Outbound message X-Antivirus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org ----- 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 ("/org/apache/catalina/util/ServerInfo.properties"); Properties props = new Properties(); props.load(is); is.close(); serverInfo = props.getProperty("server.info"); serverBuilt = props.getProperty("server.built"); serverNumber = props.getProperty("server.number"); } catch (Throwable t) {} The rest of that stuff OS etc is just Java properties like... sInfo += "JVM Vendor: " + System.getProperty("java.vm.vendor") + "\n"; etc.... 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.. --------------------------------------------------------------------------- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --------------------------------------------------------------------------- --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org