<TD align= "center " width=7%>
<FONT size= "2 "> 是否审核 </FONT> </TD>
<%
}
String thesistag= " ";
int tag = Integer.parseInt(String.valueOf(academic.getThesistag()));
switch(tag)
{
case 0:thesistag= "未审核 ";break;
case 1:thesistag= "已审核 ";break;
}
%>
<td align= "center " >
<FONT size= "2 "> <%=thesistag%> </FONT> </td>
我想从数据库中得到thesistag=1的时候,也就是页面显示已审核的时候,已审核几个字变成红色的,而显示未审核的时候,已审核几个字变成绿色的
------解决方案--------------------
最凡用用switch.
<TD align= "center " width=7%>
<FONT size= "2 "> 是否审核 </FONT> </TD>
<%
}
String thesistag= " ";
String color= "green ";
int tag = Integer.parseInt(String.valueOf(academic.getThesistag()));
if(tag==0){
thesistag= "未审核 ";
color=red;
}else{
thesistag= "已审核 ";
}%>
<td align= "center " >
<font color= " <%=color%> "> thesistag </font>
</td>
看看对不?
------解决方案--------------------
<TD align= "center " width=7%>
<FONT size= "2 "> 是否审核 </FONT> </TD>
<%
}
String thesistag= " ";
//此处确认tag是否为0 或者1
int tag = Integer.parseInt(String.valueOf(academic.getThesistag()));
switch(tag)
{
case 0:thesistag= " <font size= '2 ' color= 'red '> 未审核 </font> ";break;
case 1:thesistag= " <font size= '2 ' color= 'green '> 已审核 </font> ";break;
}
%>
<td align= "center " >
<%=thesistag%> </td>