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 孟德尔随机化结果不一致
  • ¥20 求用stm32f103c6t6在lcd1206上显示Door is open和password:
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法