javascript - jsp页面如何重新给传进来的值做判断
迷茫
迷茫 2017-04-11 09:45:03
[JavaScript讨论组]

图片:

详细代码:
<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>

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

全部回复(1)
PHPz
<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>
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号