Use of FMT tags in jsp

Source: Internet
Author: User

<%@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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.