?
本文檔使用 PHP中文網(wǎng)手冊 發(fā)布
<fmt:setBundle>標簽用來載入一個資源束,然后將它存儲在作用域中已命名的變量或bundle配置變量中。
<fmt:setBundle>標簽有如下屬性:
屬性 | 描述 | 是否必要 | 默認值 |
---|---|---|---|
basename | 資源束家族基礎名稱,暴露給作用域變量或配置變量 | 是 | 無 |
var | 存儲新資源束的變量 | 否 | Replace default |
scope | 變量的作用域 | 否 | 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:setBundle 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>
運行結(jié)果如下:
One Two Three
關于我們 聯(lián)系我們 留言板
手冊網(wǎng)