I am using Tomcat 6.33 and I am wondering how can I check if it supports Servlet 3.0 or El 2.2 or not?
You can get the details programatically using ServletContext #getMajorVersion() and #getMinorVersion() . For knowing the JSP version corresponding to the Servlet, you can get details from this Tomcat page. Below is a brief summary (check Tomcat's corresponding version at the link above): Servlet 4.0 uses JSP 2.3.
You can look up the Java version Tomcat is really running with in the manager app, which is installed by default. Go to http://hostname:8080/manager/html (replace hostname by hostname or localhost), scroll to the bottom, there you will find "JVM Version".
To find out the Tomcat version, find this file – version.sh for *nix or version. bat for Windows. This version.sh file is normally located in the Tomcat bin folder. Find out everything about Tomcat.
Tomcat 8.5 was designed to run on Java 7 or later.
You can check by reading the Tomcat documentation - see the Apache Tomcat Versions page ... which lists the versions of the JSP and Servlet specs supported by each major version of Tomcat.
(Answer from the list: Tomcat 6.x supports Servlet 2.5 and JSP/EL 2.1)
If you want to find out the Servlet spec version at runtime, the ServletContext
API has methods called getMajorVersion()
and getMinorVersion()
that should tell you.
I also found this recipe for displaying various version numbers using a JSP:
Server info: <%= application.getServerInfo() %><br> Servlet version: <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %><br> JSP version: <%= JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() %><br> Java version: <%= System.getProperty("java.version") %><br>
From http://tomcat.apache.org/whichversion.html: Tomcat 6 supports Servlet 2.5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With