Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I know if my Tomcat supports Servlet 3.0 or not?

Tags:

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?

like image 233
Adam Lee Avatar asked Jan 16 '13 13:01

Adam Lee


People also ask

How do I know which servlet version I am using?

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.

How do I know what version of Java Tomcat is using?

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".

What version of Tomcat do I have?

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.

What version of Java does Tomcat 8.5 support?

Tomcat 8.5 was designed to run on Java 7 or later.


2 Answers

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> 
like image 166
Stephen C Avatar answered Sep 22 '22 15:09

Stephen C


From http://tomcat.apache.org/whichversion.html: Tomcat 6 supports Servlet 2.5

like image 25
igo Avatar answered Sep 20 '22 15:09

igo