BBJSP CORE:Otherwise Tag (Deprecated)

The BBJSP system is deprecated. For new development, use BBxServlet.


In BBj 16.0 and higher, the otherwise tag can be used within a <CORE.Choose> in a BBJSP Page to write text to the resulting HTML output that will be sent to the client browser when none of the <CORE.When> conditions are met.




The Core Tag Library library needs to be referenced in the BBJSP Page

The following example demonstrates using the <CORE.Choose> tag with the child <CORE.When> and <CORE.Otherwise> tags


<!DOCTYPE html/>

<%-- Import the tag library --%>
<%@ taglib uri='/WEB-CFG/tld/core.tld' prefix='c' %>

<a href='choose.bbjsp?v=<%= str(RND(7)+1) %>'>Click to try with a RANDOM number.</a>
<c:if test='${param["v"]}'>
<div style="text-align: center;font-size:150%">
The value received was : 
<c:when test='${param["v"] = 1}'>ONE</c:when>
<c:when test='${param["v"] = 2}'>TWO</c:when>
<c:when test='${param["v"] = 3}'>THREE</c:when>
<c:when test='${param["v"] = 4}'>FOUR</c:when>
<c:when test='${param["v"] = 5}'>FIVE</c:when>
<c:otherwise>${param["v"]} <small>(invalid, only 1 - 5 allowed)</small></c:otherwise>

See Also


Core Tag Library