The |
class=docEmphStrong>Attribute | class=docEmphStrong>Required | class=docEmphStrong>Purpose |
---|---|---|
currencyCode | N | String ISO 4217 currency code. Applied |
currencySymbol | N | String Currency symbol. Applied only |
groupingUsed | N | Specifies whether the formatted output |
maxFractionDigits | N | The maximum number of digits in the |
maxIntegerDigits | N | The maximum number of digits in the |
minFractionDigits | N | The minimum number of digits in the |
minIntegerDigits | N | The minimum number of digits in the |
pattern | N | String Custom formatting pattern. |
scope | N | The scope of var. The default |
type | N | Specifies whether the value is to be |
value | N | The String or Number Numeric value to |
var | N | The name of the exported scoped |
The <fmt:message>
Tag
The <fmt:message> tag is used
to insert multilingual text into JSP pages. This tag
references strings stored in resource bundles. If the
<fmt:message> tag is inside a
<fmt:bundle> block, then
<fmt:message> will use
<fmt:bundle> to determine which resource bundle
to use. If the <fmt:message> tag is outside a
<fmt:bundle> block, then
resourceBundle must be scoped variable obtained from
a previous call to <fmt:setBundle>. It can also
use a configured localization context.
// Syntax 1: Without body content
<fmt:message key="messageKey"
[bundle="resourceBundle"]
[var="varName"]
[scope="{page|request|session|application}"]/>
// Syntax 2: With a body to specify message parameters
<fmt:message key="messageKey"
[bundle="resourceBundle"]
[var="varName"]
[scope="{page|request|session|application}"]>
<fmt:param> subtags
</fmt:message>
// Syntax 3: With a body to specify key and optional message
parameters
<fmt:message [bundle="resourceBundle"]
[var="varName"]
[scope="{page|request|session|application}"]>
key
optional <fmt:param> subtags
</fmt:message>
The <fmt:message> tag has the
following attributes:
class=docEmphStrong>Attribute | class=docEmphStrong>Required | class=docEmphStrong>Purpose |
---|---|---|
bundle | N | Specifies the resource bundle that is |
key | N | Specifies the lookup key that |
scope | N | Specifies the scope of the scoped |
var | N | Specifies a scoped variable that will |
The <fmt:param>
Tag
The <fmt:param> tag is used to
specify parameters that will fill in the
<fmt:message> string.
// Syntax 1: Value specified via attribute value
<fmt:param value="messageParameter"/>
// Syntax 2: Value specified via body content
<fmt:param>
body content
</fmt:param>
The <fmt:param> tag has one
attribute. Only 10 parameters may be specified.
class=docEmphStrong>Attribute | class=docEmphStrong>Required | class=docEmphStrong>Purpose |
---|---|---|
value | N | Specifies the value that is to be |
The <fmt:parseDate>
Tag
The <fmt:parseDate> tag is
used to transform a string into a Java date.
// Syntax 1: Without a body
<fmt:parseDate value="dateString"
[type="{time|date|both}"]
[dateStyle="{default|short|medium|long|full}"]
[timeStyle="{default|short|medium|long|full}"]
[pattern="customPattern"]
[timeZone="timeZone"]
[parseLocale="parseLocale"]
[var="varName"]
[scope="{page|request|session|application}"]/>
// Syntax 2: With a body to specify the date value to be parsed
<fmt:parseDate [type="{time|date|both}"]
[dateStyle="{default|short|medium|long|full}"]
[timeStyle="{default|short|medium|long|full}"]
[pattern="customPattern"]
[timeZone="timeZone"]
[parseLocale="parseLocale"]
[var="varName"]
[scope="{page|request|session|application}"]>
date value to be parsed
</fmt:parseDate>
The <fmt:parseDate> tag has
the following attributes:
class=docEmphStrong>Attribute | class=docEmphStrong>Required | class=docEmphStrong>Purpose |
---|---|---|
dateStyle | N | The style for the date. Should be |
parseLocale | N | Specifies the locale that should be |
pattern | N | Specifies how the date is to be parsed |
timeStyle | N | The style for the time. Should be |
timeZone | N | The zone that the parsed time is from. |
type | N | The type of date to parse. Should be |
value | N | The string to be parsed. |
var | N | The name of the exported scoped |
The
<fmt:parseNumber> Tag
The <fmt:parseNumber> tag is
used to parse strings into numeric values. If the value
specified cannot be transformed into a numeric value, then an
exception will be thrown.
// Syntax 1: Without a body
<fmt:parseNumber value="numericValue"
[type="{number|currency|percent}"]
[pattern="customPattern"]
[parseLocale="parseLocale"]
[integerOnly="{true|false}"]
[var="varName"]
[scope="{page|request|session|application}"]/>
// Syntax 2: With a body to specify the numeric value to be parsed
<fmt:parseNumber [type="{number|currency|percent}"]
[pattern="customPattern"]
[parseLocale="parseLocale"]
[integerOnly="{true|false}"]
[var="varName"]
[scope="{page|request|session|application}"]>
numeric value to be parsed
</fmt:parseNumber>
The <fmt:parseNumber> tag has
the following attributes:
class=docEmphStrong>Attribute | class=docEmphStrong>Required | class=docEmphStrong>Purpose |
---|---|---|
integerOnly | N | Specifies whether just the integer |
parseLocale | N | The locale whose default formatting |
pattern | N | Custom formatting pattern that |
scope | N | The scope of var. Defaults to |
type | N | Specifies whether the string in the |
value | N | The string to be parsed. |
var | N | The name of the exported scoped |
The
<fmt:requestEncoding> Tag
The <fmt:requestEncoding> tag
is used to specify the encoding method used in the form that
posted to the current page. This allows JSTL to properly
determine the parameters that were posted to the current
page.
<fmt:requestEncoding [value="charsetName"]/>
The <fmt:requestEncoding> tag
has one attribute:
class=docEmphStrong>Attribute | class=docEmphStrong>Required | class=docEmphStrong>Purpose |
---|---|---|
value | N | The name of the character encoding to |
The <fmt:setBundle>
Tag
The <fmt:setBundle> tag is
used to load a Java resource bundle into a JSTL scoped
variable. The scoped variable can then be provided to future
calls to the <fmt:message> tag.
<fmt:setBundle basename="basename"
[var="varName"]
[scope="{page|request|session|application}"]>
The <fmt:setBundle> tag
contains the following attributes:
class=docEmphStrong>Attribute | class=docEmphStrong>Required | class=docEmphStrong>Purpose |
---|---|---|
basename | Y | Specifies the base name of the resource |
scope | N | Specifies the scope of the variable |
var | N | Specifies a scoped variable that will |
The <fmt:setLocale>
Tag
The <fmt:setLocale> tag is
used to specify the current locale for the Web
application.
<fmt:setLocale value="locale"
[variant="variant"]
[scope="{page|request|session|application}"]/>
The <fmt:setLocale> tag has
the following attributes:
class=docEmphStrong>Attribute | class=docEmphStrong>Required | class=docEmphStrong>Purpose |
---|---|---|
value | Y | The locale species a two-part code that |
scope | N | Specifies the scope of this locale |
variant | N | Specifies a vendor- or browser-specific |
The
<fmt:setTimeZone> Tag
The <fmt:setTimeZone> tag is
used to specify the time zone for the Web application.
<fmt:setTimeZone value="timeZone"
[var="varName"]
[scope="{page|request|session|application}"]
The <fmt:setTimeZone> tag has
the following attributes:
class=docEmphStrong>Attribute | class=docEmphStrong>Required | class=docEmphStrong>Purpose |
---|---|---|
scope | N | Specifies the scope of scoped variable |
value | Y | Specifies the time zone that should be |
var | N | Specifies the scoped variable that is |
The <fmt:timeZone>
Tag
The <fmt:timeZone> tag is used
to specify a time zone that will be used by all tags inside
the body of the <fmt:timeZone> tag. The
<fmt:timeZone> tag has one attribute:
class=docEmphStrong>Attribute | class=docEmphStrong>Required | class=docEmphStrong>Purpose |
---|---|---|
value | Y | Specifies the time zone that should be |
Add Note Add Bookmark |
Top |
[0672324504/app01lev1sec2]
No comments:
Post a Comment