Way 1:
Look at properties file:
org/apache/catalina/util/ServerInfo.properties
Way 2:
Cehck for the existence of a class that you know exists in tomcat5 but not
tomcat 4.
Use one of the ways above to set a property to let you know the tomcat
version. I'm not sure which way would be easier at the
Is it possible to detect the version of Tomcat that the user has in
Ant? I have the following Ant task:
description="copies jdbc driver and context.xml to tomcat">
Copying database JDBC Driver to
${tomcat.home}/common/lib
Copying ${webapp.name}.xm