1. 转自http://hi.baidu.com/luo_qing_long/blog/item/c23c15f4adb73bdef2d385c7.html
我们在java web开发的过程中,有时在资料上可能会提到环境所要支持的JSP,Servlet版本。如果版本低就可能出现测试错误。
方法: 打开tomcat的common/lib 目录下,有两个JAR文件: jsp-api.jar servlet-api.jar 。如果没有,那可能是你没有添加进来。解压这两个文件,用记事本分别打开META-INF下的MAINMEFT.MF文件。
我的Servlet版本是:Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.4.2_12-b03 (Sun Microsystems Inc.)
Name: javax/servlet/
Specification-Title: Java API for Servlets
Specification-Version: 2.4
Specification-Vendor: Sun Microsystems, Inc.
Implementation-Title: javax.servlet
Implementation-Version: 2.4.public_draft
Implementation-Vendor: Apache Software Foundation
我的JSP版本是:Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.4.2_12-b03 (Sun Microsystems Inc.)
Name: javax/servlet/jsp/
Specification-Title: Java API for JavaServer Pages
Specification-Version: 2.0
Specification-Vendor: Sun Microsystems, Inc.
Implementation-Title: javax.servlet.jsp
Implementation-Version: 2.0.public_draft
Implementation-Vendor: Apache Software Foundation
2. http://tomcat.apache.org/whichversion.html
Servlet/JSP Spec | Apache Tomcat version | Actual release revision |
2.5/2.1 | 6.0.x | 6.0.26 |
2.4/2.0 | 5.5.x | 5.5.28 |
2.3/1.2 | 4.1.x (archived) | 4.1.40 (archived) |
2.2/1.1 | 3.3.x (archived) | 3.3.2 (archived) |
http://wiki.apache.org/tomcat/TomcatVersions
Tomcat 5.5.x
Spec versions: | Servlet 2.4, JSP 2.0 |
Stable: | Yes |
Enhancements: | Unlikely |
Bug Fixes: | Yes |
Security Fixes: | Yes |
Releases: | Yes |
Release Manager: | Filip Hanik (fhanik) |
Process: | RTC |
Listed on download pages: | Yes |
Tomcat 6.0.x
Spec versions: | Servlet 2.5, JSP 2.1 |
Stable: | Yes |
Enhancements: | Yes |
Bug Fixes: | Yes |
Security Fixes: | Yes |
Releases: | Yes |
Release Manager: | Jean-Frederic Clere (jfclere) |
Process: | RTC |
Listed on download pages: | Yes |
Tomcat 7.0.x
Spec versions: | Servlet 3.0, JSP 2.2 |
Stable: | No |
Enhancements: | Yes |
Bug Fixes: | Yes |
Security Fixes: | Yes |
Releases: | No |
Release Manager: | TBD |
Process: | RTC |
Listed on download pages: | No |
3. 转自 http://neora.javaeye.com/blog/438653
不同版本(2.3,2.4,2.5) web.xml 头信息
Servlet 2.3
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
...
</web-app>
Servlet 2.4
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:web="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd "
version="2.4">
...
</web-app>
Servlet 2.5
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "
version="2.5">
...
</web-app>