- JSP 基础教程
- JSP - 首页
- JSP - 概述
- JSP - 环境搭建
- JSP - 架构
- JSP - 生命周期
- JSP - 语法
- JSP - 指令
- JSP - 动作
- JSP - 隐式对象
- JSP - 客户端请求
- JSP - 服务器响应
- JSP - HTTP 状态码
- JSP - 表单处理
- JSP - 编写过滤器
- JSP - Cookie 处理
- JSP - Session跟踪
- JSP - 文件上传
- JSP - 日期处理
- JSP - 页面重定向
- JSP - 点击计数器
- JSP - 自动刷新
- JSP - 发送邮件
- JSP 高级教程
- JSP - 标准标签库
- JSP - 数据库访问
- JSP - XML 数据
- JSP - Java Bean
- JSP - 自定义标签
- JSP - 表达式语言
- JSP - 异常处理
- JSP - 调试
- JSP - 安全
- JSP - 国际化
- JSP 有用资源
- JSP - 问答
- JSP - 快速指南
- JSP - 有用资源
- JSP - 讨论
JSTL - Core <fmt:setBundle> 标签
<fmt:setBundle> 标签用于加载资源包并将它存储在命名的作用域变量或包配置变量中。
属性
<fmt:setBundle> 标签具有以下属性:
| 属性 | 描述 | 必填 | 默认值 |
|---|---|---|---|
| basename | 要作为作用域变量或配置变量公开的资源包系列的基本名称 | 是 | 无 |
| var | 存储新包的变量名称 | 否 | 替换默认值 |
| scope | 存储新包的变量的作用域 | 否 | 页面 |
示例
<%@ 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>
以上代码将生成以下结果:
One Two Three
jsp_standard_tag_library.htm
广告