jstl: choose, when, otherwise, and jsp:include
843836Apr 10 2005 — edited Apr 10 2005Have a problem, hope someone can help, because it seems like there's nothing to troubleshoot, yet I have trouble.
A page named islands.jsp can receive params that tell which include to display. For example, if it was sent "islands.jsp?islandName=pr", it should display an include for Puerto Rico.
The code for islands.jsp looks like this:
<c:choose>
<c:when test="${param.islandName == 'pr'}">
<jsp:include page="/components/advPR.jsp" flush="true" />
</c:when>
<c:when test="${param.islandName == 'jamaica'}">
<jsp:include page="/components/advJAMAICA.jsp" flush="true" />
</c:when>
<c:otherwise>
<h1>Application Logic Problem Detected!</h1>
</c:otherwise>
</c:choose>
WHY is it that when it receives a url like "islands.jsp?islandName=pr", it prints out "Application Logic Problem Detected!" in an html h1 header? As usual, I wouldn't be asking this if it didn't already WORK correctly on my local machine, but when I upload to the public web server, no dice. Thanks in advance for any help,