标签:setattr port util import jstl ext imp char prefix
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<%
List list = new ArrayList();
list.add("zmy");
request.setAttribute("list",list);
request.setAttribute("number",4);
%>
<c:if test="${not empty list}">
${list}
</c:if>
<hr>
<c:if test="${number%2!=0}">
${number}是奇数
</c:if>
<c:if test="${number%2==0}">
${number}是偶数
</c:if>
</body>
</html>
标签:setattr port util import jstl ext imp char prefix
原文地址:https://www.cnblogs.com/newcityboy/p/11478839.html