Home » JSTL fmt:bundle Tag

JSTL fmt:bundle Tag

by Online Tutorials Library

JSTL Formatting <fmt:bundle> Tag

The &ltfmt:bundle> tag loads the resource bundle which is used by its tag body. This tag will make the specified bundle available for all <fmt:message> tags that occurs between the boundary of <fmt:bundle> and </fmt:bundle> tags.

It is used to create the ResourceBundle objects which will be used by their tag body.

The syntax used for including the <fmt:bundle> tag is:

Let’s see the simple example to understand the formatting <fmt:bundle> tag:

Let us define the default resource bundle Simple.java as follows:

Now, compile the above class as Simple.class and make it available in CLASSPATH of your Web application folder.

Now you can use the below JSTL tags to display the three colors as follows:

Output:

JSTL Formatting Tags5

You may also like