Servlets.com

Home

What's New?

com.oreilly.servlet

Servlet Polls

Mailing Lists

List Archives

Servlet Engines

Servlet ISPs

Servlet Tools

Documentation

Online Articles

The Soapbox

"Java Servlet
Programming,
Second Edition"

"Java Enterprise
Best Practices"

Speaking & Slides

About Jason

XQuery Affiliate

Advertising Info

VersionDetector

com.oreilly.servlet
Class VersionDetector


java.lang.Object
  |
  +--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
clone, equals, finalize, 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

 


Home   com.oreilly.servlet   Polls   Lists   Archives
Engines   ISPs   Tools   Docs   Articles   Soapbox   Book

Copyright © 1999-2005 Jason Hunter
Privacy Policy

webmaster@servlets.com
Last updated: October 30, 2006