« | October 2025 | » | 日 | 一 | 二 | 三 | 四 | 五 | 六 | | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | | |
| 公告 |
戒除浮躁,读好书,交益友 |
Blog信息 |
blog名称:邢红瑞的blog 日志总数:523 评论数量:1142 留言数量:0 访问次数:9723320 建立时间:2004年12月20日 |

| |
[j2ee]jstl的版本不同引发的<c:param>问题 原创空间, 软件技术
邢红瑞 发表于 2005/6/29 12:31:46 |
使用惯了jstl1.1和jsp2.0,再使用jstl1.0和jsp1.2,发现了很多问题,主要是taglib的不同<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>和<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>发现<c:param>一个问题c-1_0.tld中<tag> <name>param</name> <tag-class>org.apache.taglibs.standard.tag.el.core.ParamTag</tag-class> <body-content>JSP</body-content> <description> Adds a parameter to a containing 'import' tag's URL. </description> <attribute> <name>name</name> <required>true</required> <rtexprvalue>false</rtexprvalue> </attribute> <attribute> <name>value</name> <required>false</required> <rtexprvalue>false</rtexprvalue> </attribute> </tag>c.tld中 <tag> <description> Adds a parameter to a containing 'import' tag's URL. </description> <name>param</name> <tag-class>org.apache.taglibs.standard.tag.rt.core.ParamTag</tag-class> <body-content>JSP</body-content> <attribute> <description>Name of the query string parameter. </description> <name>name</name> <required>true</required> <rtexprvalue>true</rtexprvalue> </attribute> <attribute> <description>Value of the parameter. </description> <name>value</name> <required>false</required> <rtexprvalue>true</rtexprvalue> </attribute> </tag>这说明<c:param>在使用<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%><% String pageoffset = "0";%> <c:param name="pager.offset" value="<%=pageoffset%>" />出现According to TLD or attribute directive in tag file, attribute value does not accept any expressions如果使用<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>支持表达式求值完全支持EL表达式是web.xml的头应该用<web-app 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" version="2.4">不是<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">其实这个dtd也不对,应该为<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" " http://java.sun.com/dtd/web-app_2_3.dtd"> |
|
回复:jstl的版本不同引发的<c:param>问题 原创空间, 软件技术
johnhzjx(游客)发表评论于2006/6/26 21:11:43 |
不是<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">其实这个dtd也不对,应该为<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" " http://java.sun.com/dtd/web-app_2_3.dtd">
这两者有什么区别吗?我测试的结果好像是一样,对<c:out value=${}/>和${}好像处理还是不一样,前面的翻译了,后面的在2.3里是不会翻译 |
|
» 1 »
|