jstl中当塞入控件的值为数字时,但界面显示为汉字时

jsp界面中应该写如下代码。显示的是汉字:

<table class="tablesty">
  <tr class="titlesty">
   <th>雇员编号</th>
   <th>雇员职位</th>
   <th>雇员姓名</th>
   <th>雇员性别</th>
   <th>雇员年龄</th>
   <th>所属部门</th>
   <th>雇员工龄</th>

  </tr>
  <c:forEach items="${EmployInfo}" var="employee">
   <tr style="text-align: center;background: #02F78E;margin:10px;">
   
    <td>000${employee.id}</td>
     <c:if test="${employee.post_type==1}"><td>行政助理</td></c:if>
    <c:if test="${employee.post_type==2}"><td>业务经理</td></c:if>
    <c:if test="${employee.post_type==3}"><td>总经理</td></c:if>

    <td>${employee.emp_name}</td>
     <td>${employee.emp_sex==1?"男":"女"}</td>
    <td>${employee.emp_age}</td>
    <td>${employee.organ_name}</td>
    <td>${employee.emp_year}</td>
   </tr>
  </c:forEach>
 </table>

jsp界面如果这样写显示的是代号
<table class="tablesty">
  <tr class="titlesty">
   <th>雇员编号</th>
   <th>雇员职位</th>
   <th>雇员姓名</th>
   <th>雇员性别</th>
   <th>雇员年龄</th>
   <th>所属部门</th>
   <th>雇员工龄</th>

  </tr>
  <c:forEach items="${EmployInfo}" var="employee">
   <tr style="text-align: center;background: #02F78E;margin:10px;">
   
    <td>000${employee.id}</td>
    <td>${employee.post_type}</td>
    <td>${employee.emp_name}</td>
    <td>${employee.emp_sex}</td>
    <td>${employee.emp_age}</td>
    <td>${employee.organ_name}</td>
    <td>${employee.emp_year}</td>
   </tr>
  </c:forEach>
 </table>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值