简体   繁体   English

我怎么知道我的Tomcat是否支持Servlet 3.0?

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

我正在使用Tomcat 6.33,我想知道如何检查它是否支持Servlet 3.0或El 2.2?

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. 您可以通过阅读Tomcat文档来查看 - 请参阅Apache Tomcat Versions页面...其中列出了每个主要版本的Tomcat支持的JSP和Servlet规范的版本。

(Answer from the list: Tomcat 6.x supports Servlet 2.5 and JSP/EL 2.1) (从列表中回答:Tomcat 6.x支持Servlet 2.5和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. 如果你想在运行时找到Servlet规范版本, ServletContext API有一些叫做getMajorVersion()getMinorVersion()应该告诉你。

I also found this recipe for displaying various version numbers using a JSP: 我还发现了这个使用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>

Apache Tomcat 7.0.x onwords支持Servlet 3.0 API, Apache Tomcat 7.0.65是实际的发行版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM