手工把上诉两个包导入tomcat中,
问题得到解决
分析原因是
在JSP中声明uri的时候,写成了jstl 1.0的uri。
而1.0确实是不支持EL的,但是它的tld文件又存在于1.1的jar包中。
JSTL1.0的使用方法为:
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
JSTL1.1的使用方法为:
<%@ taglib uri="http://java.sun.com/jsp /jstl/core" prefix="c" %>
1.jstl 1.0和1.1支持的servlet,jsp规范都不相同,支持相应规范的tomcat的版本也有要求的。具体如下。
NOTE: Standard-1.1 (JSTL 1.1) requires a JSP container that supports the Java Servlet 2.4 and JavaServer Pages 2.0 specifications. Jakarta Tomcat 5 supports the new specifications. The Standard-1.1 taglib has been tested with Tomcat 5.0.3. Standard-1.0 (implementation of the JSTL 1.0 specification) requires a JSP container that supports the Java Servlet 2.3 and JavaServer Pages 1.2 specifications. Jakarta Tomcat 4 supports these specifications. The Standard 1.0 taglib has been tested with Tomcat 4.1.24.
2. web.xml中要申明相应的servlet版本。
JSTL1.1和JSP2.0需要servlet2.4
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4 " xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4 .xsd">
JSTL1.0和JSP1.2需要servlet2.3
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.3 " xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_3 .xsd">
3. JSTL1.0和JSTL1.1的uri是不一样的,但是他们的tld文件同时存在于同一个standard.jar中。
解压缩下载的standard.jar,你会在/META-INF/下发现有一个c-1_0.tld,还有一个c.tld。
其中c-1_0.tld是JSTL1.0的core标签库的tld文件,c.tld是JSTL1.1的core标签库的tld文件。
用文本软件打开两个文件就会找到具体的uri。