- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use multiple resource bundle in same JSP?
The <fmt:setBundle> tag is used to load a resource bundle and stores it in the named scoped variable or the bundle configuration variable.
Attribute
The <fmt:setBundle> tag has the following attributes −
Attribute | Description | Required | Default |
---|---|---|---|
basename | Base name of the resource bundle family to expose as a scoped or a configuration variable | Yes | None |
var | Name of the variable to store the new bundle | No | Replace default |
scope | Scope of the variable to store the new bundle | No | Page |
Example
<%@ 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>
The above code will generate the following result −
One Two Three
- Related Articles
- How to use resource bundle in JSP?
- How to set locate to identify required resource bundle in JSP?
- How we can bundle multiple python modules?
- How to use the same JavaScript in multiple content pages?
- How to use action in JSP?
- How to use action in JSP?
- How to use action in JSP?
- How to use Action in JSP?
- How to use Action in JSP?
- How to use a filter in JSP?
- How to use multiple versions of jQuery on the same page?
- How to use time zone in a JSP?
- How do you define multiple filters in JSP?
- How to use parameterized SQL query in a JSP?
- How to use multiple attribute in HTML?

Advertisements