如何在同一JSP中使用多个资源包?
<FMT:setBundle>一样标签用于加载在指定范围的变量或束配置变量的资源束,并将其存储。
属性
<FMT:setBundle>一样标签具有以下属性-
示例
<%@ 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.nhooo.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>上面的代码将产生以下结果-
One Two Three
热门推荐
10 男孩中考蛋糕祝福语简短
11 情侣520的祝福语简短
12 伴娘前夫结婚祝福语简短
13 9字虎年简短祝福语
14 送开业花束祝福语简短
15 孩子成长祝福语老师简短
16 侄儿高考试祝福语简短
17 乔迁大吉花束祝福语简短
18 回复情侣祝福语大全简短