我做了一个简单的网络项目。为了便于使用,我使用了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