The absolute uri: http://java.sun.com/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
代码:
<%@ page contentType="text/html; charset=GBK" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
<title>
MyFirstJSP
</title>
</head>
<body bgcolor="#ffffff">
<jsp:useBean id="clock" class="java.util.Date" scope="request"/>
<c:choose>
<c:when test="$(clock.hours<12)">
<h1>Good morning!</h1>
</c:when>
<c:when test="$(clock.hourz<18">
<h1>Good day!</h1>
</c:when>
<c:otherwise>
<h1>Good evening!</h1>
</c:otherwise>
</c:choose>
</body>
</html>
产生的问题:
rg.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet debugjsp threw exception
org.apache.jasper.JasperException: 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的包(WEB-INF/lib文件夹)
解决方法:
检查虚拟目录下WEB-INF目录下的lib文件夹(如果同有lib文件夹,后动创建一个)中是否有jstl.jar
的standard.jar两个java包。如果没有则把它们复制到lib下面。