You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Julius Davies <ju...@cucbc.com> on 2003/01/30 01:15:06 UTC

RE: Question about detecting version

Hello, Steve Vanspall,

Have you looked at any of these methods?

class javax.servlet.ServletContext

public int getMajorVersion()
- Returns the major version of the Java Servlet API that this servlet container supports.

public int getMinorVersion()
- Returns the minor version of the Servlet API that this servlet container supports.

public String getServerInfo()
- Returns the name and version of the servlet container on which the servlet is running.

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html

Notice that the "application" variable, implicitly visible in a jsp, is an instance of ServletContext.

=========================
<html>
<body>
<%= application instanceof ServletContext %>
</body>
</html>
=========================

That will print "true" in the browser.


yours,

Julius Davies, Programmer, CUCBC
Email: juliusdavies@cucbc.com, Ph: 604.730.6385



> -----Original Message-----
> From: Steve Vanspall [mailto:steve@crmsoftware.com.au]
> Sent: Thursday, January 30, 2003 3:29 AM
> To: Tomcat Users List
> Subject: Question about detecting version
> 
> 
> Hi there,
> 
> This may be an off-beat question.
> 
> Basically I am creating an installation application for my 
> software, for
> some people who are going to demonstrate it.
> 
> What I want to be able to do, is detect whether the correct version of
> Tomcat is installed on their system.
> 
> The installer will only be used in a Windows NT/2000 
> environment. I being
> platform specific goes against the whole point of JAva, but 
> this is a case
> where the guy doign the demo is all the way over the other side of the
> world. Have found some classes that will read the registry in 
> a Sun Java
> environment, but Tomcat only lists the version as 4.1, is 
> there a way to
> tell whether it is 4.1.1x as opposed to 4.1.1y etc?
> 
> Regards
> 
> Steve Vanspall
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Question about detecting version

Posted by Steve Vanspall <st...@crmsoftware.com.au>.
Thanks Julius,

That actually helps me with another problem.

However, my main problem here is that Tomcat will not be running.

And that the installer in not a web application running under tomcat.

I was wondering whether tomcat keep it's version number in a file somewhere

Regards

Steve Vanspall

-----Original Message-----
From: Julius Davies [mailto:juliusdavies@cucbc.com]
Sent: Thursday, 30 January 2003 11:15 AM
To: Tomcat Users List
Cc: steve@crmsoftware.com.au
Subject: RE: Question about detecting version



Hello, Steve Vanspall,

Have you looked at any of these methods?

class javax.servlet.ServletContext

public int getMajorVersion()
- Returns the major version of the Java Servlet API that this servlet
container supports.

public int getMinorVersion()
- Returns the minor version of the Servlet API that this servlet container
supports.

public String getServerInfo()
- Returns the name and version of the servlet container on which the servlet
is running.

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.h
tml

Notice that the "application" variable, implicitly visible in a jsp, is an
instance of ServletContext.

=========================
<html>
<body>
<%= application instanceof ServletContext %>
</body>
</html>
=========================

That will print "true" in the browser.


yours,

Julius Davies, Programmer, CUCBC
Email: juliusdavies@cucbc.com, Ph: 604.730.6385



> -----Original Message-----
> From: Steve Vanspall [mailto:steve@crmsoftware.com.au]
> Sent: Thursday, January 30, 2003 3:29 AM
> To: Tomcat Users List
> Subject: Question about detecting version
>
>
> Hi there,
>
> This may be an off-beat question.
>
> Basically I am creating an installation application for my
> software, for
> some people who are going to demonstrate it.
>
> What I want to be able to do, is detect whether the correct version of
> Tomcat is installed on their system.
>
> The installer will only be used in a Windows NT/2000
> environment. I being
> platform specific goes against the whole point of JAva, but
> this is a case
> where the guy doign the demo is all the way over the other side of the
> world. Have found some classes that will read the registry in
> a Sun Java
> environment, but Tomcat only lists the version as 4.1, is
> there a way to
> tell whether it is 4.1.1x as opposed to 4.1.1y etc?
>
> Regards
>
> Steve Vanspall
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org