1.引用taglib.jsp
<%@ include file="../../../static/inc/taglib.jsp"%> |
taglib.jsp内容:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path; String filePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort(); %> <!-- taglib.jsp --> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> <c:set var="ctxPath" value="<%=basePath%>" /> <c:set var="filePath" value="<%=filePath%>" /> <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%> <%@ taglib prefix='fmt' uri="http://java.sun.com/jsp/jstl/fmt" %> |
2.c:if
<c:if test="${mx.qygm == 0}" >一般企业 </c:if> <c:if test="${mx.qygm == 1}" >大企业 </c:if> |
3.保留两位小数
<td><fmt:formatNumber value="${ycskze}" pattern="#.##" minFractionDigits="2" /></td> |
4.加%保留两位
<td><fmt:formatNumber value="${zlsjezb*100}" pattern="#.##" minFractionDigits="2" />%</td> |
5.时间格式化
<td><fmt:formatDate value="${rw.cjsj}" pattern="yyyy-MM-dd hh:mm:ss"/></td> |
转载于:https://my.oschina.net/u/3037187/blog/856495