数据库字段类型为byte  值为 0  ,1查询出来页面上我想表示 0 是未通过
1是未通过。怎么转换呢?

解决方案 »

  1.   

    在页面上有if标签或EL表达式三元运算一下不就行了
      

  2.   

    name==0?"未通过":name==1:"通过"?"未知状态"
      

  3.   

    页面导入 c 标签   <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%><c:if test="${name eq 1 }">通过</c:if>
    <c:if test="${name eq 1 }">未通过</c:if>
      

  4.   

    <option value="0" ${vo.status==0?"selected='selected'":""}>未通过</option>
    <option value="1"${vo.status==1?"selected='selected'":""}>已通过</option>
    这样楼主更直观些吧