Common expressions jstl

A, foreach loop
<c: forEach var = "each variable name" items = "to iterate list" varStatus = "for each object" begin = "cycle where to start" end = "Where is the end of the cycle to" tep = "cycle step">

Things to be output cycle

</c:forEach>

二、时间格式
<fmt:formatDate value="${today}" pattern="yyyy/MM/dd HH:mm:ss" />

<fmt:formatDate value="${today}" pattern="yyyy/MM/dd HH:mm:ss" var="d" />
${d}

Third, the digital format

1.<fmt:formatNumber value="12" type="currency" pattern="$.00"/> //-- $12.00

2.<fmt:formatNumber value="12" type="currency" pattern="$.0#"/> //-- $12.0

3. <fmt: formatNumber value = "1234567890" type = "currency" /> // - $ 1,234,567,890.00 (symbol of the currency and current local web server settings related)

4.<fmt:formatNumber value="123456.7891" pattern="#,#00.0#"/>// -- 123,456.79

5.<fmt:formatNumber value="123456.7" pattern="#,#00.0#"/> //-- 123,456.7

6.<fmt:formatNumber value="123456.7" pattern="#,#00.00#"/>// -- 123,456.70

7.<fmt:formatNumber value="12" type="percent" /> //-- 1,200% (type 可以是currency、 number、 和percent)

 

Guess you like

Origin www.cnblogs.com/hjylxh/p/11008284.html