您的位置:首页 > 其它

c:if标签

2014-03-25 09:33 225 查看
  <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<%

  Date d=new Date();

  int hours=d.getHours();

  session.setAttribute("h",hours);

   %>

    if标签

    <c:if test="${sessionScope.h<12}">
      小时:${h },
上午好
    </c:if><br/>
    
   <c:if test="${sessionScope.h ge 12 && h<=14}">
  中午好
   </c:if>
   
   <c:if test="${sessionScope.h >14}">
   
下午好
   </c:if>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: