1. jsp页面的判断语句怎么写
你把标签都套在一起了 不报错才怪 不能这样写 标签冲突 JSP页面有异常
一楼说的对 用<% if 也可以 不会冲突
如果非要用标签 那这样吧
<c:if test="${typeName=='期刊'}">
<li class="curr"><a href="<c:url value='/journal.shtml?k=${elf:encodeURI(formBean.keyword)}'/>">;期刊</a></li>
</c:if>
只能分开写
2. jsp中如何用if语句设置时间段
你的比较肯定要把日期也算进去
18.30到第二天上午的6.30
Date(int year, int month, int 1, int 18, int 30) -Date(int year, int month, int 2, int 6, int 30)
再:date1.compareTo(date2);
compareTo
public int compareTo(Date anotherDate)比较两个日期的顺序。
指定者:
接口 Comparable<Date>; 中的 compareTo
参数:
anotherDate - 要比较的 Date。
返回:
如果参数 Date 等于此 Date,则返回值 0;如果此 Date 在 Date 参数之前,则返回小于 0 的值;如果此 Date 在 Date 参数之后,则返回大于 0 的值。
抛出:
NullPointerException - 如果 anotherDate 为 null。
转载请注明出处育才学习网 » jspif语句怎么写