我必须从服务器检查一个属性,并且根据值,我必须设置字体的颜色。我用于相同的代码是:我在 jstl 中很新。可以用 javascript 或者 jQuery 处理,但是有一个限制,这里不能用 js。:(
<c:if test="${error != null}">
<c:choose>
<c:when test="${error_code eq 'failed'}">
<p align="left"><font size="3" color="red">${error}</font></p>
</c:when>
<c:when test=test="${error_code eq 'success'}">
<p align="left"><font size="3" color="green">${error}</font></p>
</c:when>
</c:choose>
</c:if>
服务器端代码是:
if (result) {
request.setAttribute("error_code","success");
request.setAttribute("error","Object successfully created.");
} else {
request.setAttribute("error_code","failed");
request.setAttribute("error","Object creation failed.");
}
我在这里做错了什么:
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
org.apache.jasper.JasperException: /tool/Content/content.jsp (li
ne: 68, column: 18) **quote symbol expected**
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorH
andler.java:42)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.j
ava:443)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.j
ava:89)