代码如下:
<%
String rid = request.getParameter("rid");
UserService u_service = new UserService();
Record record = u_service.getRecord(Long.parseLong(rid));
 %><c:if test="${record.RIscancel == 0}" >
<FONT color=#ff0000>对方考虑中</FONT>
</c:if>其中Record是一个BEAN类,取出来的RIscancel的值是0,按理来说应该在页面中输出“对方考虑中”这些字!但运行起来却什么都没显示啊!?这是什么原因啊?

解决方案 »

  1.   

    <% 
    String rid = request.getParameter("rid"); 
    UserService u_service = new UserService(); 
    Record record = u_service.getRecord(Long.parseLong(rid)); 
    pageContext.setAttribute("record",record);
    %> 
      

  2.   

    同意一楼,你record都没保存,jstl怎么知道去哪里取呢,只有设置了,jstl才会JSP内置对象上找record
      

  3.   

    坑定是条件没满足 
    <c:if test="${record.RIscancel == '0'}" > 
    <FONT color=#ff0000>对方考虑中 </FONT> 
    </c:if>
      

  4.   

    <c:if test="${record.RIscancel)=='0'"> 
    <FONT color=#ff0000>对方考虑中 </FONT> 
    </c:if>
      

  5.   

    record.RIscancel 这个属性是整型的啊!!
      

  6.   

    不过,用标签的意思就是不要<%%>,你那里面还有这玩意,干脆也就别标签了,你直接<% if()%>多好
      

  7.   

    EL表达式取得是作用域中的值
    <% 
    String rid = request.getParameter("rid"); 
    UserService u_service = new UserService(); 
    Record record = u_service.getRecord(Long.parseLong(rid)); 
     session.setAttribute("record",record); //record放入作用域中
    %> <c:if test="${record.RIscancel == 0}" > //RIscancel要在你的bean用存在才可以 
    <FONT color=#ff0000>对方考虑中 </FONT> 
    </c:if> 
      

  8.   

    <c:if test="${record.RIscancel)=='0'"> 
    <FONT color=#ff0000>对方考虑中 </FONT> 
    </c:if>你就这样试试