日期:2014-05-16  浏览次数:20332 次

关于jstl标签的一些问题
The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or
the jar files deployed with this application

  jstl:的应用配置:

  第一种:直接把tld文件放在web-inf下面,然后在web.xml配置

  第二种:把2个jar文件放在web-inf/lib/下,然后在jsp也面直接写固定的absolute uri


  如果是1.0版本的:
  <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

  1.1版本
  <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

使用下面的方式将字符集编码加入至页面并不能控制整个页面的编码
<%@ include file="/includeContentType.jsp" %>

includeContentType.jsp
----------------------
<%@ page contentType="text/html; charset=gbk" %>


____________________________________________________
java.lang.ClassCastException: javax.servlet.jsp.jstl.fmt.LocalizationContext

这个错误折磨了我好几天,看过一个国外的帖子
将jstl.jar,standard.jar放到tomcat/common/lib下问题马上解决。
但是没有说这样解决问题的原因,各位大侠可否指点一下,
我的tomcat版本是4.1.37,jstl和standard版本是1.0.2