JSTL I18N 格式标签库

<%@pagelanguage="java"pageEncoding="gbk"%>
<%@taglibprefix="c"uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglibprefix="fmt"uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:useBeanid="date"class="java.util.Date"></jsp:useBean>
<html>
<head>
<title>I18N标签库</title>
</head>
<body>
<H4>
<c:outvalue="<fmt:setlocale>标签的使用"></c:out>
</H4>
<hr>
<fmt:setLocalevalue="en_us"/>
英文:
<fmt:formatDatevalue="${date}"type="both"dateStyle="full"
timeStyle="full"/>
<hr>
<fmt:setLocalevalue="zh_cn"/>
中文:
<fmt:formatDatevalue="${date}"type="both"dateStyle="full"
timeStyle="full"/>
<hr>
<fmt:setLocalevalue="zh_TW"/>
中国台湾:
<fmt:formatDatevalue="${date}"type="both"dateStyle="full"
timeStyle="full"/>
</body>
</html>
<%@pagelanguage="java"pageEncoding="gbk"%>
<%@taglibprefix="c"uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglibprefix="fmt"uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:useBeanid="date"class="java.util.Date"></jsp:useBean>
<html>
<head>
<title>I18N标签库</title>
</head>
<body>
<fmt:formatDatevalue="${date}"></fmt:formatDate>
<br>
<fmt:formatDatevalue="${date}"type="both"></fmt:formatDate>
<br>
<fmt:formatDatevalue="${date}"type="both"dateStyle="default"
timeStyle="default"></fmt:formatDate>
<br>
<fmt:formatDatevalue="${date}"type="both"dateStyle="short"
timeStyle="short"></fmt:formatDate>
<br>
<fmt:formatDatevalue="${date}"type="both"dateStyle="long"
timeStyle="long"></fmt:formatDate>
<br>
<fmt:formatDatevalue="${date}"type="both"dateStyle="full"
timeStyle="full"></fmt:formatDate>
<br>
<fmt:formatDatevalue="${date}"type="both"dateStyle="full"
timeStyle="full"></fmt:formatDate>
<br>
</body>
</html>


本文出自 “阿凡达” 博客,请务必保留此出处http://shamrock.blog.51cto.com/2079212/1537253

你可能感兴趣的:(jstl)