fmt:message tag
fmt:messageThe tag maps a key to a localized message and then performs parameter substitution.
Syntax format
property
fmt:messageThe tag has the following attributes:
| property | Description | Whether it is required | Default value |
|---|---|---|---|
| key | The message key to retrieve | No | Body |
| bundle | The resource bundle to use | No | The default resource bundle |
| var | The name of the variable that stores the localized message | No | Print to page |
| scope | The scope of the var attribute | No | Page |
Example Demonstration
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
JSTL fmt:message 标签
The running result is as follows:
One
Two
Three
JSP Standard Tag Library