How to know which servlet and JSP version am I using?

You can easily check the JSP,SERVER and SERVLET version. Add the following code in your jsp page after that run using any IDE Tools.

Server Version: <%= application.getServerInfo() %><br>
Servlet Version: <%= application.getMajorVersion() %>.<%= application.getMinorVersion() %>
JSP Version: <%= JspFactory.getDefaultFactory().getEngineInfo().getSpecificationVersion() %> <br>

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
  • Servlet 3.1 uses JSP 2.3
  • Servlet 2.5 uses JSP 2.1
  • Servlet 2.4 uses JSP 2.0
  • Servlet 2.3 uses JSP 1.2
  • Servlet 2.2 uses JSP 1.1
  • Servlet 2.1 uses JSP 1.0

Tags:

Java

Servlets

Jsp