
- Basic JSP Tutorial
- JSP - Home
- JSP - Overview
- JSP - Environment Setup
- JSP - Architecture
- JSP - Lifecycle
- JSP - Syntax
- JSP - Directives
- JSP - Actions
- JSP - Implicit Objects
- JSP - Client Request
- JSP - Server Response
- JSP - Http Status Codes
- JSP - Form Processing
- JSP - Writing Filters
- JSP - Cookies Handling
- JSP - Session Tracking
- JSP - File Uploading
- JSP - Handling Date
- JSP - Page Redirect
- JSP - Hits Counter
- JSP - Auto Refresh
- JSP - Sending Email
- Advanced JSP Tutorials
- JSP - Standard Tag Library
- JSP - Database Access
- JSP - XML Data
- JSP - Java Beans
- JSP - Custom Tags
- JSP - Expression Language
- JSP - Exception Handling
- JSP - Debugging
- JSP - Security
- JSP - Internationalization
- JSP Useful Resources
- JSP - Questions and Answers
- JSP - Quick Guide
- JSP - Useful Resources
- JSP - Discussion
JSTL - Core <fmt:message> Tag
The <fmt:message> tag maps key to localized message and performs parametric replacement.
Attribute
The <fmt:message> tag has the following attributes −
Attribute | Description | Required | Default |
---|---|---|---|
key | Message key to retrieve | No | Body |
bundle | Resource bundle to use | No | Default bundle |
var | Name of the variable to store the localized message | No | Print to page |
scope | Scope of the variable to store the localized message | 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: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>
You will receive the following result −
One Two Three
jsp_standard_tag_library.htm
Advertisements