求指教
有如下条件:
1、op的值为‘m’且${ fn:split(product.smallpic, '|')[0] }不为null 则显示图片
2、op的值为‘m’ 但${ fn:split(product.smallpic, '|')[0] eq null }则显示“暂无图片”
<c:choose>
<c:when test="${ param.op eq 'm' }">
<c:when test="${ fn:split(product.smallpic, '|')[0] eq null }">暂无图片</c:when>
<c:otherwise>
<img id="product${ product.tp_id }" src="${ pageContext.request.contextPath }/${ fn:split(product.smallpic, '|')[0] }" width="60" height="60" />
</c:otherwise>
</c:when>
</c:choose>
<c:choose>
<c:when test="${ param.op eq 'm' }">
<c:when test="${empty fn:split(product.smallpic, '
[解决办法]
')[0] }">暂无图片</c:when>
<c:otherwise>
<img id="product${ product.tp_id }" src="${ pageContext.request.contextPath }/${ fn:split(product.smallpic, '
[解决办法]
')[0] }" width="60" height="60" />
</c:otherwise>
</c:when>
</c:choose>
确保你param.op这样能取到值。
<c:when test="${ param.op eq m }">
<c:when test="${ empty fn:split(product.smallpic, '
[解决办法]
')[0]}">暂无图片</c:when>
<c:otherwise>
<img id="product${ product.tp_id }" src="${ pageContext.request.contextPath }/${ fn:split(product.smallpic, '
[解决办法]
')[0] }" width="60" height="60" />
</c:otherwise>
</c:when>