jsp页面如何重新给传进来的值做判断

图片:
clipboard.png
详细代码:
<li class="li_2">

<h2 class=" mb5">${thematic.title }发布</h2>                        
<span class="f14 ">${thematic.documentName } ${thematic.information }</span>

</li>

问题:

 ${thematic.information }值为1,2,3 我想把   1变成"这是第一个"
                                            2变成"这是第二个"
                                            ...
 显示在页面上 

不知道应该怎么写代码,大神知道下

以解决:代码入下
<c:if test="${thematic.information == 1}">平面/互联网</c:if>
<c:if test="${thematic.information == 2}">微博</c:if>
<c:if test="${thematic.information == 3}">微信</c:if>
<c:if test="${thematic.information == 4}">电视/电台</c:if>

阅读 2.8k
1 个回答
<c:choose>
    <c:when test="${thematic.information eq 1}">
       这是第一个
    </c:when>
    <c:when test="${thematic.information eq 2}">
        这是第二个
    </c:when>
    <c:otherwise>
      ...
    </c:otherwise>
</c:choose>
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题