IDE :ECLIPSE
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding = "GBK"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<title>Insert title here</title>
</head>
<body>
<c:set var="example" value="${100+1 }" scope = "session"/>
<c:out value = "${example }"/>
</body>
</html>
报错:
http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
最简单的办法是把jstl.jar standard.jar复制到tomcat的web-inf/lib中(在tomcat6 webapps/examples/WEB-INF/lib 中也有这两个jar包。
运行结果:
101