elephpant 2019-11-18 15:06 采纳率: 76.2%
浏览 241
已结题

JSP性别编辑JSP性别编辑JSP性别编辑

代码如下,emp_sex是整形的,怎样编辑JSP使sex=1是显示男,sex=0是显示女

 <table border="" cellspacing="" cellpadding="" align="center">
        <tr>
            <th>雇员编号</th>
            <th>雇员职位</th>
            <th>雇员姓名</th>
            <th>雇员性别</th>
            <th>雇员年龄</th>
            <th>所属部门</th>
            <th>雇员工龄</th>
        </tr>
        <c:forEach items="${requestScope.data.employee}" var="post">
        <tr>
        <th>${post.emp_id }</th>
        <th>${post.post.post_name}</th>
        <th>${post.emp_name }</th>
        <th>${post.emp_sex }</th>
        <th>${post.emp_age }</th>
        <th>${post.emp_depart }</th>
        <th>${post.emp_year }</th>
        </tr>
        </c:forEach>

        </table>

  • 写回答

1条回答 默认 最新

  • renkai721 2019-11-18 15:14
    关注

    大概的逻辑判断如下。

    <th><c:if test="${post.emp_sex ==1}">男</c:if><c:if test="${post.emp_sex !=1}">女</c:if></th>
    
    
    评论

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 5月18日

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型