首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

求指教解决思路

2013-10-21 
求指教有如下条件:1、op的值为‘m’且${ fn:split(product.smallpic, |)[0] }不为null 则显示图片2、op的值

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


                                        <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:if test="${param.op eq 'm' && empty fn:split(product.smallpic, '
[解决办法]
')[0]}"></c:if>
<c:if test="${param.op eq 'm' && !empty fn:split(product.smallpic, '
[解决办法]
')[0]}"></c:if>
[解决办法]
empty ++

热点排行