81,122
社区成员




<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ 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=ISO-8859-1">
<title>Insert title here</title>
<style type="text/css"></style>
</head>
<body>
<c:set var="credit" value="0.000" />
<c:if test="${credit==0}">
DR1
</c:if>
<fmt:parseNumber value="${credit}" type="number" var="credit2"></fmt:parseNumber>
<c:if test="${credit2==0}">
DR2
</c:if>
</body>
</html>
public class MyFunctions {
public MyFunctions(){}
public static int toInt(double in){
return (int)in;
}
}
<uri>MyFunctions</uri>
<tlib-version>1.0</tlib-version>
<jsp-version>2.0</jsp-version>
<short-name>MyFunctions</short-name>
<function>
<name>toInt</name>
<function-class>xxx.MyFunctions</function-class>
<function-signature>int toInt(double)</function-signature>
</function>
<%@ taglib uri="MyFunctions" prefix="myf" %>
<c:if test="${myf:toInt(a.credit) == 0}">
DR
</c:if>