Struts2學習中 servlet,api的版本問題

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>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章