<%
switch(color) {
case RED : {
%>
<font color="RED"><%=data %></font>
<%
}
default : {
%>
<font color="BLACK"><%=data %></font>
<%
}
}
%>
There is a better way to do this though with scriptlets (if you must embed
java code).
<%
final String[] colors = new String[]
{ "black", "blue", "green", "red" };
int colorToUse = 3;
if (colorToUse >= colors.length) colorToUse = 0;
%>
<font color='<%=colors[colorToUse] %>'><%=data %></font>
-Jacob
| -----Original Message-----
| From: Steve Burrus [mailto:[EMAIL PROTECTED]]
| Sent: Monday, February 10, 2003 11:32 PM
| To: Tomcat Users List
| Subject: RE: Need help w. another jsp!
|
| Hi Denise, and I really do appreciate yer nice response back to my plea
| for some help/assistance with this damn "ControlFlow.jsp" of mine. Listen,
| did you know that the "switch-case" is in a jsp, and so the whole block is
| contained in these symbols (<% %>). Now, how exactly do I handle that? I
| need some guidance from you now. Is the whole block contained between
| brackets ({ }) or something?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]