我是一名 JSP 标签开发者。我将一个 type 参数传递给该标签。
代码如下:
<%@ attribute name="type" require="true" %>
<c:choose>
<c:when test="${type eq 'even'}">
<c:set var="remainder" value="0" />
</c:when>
<c:when test="${type eq 'odd'}">
<c:set var="remainder" value="1" />
</c:when>
<c:otherwise>
<%-- Want to throw exception!! --%>
</c:otherwise>
</c:choose>
如果我传递了错误的值,我希望抛出一个异常。当我搜索这个主题时,我只找到了这个。在JSTL中,我不能抛出普通异常吗?