?
Dokumen ini menggunakan Manual laman web PHP Cina Lepaskan
<fmt:message>標(biāo)簽映射一個(gè)關(guān)鍵字給局部消息,然后執(zhí)行參數(shù)替換。
<fmt:message>標(biāo)簽有如下屬性:
屬性 | 描述 | 是否必要 | 默認(rèn)值 |
---|---|---|---|
key | 要檢索的消息關(guān)鍵字 | 否 | Body |
bundle | 要使用的資源束 | 否 | 默認(rèn)資源束 |
var | 存儲(chǔ)局部消息的變量名 | 否 | Print to page |
scope | var屬性的作用域 | 否 | Page |
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> <html> <head> <title>JSTL fmt:message Tag</title> </head> <body> <fmt:setLocale value="en"/> <fmt:setBundle basename="com.tutorialspoint.Example" var="lang"/> <fmt:message key="count.one" bundle="${lang}"/><br/> <fmt:message key="count.two" bundle="${lang}"/><br/> <fmt:message key="count.three" bundle="${lang}"/><br/> </body> </html>
運(yùn)行結(jié)果如下:
One Two Three
關(guān)于我們 聯(lián)系我們 留言板
手冊(cè)網(wǎng)