I'm new to JSP so with this question I'm really just wondering if I have right idea about how JSP works. But anyway, I'm developing this web app where I need to fill a table with some values and color some of them green, some of them red, and some of them gray. What color they have is determined by the Java object that backs all of the values for each row. So this was my idea:
<td class="<%detail.getClassStyle()%>"><%= detail.getStatus() %></td>
which I had hoped would have turned out like this after the methods returned:
<td class="red">Down</td>
But it doesn't work. In the web page's source code class just says class="". So am I missing the point of how JSP works? And whether I am or not, could someone propose an idea of how to get my intended result?
Edit: There's also an additional class attribute getClassStyle() returns which denotes the column the cell is in. Something like: td class="detail red">Down So simply just coloring it red is not something I'd like to do.
<%= detail.getClassStyle() %>doesn't work, then perhaps the problem is on the Java side of the fence.