1<body>2 <fmt:setlocale value= "en_US"/>Forcibly set the language encoding in the browser to Ja3<fmt:bundlebasename="Guo">4<FMT:messagekey="gretting"></fmt:message>5</fmt:bundle>
6<c:set var= "Price" value= "></c:set>"
<FMT:FormatNumberType= "Currency"Value=" ${price} "></fmt:formatNumber>
7</body>
Results:
Basename="Guo" Cannot add extension, which means guo.properties is the baseline configuration, <fmt:message key="gretting "> represents the value of the output key as gretting if the browser's language priority at this time
Is Chinese, then display the value of gretting in the Chinese configuration guo_zh.properties, if the language priority of the browser is Japanese, then display the Japanese configuration Guo_ The value of the gretting in Ja.properties .
If other languages are preferred in the browser, the key value in the baseline configuration (guo.properties) is displayed by default.
<FMT:formatnumber type= "currency" value= "${price}" ></fmt:formatNumber> The currency symbol used to display the language region of the current browser. For example,<fmt:setlocale value= "en_US"/> the strong language encoding into American English, so the currency is the dollar symbol.
1<body>2<fmt:setlocale value="ZH_CN"/>3<fmt:bundle basename="Guo">4<fmt:message key="gretting"></fmt:message>5</fmt:bundle>6 7<jsp:usebean id=" Now" class="java.util.Date"></jsp:useBean>8<fmt:formatdate value="${now}"/>9</body>
Results:
<fmt:formatdate value="${now}"/> Displays the now object in the style of the current browser's language region.
The internationalization of JSP