当前位置: 代码迷 >> Java Web开发 >> <c:if>用法,该如何解决
  详细解决方案

<c:if>用法,该如何解决

热度:647   发布时间:2016-04-17 12:17:15.0
<c:if>用法
<c:if test="${restore=!null}">
<span class="STYLE7">回复内容:<%=restore%></span></c:if>

我的意思是 如果回复内容为空的话 就不显示 回复内容,我是这么写的 但是不对

------解决方案--------------------

------解决方案--------------------
<c:if test="${restore=!null}"> 
!= 写反了

------解决方案--------------------
<c:if test="${empty restore}"> 
<span class="STYLE7">回复内容: <%=restore%> </c:if> 

试试这样,呵呵

------解决方案--------------------
<c:if test="${restore!= null || restore!='null'}"> 
<span class="STYLE7">回复内容: <%=restore%> </c:if> 


我也不知道对不对
------解决方案--------------------
呵呵,不用这么麻烦了 ,不需要if标签 
直接:
<span class="STYLE7">回复内容:${restore}
  相关解决方案