jstl_fmt

<%@ page language="java" contentType="text/html; charset=GB18030"
    pageEncoding="GB18030"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
<h1>测试格式化日期标签</h1>
 today(default):<fmt:formatDate  value="${today}"/><br>
 today(type="date"):<fmt:formatDate  value="${today}" type="date"/><br>
 today(type="time"):<fmt:formatDate  value="${today}" type="time"/><br>
 today(type="both"):<fmt:formatDate  value="${today}" type="both"/><br>
 today(dateStyle="short"):<fmt:formatDate  value="${today}" dateStyle="short"/><br>
 today(dateStyle="medium"):<fmt:formatDate  value="${today}" dateStyle="medium"/><br>
 today(dateStyle="long"):<fmt:formatDate  value="${today}" dateStyle="long"/><br>
 today(dateStyle="full"):<fmt:formatDate  value="${today}" dateStyle="full"/><br>
 today(type="both"  dateStyle="full" timeStyle="full"):<fmt:formatDate  value="${today}" type="both" dateStyle="full" timeStyle="full"/><br>
 today(pattern="yyyy/MM/dd HH:mm:ss"):<fmt:formatDate  value="${today}" pattern="yyyy/MM/dd HH:mm:ss" var="v" scope="page"/><br>
 ${v }
 
 <h1>测试格式化数字标签</h1>
 n(default):<fmt:formatNumber value="${n}" ></fmt:formatNumber><br>
 n(pattern=""###,###,###,###.####"):<fmt:formatNumber value="${n}" pattern="###,###,###,###.####" ></fmt:formatNumber><br>
 n(pattern=""###,###,###,###.0000"):<fmt:formatNumber value="${n}" pattern="###,###,###,###.0000" ></fmt:formatNumber><br>
 n(groupingUsed="false"):<fmt:formatNumber value="${n}" groupingUsed="false" ></fmt:formatNumber><br>
 n(maxFractionDigits="15" minFractionDigits="10"):
<fmt:formatNumber value="${n}" maxFractionDigits="15" minFractionDigits="10" ></fmt:formatNumber><br>
 n(minIntegerDigits="15" axIntegerDigits="10"):
<fmt:formatNumber value="${n}" minIntegerDigits="15" maxIntegerDigits="10" ></fmt:formatNumber><br>
 n(typ="currency"):<fmt:formatNumber value="${n}" type="currency" ></fmt:formatNumber><br>
 n(typ="currency" currencySymbol="$"):<fmt:formatNumber value="${n}" type="currency" currencySymbol="$" ></fmt:formatNumber><br>
 p(type="percent"):<fmt:formatNumber value="${p}" type="percent" minFractionDigits="2" maxFractionDigits="2"></fmt:formatNumber><br>
</body>
</html> 

你可能感兴趣的:(html,jsp,sun)