<%@taglib prefix="FMT"URI="http://java.sun.com/jsp/jstl/fmt"%>the code shown on the JSP:<Fmt:bundlebasename= "Get.test">location of the//. properties File<span>Read the simplest information output from the. Properties file:</span> <Fmt:messageKey= "Smtphostname" /> <HR/> <span>From the. properties file, read the information with the optional parameters and fill in the parameters and output:</span> <Fmt:messageKey= "Msgwithparam"> <spanclass= "notice"><Fmt:paramvalue= "hahaha" /> <spanclass= "notice"><Fmt:paramvalue= "The amount of AH hehe" /> </Fmt:message> <HR/> <span>Number format and output:</span><BR/>Number:<Fmt:formatnumbervalue= "1234567890"type= "Number"/><BR/> <!--When you customize a number format, # indicates that it is in the default format, -number, custom format:<Fmt:formatnumbervalue= "1234567890"type= "Number"pattern= "#, #00.0#" /><BR/>Currency:<Fmt:formatnumbervalue= "35000"type= "Currency" /><BR/>percent:<Fmt:formatnumbervalue= "0.317"type= "percent" /><BR/> <HR/> <span>Formatted Date:</span><BR/> <Jsp:usebeanID= "Now"class= "Java.util.Date"></Jsp:usebean> <fmt:formatdatevalue= "${now}"type= "Date" /><BR/> <fmt:formatdatevalue= "${now}"type= "both"Datestyle= "Long"Timestyle= "Long" /><BR/> <fmt:formatdatevalue= "${now}"type= "both"pattern= "yyyy." Mm.dd HH:mm:ss " /><BR/> <HR/> <span>To convert a string to the correct number:<BR/>ignores the first character that does not match a numeric condition and all characters after it, if the string is not preceded by a number, the error</span><BR/> <Fmt:parsenumbertype= "Number" >123.02a</Fmt:parsenumber><BR/> <Fmt:parsenumbertype= "Number"pattern= "#, #00.0#">123</Fmt:parsenumber><BR/> <Fmt:parsenumbertype= "Number"pattern= "#, #00.0#">123.00a1</Fmt:parsenumber><BR/> <Fmt:parsenumbertype= "Number"pattern= "#, #00.0#">3saaa</Fmt:parsenumber><BR/> </Fmt:bundle>contents of the Propertis file Smtphostname=\u54c8\u54c8\u54c8\u501f\u53e3\u501f\u53e3\u5462msgwithparam=this is a msg with Params:first<FontColor= "Red">{0}</Font>Second<FontColor= "Aqua">{1}</Font>.
Use of FMT tags in jsp