<c:if test="${restore=!null}">
<span class="STYLE7">回复内容:<%=restore%></span></c:if>我的意思是 如果回复内容为空的话 就不显示 回复内容,我是这么写的  但是不对  

解决方案 »

  1.   

    <c:if test="${restore=!null}"> 
    != 写反了
      

  2.   

    刚才手误写反了<c:if test="${restore!=null}">
    <span class="STYLE7">回复内容:<%=restore%></c:if>从数据库中查restore为空的时候显示 回复内容:null
    我的意思是 当restore为空的时候  回复内容不显示  不知道我的意思大家理解不
      

  3.   

    <c:if test="${empty restore}"> 
    <span class="STYLE7">回复内容: <%=restore%> </c:if> 试试这样,呵呵
      

  4.   

    上面写错了,应该是not empty
      

  5.   

    String restore=rs.getString("restore");
    <c:if test="${not empty restore}"> 
    <span class="STYLE7">回复内容: <%=restore%> </c:if>还是显示回复内容:null怎么才能让回复内容:null这几个字不显示出来不知道我写的语句有什么问题
      

  6.   

    <c:if test="${restore!= null || restore!='null'}"> 
    <span class="STYLE7">回复内容: <%=restore%> </c:if> 
    我也不知道对不对
      

  7.   

    呵呵,不用这么麻烦了 ,不需要if标签 
    直接:
    <span class="STYLE7">回复内容:${restore}
      

  8.   

    少看了一点,要过滤掉前面几个字。。还是得
    <%String restore=rs.getString("restore");
    pageContext.setAttribute("restore",restore)
    %>
    <c:if test="{empty restore}">
    <span class="STYLE7">回复内容: <%=restore%> </c:if> 
      

  9.   

    有个方法可以不显示<span class="STYLE7">回复内容: <%=restore%> </c:if> 在你<span class="STYLE7">中加句style="deplay:none"~这样就不显示~不知道你要的是不是这样的效果
      

  10.   

    很简单
    <c:if test="${restore != ''}"> 
    <span class="STYLE7">回复内容: <%=restore%> </span> </c:if>试试这个,或者<c:if test="${restore != null && restore != ''}">
      

  11.   

    ……其实很简单
    <c:if test="${!empty restore}">...</if>