<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">In this tutorial you will learn about the JSTL <b><i><;fmt:bundle>;</i></b> tag.</p>
<p> <i><b><;fmt:bundle>;</b></i> tag is used to avail the resource for using the formats. A resource bundle is loaded by this tag which will be used by its tag body.</p>
<p> <b>Attributes of<i> <;fmt:bundle>;</i></b></p>
<ul style="text-align: left;">
<li><b>basename : </b>This is a required attribute used for specifying the resource bundle base name. <b><i>Basename</i></b> is a resource name, follows the same component separator dot (.) as the package uses for specifying the fully qualified class name. It does not uses the any type of suffixes such as .properties, .class etc.</li>
<li><b>prefix :</b> This is an optional attribute that may be used for adding to the beginning to the value of the key of <i><b><;fmt:message>; </b></i>action. for example <b><i><;fmt:message key=&#8221;user.name&#8221;/>;</i></b>. Here user is a prefix.</li>
</ul>
<p><b>Example :</b><br />
An example is being given here will demonstrate you how to use the <i><b><;fmt:bundle>;</b></i> tag. In this example I have created a Properties file named <i><b>myapp.properties</b></i> that contains the key-value pair. Value of key are the English characters. Then created a JSP page named <b><i>index.jsp</i></b> into which I have set the locale using the <b><i><;fmt:setLocale>;</i></b> tag. And then uses the <i><b><;fmt:bundle>;</b></i> tag to load the bundle resource from the resource variable. So as an output you will see the values written in English language. </p>
<pre class="highlight" name="code"><;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>;
<;%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>;
<;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">;
<;html>;
<;head>;
<;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">;
<;title>;JSTL fmt:bundle Tag<;/title>;
<;/head>;
<;body>;
<;fmt:setLocale value="en"/>;
<;fmt:bundle basename="myapp">;
<;fmt:message key="Name"/>;<;br/>;
<;fmt:message key="Address"/>;<;br/>;
<;fmt:message key="Number"/>;<;br/>;
<;/fmt:bundle>;
<;/body>;
<;/html>;
</pre>
<p>
<b>myapp.properties</b></p>
<pre class="highlight" name="code">Name=Dinesh
Address=Noida
Number=9988998899
</pre>
<p>
<b>Output :</b></p>
<p> When the execution process will be completed successfully an output will be displayed on your eclipse browser as :</p>
<div class="separator" style="clear: both; text-align: center;"><img border="0" src="http://50.87.249.200/~dineshon/wp-content/uploads/2013/10/333-6.png" /></div>
<p>
</div>
<div style="background-color: pink; border-width: thin; text-align: center;"><b><;<;<a href="https://dineshonjava.com/2013/10/jstl-parsedate-formatdate-example.html">Previous</a> <;<; ; ; || <a href="https://dineshonjava.com/2013/10/jsp-standard-tag-library-jstl-tutorial.html">Index </a>||  ; >;>;<a href="https://dineshonjava.com/2013/10/jstl-set-locale-example.html">Next</a> >;>;</b></div>
</div>
<div class="wp-post-navigation"> 
									 <div class="wp-post-navigation-pre"> 
									 <a href="https://dineshonjava.com/jstl-parsedate-formatdate-example/">Previous</a> 
									 </div> 
									 <div class="wp-post-navigation-next"> 
									 <a href="https://dineshonjava.com/jstl-set-locale-example/">Next</a> 
									 </div> 
									</div>
<script type="text/javascript">
jQuery(document).ready(function($) {
 $.post('https://dineshonjava.com/wp-admin/admin-ajax.php', {action: 'mts_view_count', id: '304'});
});
</script>
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…