Is there anything wrong with this code? This is a JSP snippet.
<c:set var="components" value="${fn:split('IMS,NRF,CAV,NES',',')}"/> <div style="float:left;width:25%"> <table cellpadding="2" cellspacing="2" border="1"> <tbody> <c:forEach var="key" items="isIMSAlive,isNRFAlive,isCAVAlive,isNESAlive" varStatus="status"> <c:set var="componentStatus" value="${applicationMap[key]}"/> <c:choose> <c:when test="${componentStatus == 'DOWN' }"> <c:set var="color" value="#FF0000"/> </c:when> <c:otherwise> <c:set var="color" value="#00FF00"/> </c:otherwise> </c:choose> <tr> <td background-color: '${color}'> <c:out value="${components[status.index]} : ${componentStatus}"/> </td> </tr> </c:forEach> </tbody> </table> </div> I have tried a lot of things to fix it. I am running servlet 2.5 in web.xml so I know it is not that. I cannot post all of my code because I am not allowed. Here is the first couple of lines of web.xml.
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> It should print something like this: IMS : ALIVE NRF : ALIVE CAV : ALIVE NES : ALIVE But in a table and all of them should be highlighted in green unless they're DOWN, in which case they should be red. It is currently printing the actual code itself, not it's value. I know that the servlet is getting the hashMap to the jsp because I have debugging in place which shows the jsp knows and has access to the hashMap as well as it's values. I've tried single quotes, double quotes, no quotes. I've tried deleting certain snippets and doing trial and error. I have been stuck on this problem for hours now. Any input is appreciated. Thanks.
No comments:
Post a Comment