日期:2014-05-17  浏览次数:20772 次

求指教
有如下条件:
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>

------解决方案--------------------
empty fn:split(product.smallpic, '
------解决方案--------------------
')[0] 或者 eq ""  试下
------解决方案--------------------
eq null这是和null比较,用empty。
------解决方案--------------------

确保你param.op这样能取到值。


 <c:when test="${ param.op eq m }">