com.oreilly.servlet
Class VersionDetector

java.lang.Object
  extended by com.oreilly.servlet.VersionDetector

public class VersionDetector
extends java.lang.Object

A class to determine the current Servlet API version number, and the current JDK version number. It looks at the available classes and variables to make the determination. The class can detect Servlet API versions up to 2.2, and JDK versions up to 1.3.

It can be used like this:

 String servletVersion = VersionDetector.getServletVersion();
  
 String javaVersion = VersionDetector.getJavaVersion();

Version:
1.2, 2001/04/11, added detection of JDK 1.4, 1.1, 2000/09/22, added detection of Servlet API 2.3, 1.0, 2000/02/08
Author:
Jason Hunter, Copyright © 2000

Constructor Summary
VersionDetector()
           
 
Method Summary
static java.lang.String getJavaVersion()
          Determines the JDK version number.
static java.lang.String getServletVersion()
          Determines the Servlet API version number.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionDetector

public VersionDetector()
Method Detail

getServletVersion

public static java.lang.String getServletVersion()
Determines the Servlet API version number.

Returns:
a String representation of the servlet version

getJavaVersion

public static java.lang.String getJavaVersion()
Determines the JDK version number.

Returns:
a String representation of the JDK version