Name
<fmt:param>
Synopsis
The
<fmt:param>
action is used as a nested action for
<fmt:message>
to supply a parameter value
for a parameterized message.
The parameter syntax that can be used in the parameterized message is
the syntax accepted by the java.text.MessageFormat
class, i.e., a 0-based order number optionally followed by a data
type name and a format specification, within curly braces:
{orderNumber [, dataType [, format ]]}
The data type must be one of time
,
date
, number
, or
choice
.
For a time
or date
type, the
format specification can be one of short
,
medium
, long
,
full
, or the type of customized pattern described
for <fmt:formatDate>
.
For a number
type, the format specification can be
currency
, percent
,
integer
, or the type of customized pattern
described for <fmt:formatNumber>
.
See the java.text.MessageFormat
documentation for
details about the choice
type.
Syntax 1: Without a body
<fmt:param value="parameterValue
" />
Syntax 2: With a body
<fmt:param>
parameterValue
</fmt:param>
Attributes
Attribute name |
Java type |
Dynamic value accepted |
Description |
value |
Object |
Yes |
The parameter value. |
Example
<fmt:message key="result"> <fmt:param value="${result.total}" /> <fmt:param value="${result.percentage}" /> </fmt:message>
Get JavaServer Pages, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.