日期:2014-05-16  浏览次数:20293 次

JSTL函数的简单使用
<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="df" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>    
    <title>jstlServletTest.jsp</title>
  </head>
  <body>
   <table >
   	<tr><td>xg我的jstl标签</td></tr>
   	<c:forEach items="${list}" var="july" begin="2" end="23" >
   		<tr><td>${july}</td></tr>
   	</c:forEach>
   <fmt:formatNumber value='234682.1'
      maxIntegerDigits='4'
      maxFractionDigits='3'
      groupingUsed='true'/>
   <fmt:formatDate&nbsp; value="${data.note_time}" type="both" pattern="yyyy-MM-dd HH:mm:ss" />        
   <fmt:formatNumber value='234682.56759464'
                pattern='#,####.00000000000000000'/>
   ${df:substring("abcdefghijkh",2,4)}
   <c:out value="${type}" default="xxxxx"></c:out>
   <c:choose>
   	<c:when test=""></c:when>
   	<c:otherwise></c:otherwise>
   </c:choose>
   </table>
  </body>
</html>

?