<c:if test="${consumrecord.contype eq '1'}">免费次数</c:if>
<c:if test="${consumrecord.contype eq '2'}">货币消费</c:if>
输出为空
${consumrecord.contype}输出有值,consumrecord.contype字段为String类型

解决方案 »

  1.   

    el 比较字符串用==就ok了.!
      

  2.   

    ${"a" == "a"}  ${"b" eq "b"} 
    这两种是都可以的阿.!  奇怪!
      

  3.   

    <c:if test='${consumrecord.contype == "1"}'>免费次数</c:if>
    <c:if test='${consumrecord.contype == "2"}'>货币消费</c:if>
      

  4.   

    <c:if test="${consumrecord[0] eq '1'}">免费次数</c:if>
    <c:if test="${consumrecord[1] eq '2'}">货币消费</c:if>
      

  5.   

    输出下${consumrecord.contype }
    很多时候el标签跟struts标签有冲突,导致出问题
      

  6.   

    <c:if test='${consumrecord.contype == "1"}'>免费次数</c:if>
    <c:if test='${consumrecord.contype == "2"}'>货币消费</c:if>
      

  7.   

    输出一下${consumrecord.contype }看看会不会是它的值不对
      

  8.   

    <c:if test='${consumrecord.contype == "1"}'>免费次数</c:if>
    <c:if test='${consumrecord.contype == "2"}'>货币消费</c:if>
      

  9.   

    <c:if test="%{consumrecord.contype == '1'}">免费次数</c:if>
    <c:if test="%{consumrecord.contype == '2'}">货币消费</c:if>
      

  10.   

    <c:if test="${news.status==1}">这样试试呢
      

  11.   

    看他们的值是不是有空格, 如果没有的话这样应该可以的吧。<c:if test="%{consumrecord.contype == '1'}">免费次数</c:if>
    <c:if test="%{consumrecord.contype == '2'}">货币消费</c:if>奇怪。