JSP中的C标签使用EL表达式时,如果EL表达式中有使用双引号需要改成单引号,否则报错。
如:
<c:forEach items="${fn:split(product.image,";")}" var="temp" begin="0" end="${fn:length(fn:split(product.image,";"))}" varStatus="tempsta">
<li><img class="${tempsta.first?'bdorange':'bdgrey' }" src="${temp}"/></li>
</c:forEach>
以上代码会报c标签解析错误,需要将el中的双引号改成单引号:
<c:forEach items="${fn:split(product.image,';')}" var="temp" begin="0" end="${fn:length(fn:split(product.image,';'))}" varStatus="tempsta">
<li><img class="${tempsta.first?'bdorange':'bdgrey' }" src="${temp}"/></li>
</c:forEach>