JSTL 版本选择 2.4&2.3

xiaoxiao2022-06-12  72

JSTL与Servlet版本对映

整理一下网上资源,方便查看。

 

1.  Servelt / JSP/JSTL / Java/Tomcat Version

 

Servlet   JSP      JSTL   Java  Tomcat2.5   2.1   1.2    5.0    6.0.x2.4   2.0   1.1    1.4    5.5.x2.3   1.2   1.0    1.2    4.1.x

 

  

2.  Servlet/JSTL

 

    2.1  Servlet(2.4)   ------->  JSTL 1.1

    在web.xml中使用*2.4.xsd, jsp中url使用*/jsp/jstl/*.

 

<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee  http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">   ...   </web-app>

 

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>

 

 

   2.2  Servlet(2.3)  ------->  JSTL 1.0

 

<?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>

 

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <%@ taglib uri="http://java.sun.com/jstl/xml" prefix="x" %> <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>

 参考文献:  Tomcat Servlet JSP JSTL间的版本依赖  JSTL环境的建立

 jsp servlet j2ee tomcat jdk的版本差别 

转载请注明原文地址: https://www.6miu.com/read-4933264.html

最新回复(0)