You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David kerber <dc...@verizon.net> on 2007/12/27 17:53:25 UTC

Get tomcat version from webapp code?

I know I can get the java version from system.properties, but is there a 
way of getting the tomcat version from inside my app?  If so, how?  I'd 
like to be able to display that on an administrator's information page.

TIA!
D



---------------------------------------------------------------------
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


Re: Get tomcat version from webapp code?

Posted by Louis <la...@gmail.com>.
David kerber wrote:
> I know I can get the java version from system.properties, but is there 
> a way of getting the tomcat version from inside my app?  If so, how?  
> I'd like to be able to display that on an administrator's information 
> page.
>
> TIA!
> D

If you crack open the tomcat ROOT application from a default install and 
look at the index.jsp file, right at the top you'll some something like 
this:

<head>
    <title><%= application.getServerInfo() %></title>
...

Which displays this (in tomcat 5.5.23):
Apache Tomcat/5.5.23

Other reading:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletContext.html



---------------------------------------------------------------------
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


RE: Get tomcat version from webapp code?

Posted by Martin Gainty <mg...@hotmail.com>.
1.x taglib is quite old
I would check application functionality on newer versionMartin______________________________________________Disclaimer and confidentiality noteEverything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.> Date: Fri, 28 Dec 2007 22:15:52 -0500> From: dckerber@verizon.net> Subject: Re: Get tomcat version from webapp code?> To: users@tomcat.apache.org> > Louis wrote:> > David kerber wrote:> >> Thanks for the response, but I've never dealt with that at all. Is > >> there any sample code that would give me the equivalent of something > >> like getServerProperty( "version" ), and return "5.5.15", or "Apache > >> Tomcat 5.5.15", or something similar?> >>> >> D> > In a JSP:> > <%= application.getServerInfo() %>> >> > In a Servlet:> > String serverInfo = getServletContext().getServerInfo();> > Thanks, guys! Believe it or not, I did do a bit of searching for this, > but I guess I didn't happen upon the right search terms...> > D> > > > ---------------------------------------------------------------------> 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> 
_________________________________________________________________
Share life as it happens with the new Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_122007

Re: Get tomcat version from webapp code?

Posted by David Kerber <dc...@verizon.net>.
Louis wrote:
> David kerber wrote:
>> Thanks for the response, but I've never dealt with that at all.  Is 
>> there any sample code that would give me the equivalent of something 
>> like getServerProperty( "version" ), and return "5.5.15", or "Apache 
>> Tomcat 5.5.15", or something similar?
>>
>> D
> In a JSP:
> <%= application.getServerInfo() %>
>
> In a Servlet:
> String serverInfo = getServletContext().getServerInfo();

Thanks, guys!  Believe it or not, I did do a bit of searching for this, 
but I guess I didn't happen upon the right search terms...

D



---------------------------------------------------------------------
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


Re: Get tomcat version from webapp code?

Posted by Louis <la...@gmail.com>.
David kerber wrote:
> Thanks for the response, but I've never dealt with that at all.  Is 
> there any sample code that would give me the equivalent of something 
> like getServerProperty( "version" ), and return "5.5.15", or "Apache 
> Tomcat 5.5.15", or something similar?
>
> D
In a JSP:
<%= application.getServerInfo() %>

In a Servlet:
String serverInfo = getServletContext().getServerInfo();



---------------------------------------------------------------------
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


Re: Get tomcat version from webapp code?

Posted by David kerber <dc...@verizon.net>.
Thanks for the response, but I've never dealt with that at all.  Is 
there any sample code that would give me the equivalent of something 
like getServerProperty( "version" ), and return "5.5.15", or "Apache 
Tomcat 5.5.15", or something similar?

D

Martin Gainty wrote:
> Hi Dave-
>
> did you look at MBeanServer?
>
> http://tomcat.apache.org/tomcat-5.5-doc/catalina/funcspecs/mbean-names.html
>
> M-
> ----- Original Message ----- 
> From: "David kerber" <dc...@verizon.net>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Thursday, December 27, 2007 11:53 AM
> Subject: Get tomcat version from webapp code?
>
>
>   
>> I know I can get the java version from system.properties, but is there a 
>> way of getting the tomcat version from inside my app?  If so, how?  I'd 
>> like to be able to display that on an administrator's information page.
>>
>> TIA!
>> D
>>     



---------------------------------------------------------------------
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


Re: Get tomcat version from webapp code?

Posted by Martin Gainty <mg...@hotmail.com>.
Hi Dave-

did you look at MBeanServer?

http://tomcat.apache.org/tomcat-5.5-doc/catalina/funcspecs/mbean-names.html

M-
----- Original Message ----- 
From: "David kerber" <dc...@verizon.net>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Thursday, December 27, 2007 11:53 AM
Subject: Get tomcat version from webapp code?


> I know I can get the java version from system.properties, but is there a 
> way of getting the tomcat version from inside my app?  If so, how?  I'd 
> like to be able to display that on an administrator's information page.
> 
> TIA!
> D
> 
> 
> 
> ---------------------------------------------------------------------
> 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
> 
> 

---------------------------------------------------------------------
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