【发布时间】:2018-01-27 21:11:14
【问题描述】:
我做了一个简单的网络项目。为了便于使用,我使用了一个 maven jetty 插件,并多次尝试使用 jstl 库。原则上,该插件有一个内置的 jstl 库,实际上,虽然我没有明确包含 jstl-1.2.jar,但我的页面是编译好的。当我尝试使用 jstl 的功能时会出现问题。 示例jsp:
<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<html>
<body>
<h2>Hello World!</h2>
<c:set var = "salary" scope = "session" value = "${2000*2}"/>
<c:out value = "${salary}"/>
</body>
</html>
预览:
我试过这种方法:
1)to include the library as a dependancy in my pom.xml -> the same result
2)to include the library in WEB-INF.lib -> the same result
3)to include jstl-1.2.jar as external jar in dependencies -> the same result
我使用的是 NetBeans 8.2
【问题讨论】: