摘要:本文将带你了解WEBAPP开发tomcat 5.5、6、7各版本的web-app标准,希望本文对大家学WEBAPP有所帮助。
本文将带你了解WEBAPP开发tomcat 5.5、6、7各版本的web-app标准,希望本文对大家学WEBAPP有所帮助。
刚把上周说的公司内各工程的web.xml给统一了,顺便看了下每个tomcat版本对应的标准servlet版本,如下:
The XSD version is preferred since JSP 2.0 / Servlets 2.4 (eg: Tomcat 5.5). Note that the XML encoding can be specified as ISO-8859-1, UTF-8, or any other valid encoding in either version, and should match the actual encoding of your text file.
注意 servlet 2.4、3.1之后xsi的变化。
Servlet 3.1 deployment descriptor
<web-app xmlns="//xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="//www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="//xmlns.jcp.org/xml/ns/javaee //xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"></web-app>
XSD example for JSP 2.2 / Servlets 3.0 (Tomcat 7.0):
<?xml version="1.0" encoding="ISO-8859-1"?><web-app xmlns="//java.sun.com/xml/ns/javaee" xmlns:xsi="//www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="//java.sun.com/xml/ns/javaee //java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"></web-app>
XSD example for JSP 2.1 / Servlets 2.5 (Tomcat 6.0):
<?xml version="1.0" encoding="ISO-8859-1"?><web-app xmlns="//java.sun.com/xml/ns/j2ee" xmlns:xsi="//www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="//java.sun.com/xml/ns/javaee //java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"></web-app>
XSD example for JSP 2.0 / Servlets 2.4 (Tomcat 5.5):
<?xml version="1.0" encoding="ISO-8859-1"?><web-app xmlns="//java.sun.com/xml/ns/j2ee" xmlns:xsi="//www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="//java.sun.com/xml/ns/j2ee //java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"></web-app>
DTD example for JSP 1.2 / Servlets 2.3 (Tomcat 5):
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "//java.sun.com/dtd/web-app_2_3.dtd"><web-app></web-app>
官方参考可见//www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/index.html。
对于spring,对应关系如下:
4.0 最低要求JDK 6,支持websocket, Servlet 3.0+
3.0 最低要求JDK 1.5,基于注解的配置,servlet 2.4,完全支持REST,包从spring.jar拆分为按模块进行组织
2.5 最低要求JDK 1.4.2,Servlet 2.3, JSP 1.2
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标移动开发之WebApp频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号