JSTL格式化库
来源:互联网 发布:cs fps优化 编辑:程序博客网 时间:2024/03/29 01:20
JstlFmtAction.java
public class JstlFmtAction extends Action {
public ActionForward execute(ActionMappingmapping, ActionForm form,
HttpServletRequestrequest, HttpServletResponse response)
throwsException {
request.setAttribute("today",new Date());
request.setAttribute("n",123456.123);
request.setAttribute("p",0.12345);
returnmapping.findForward("success");
}
jstl_fmt.jsp
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<h1>测试jstl格式化库</h1>
<hr>
<li>测试日期的格式化</li><br>
today(default):<fmt:formatDatevalue="${today}"/><br>
today(type="date"):<fmt:formatDatevalue="${today}"type="date"/><br>
today(type="time"):<fmt:formatDatevalue="${today}"type="time"/><br>
today(type="both"):<fmt:formatDatevalue="${today}"type="both"/><br>
today(dateStyle="short"):<fmt:formatDatevalue="${today}"dateStyle="short"/><br>
today(dateStyle="medium"):<fmt:formatDatevalue="${today}"dateStyle="medium"/><br>
today(dateStyle="long"):<fmt:formatDatevalue="${today}"dateStyle="long"/><br>
today(dateStyle="full"):<fmt:formatDatevalue="${today}"dateStyle="full"/><br>
today(pattern="yyyy/MM/ddHH:mm:ss"):<fmt:formatDate value="${today}"pattern="yyyy/MM/ddHH:mm:ss"/><br>
today(pattern="yyyy/MM/ddHH:mm:ss"):<fmt:formatDate value="${today}"pattern="yyyy/MM/dd HH:mm:ss"var="d"/><br>
${d }<br>
<p>
<li>测试数字的格式化</li><br>
n(default):<fmt:formatNumbervalue="${n}"/><br>
n(pattern="###,###.##"):<fmt:formatNumbervalue="${n}"pattern="###,###.##"/><br>
n(pattern="###,###.0000"):<fmt:formatNumbervalue="${n}"pattern="###,###.0000"/><br>
n(groupingUsed="false"):<fmt:formatNumbervalue="${n}"groupingUsed="false"/><br>
n(minIntegerDigits="10"):<fmt:formatNumbervalue="${n}"minIntegerDigits="10"/><br>
n(type="currency"):<fmt:formatNumbervalue="${n}"type="currency"/><br>
n(type="currency"):<fmt:formatNumbervalue="${n}" type="currency"currencySymbol="$"/><br>
n(type="percent"):<fmt:formatNumbervalue="${p}" type="percent" maxFractionDigits="2"minFractionDigits="2"/><br>
- JSTL格式化库
- JSTL-格式化标签库
- JSTL格式化标签库测试
- JSTL 格式化
- jstl 格式化
- jstl 格式化
- jstl格式化
- JSTL标签库数字,日期格式化
- EL表达式与JSTL格式化库(日期)
- JSTL标签库formatDate标签格式化日期
- JavaWeb---JSTL(fmt格式化标签库)
- JSTL标签库数字,日期格式化[转发]
- jstl fmt jstl格式化数据
- JSTL格式化日期
- jstl中的日期格式化
- jstl格式化日期标签
- jstl日期格式化
- jstl格式化日期标签
- 算法的概念
- SQL Server 中Inner join 和where的效率差异
- 如何扩展Windows服务器 2008年评估期
- JSTL标签总结
- SupeSite Rewrite规则 (7.0)
- JSTL格式化库
- 北京旅游攻略
- [转]详叙 Serializable "对象序列化"的用法和原理
- connect by start with详细用法
- Java-switch表达式中巧用String类型达到分支目的
- 注释及文档的故事
- sybase数据库配置经验交流
- vc 枚举磁盘,在磁盘里写文件的操作
- 设计模式概述