Jsp JSTL如果不起作用

Jsp JSTL如果不起作用,jsp,jstl,Jsp,Jstl,我在使用JSTL标记时遇到了一些问题。我在pom.xml上添加了依赖项 代码如下: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1"> <title>Add Course</title> <meta http-equ

我在使用JSTL标记时遇到了一些问题。我在pom.xml上添加了依赖项 代码如下:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Add Course</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>


<body>

    <c:out value="AAA"></c:out>

    <c:set var="age" value="26" />

    <c:if test="${age >= 18}">
        <c:out value="You are eligible for voting!" />
    </c:if>
    <c:if test="${age < 18}">
        <c:out value="You are not eligible for voting!" />
    </c:if>

</body>

</html>
c:挂牌有效。 c:如果标签不起作用,尽管IDE没有给出任何错误

我做错了什么?

试试这个:

<c:if test="${age >= '18'}">
    <c:out value="You are eligible for voting!" />
</c:if>

这表明你有资格投票!由于这是的一个复制粘贴,我要说JSP是正确的。你在其他地方有问题。为什么这会起作用,而发布的代码显然不起作用?