<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>星期中英对照</title>
</head>
<body>
<%
request.setAttribute("day", "m");
%>
${day}
<c:choose>
<c:when test="${day == ‘m‘}">//注意这里 "${day == \"m\"}"
<p>星期一</p>
</c:when>
<c:when test="${day == 2}">
<p>星期二</p>
</c:when>
<c:when test="${day == 3}">
<p>星期三</p>
</c:when>
<c:when test="${day == 4}">
<p>星期四</p>
</c:when>
<c:when test="${day == 5}">
<p>星期五</p>
</c:when>
<c:when test="${day == 6}">
<p>星期六</p>
</c:when>
<c:when test="${day == 7}">
<p>星期天</p>
</c:when>
<c:otherwise>
<p style="color: #f20d0d;">内容不对哟</p>
</c:otherwise>
</c:choose>
</body>
</html>
原文:https://www.cnblogs.com/zx-coder/p/13052864.html