JSTL Else if equivalence

Posted by
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>JSTL test page</title>
</head>
<body>

<c:choose>
						<c:when
							test="${order.statusDisplay == 'waitingForPayment' || order.statusDisplay == 'awaitingBankTransferApproval'}">
							<c:set var="searchengine" scope="session" value="google" />
						</c:when>
						<c:when test="${order.statusDisplay == 'created'}">
							<c:set var="searchengine" scope="session" value="yahoo" />
						</c:when>

						<c:otherwise>
							<c:set var="searchengine" scope="session" value="empty" />
						</c:otherwise>
					</c:choose>
					<c:out value="${searchengine}" />
</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *