1. Determine if it is empty
<c:choose> <c:when test="${not empty ReportInfo.user_register_orgs.register_orgs_ Statistics}"> <tr> <td>${reportinfo.user_register_orgs.register_orgs_ Statistics.count}</td> <td>${reportInfo.user_register_orgs.register_orgs_statistics.label}< /TD> </tr>
2. Judging by conditions
<c:choose> <c:when test="${reportinfo.user_gray.has_report = = ' 1 '}"> Yes </c:when> <c:otherwise> no </c:otherwise></c: Choose>
3. JSON loop
<c:choose> <c:when test="${not Empty ReportInfo.user_idcard_suspicion.idcard_with_other_phones}"> <c:foreach items="${reportinfo.user_idcard_suspicion.idcard_with_other_phones}" var="Ruisiwop"varstatus="vs"> <tbody> <trclass="TC"> <td>${ruisiwop.susp_phone}</td> <td>${ruisiwop.susp_phone_ope Rator}</td> <td>${ruisiwop.susp_phone_province}/${ruisiwop.susp_phone_city}</td> <td>${ruisiwop.susp_updt}</td> </tr> </tbody> < /c:foreach> </c:when></c:choose>
4. Percentage of digital display
<fmt:formatnumber type="percent" value="${reportinfo.user_ Gray.contacts_number_statistic.pct_cnt_to_black}" />
5. Date formatting
(1) Date format output in the JSTL tag
Use the JSTL tag in a JSP page to convert a long timestamp to a formatted time string
1. Import Java.util.Date class via <jsp:usebean/>
2. Set the long time property value for a date instance by <jsp:setproperty/>
3. Format a date instance by <fmt:formatdate/>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"prefix="FMT"%><jsp:usebean id="DateValue" class="java.util.Date"/><jsp:setproperty name="DateValue"property=" Time"Value="${timestampvalue}"/><fmt:formatdate value="${datevalue}"pattern="mm/dd/yyyy hh:mm"/>
(2) JSTL formatting timestamps, such as 1427264998586 how to display 2015-03-25 02:29:58 such a format? Let's look at the following code:
<jsp:usebean id="mydate" class="java.util.Date"/> <c:Settarget="${mydate}"property=" Time"Value="${obj.date}"/> <fmt:formatdate pattern="YYYY-MM-DD Hh:mm:ss"Value="${mydate}"Type="both"/>
The package needs to be imported:
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt " %>
Common Jstl Tags