Tutorials Point


  Basic JSP Tutorials
  Advanced JSP Tutorials
  JSP Useful References
  JSP Useful Resources
  Selected Reading

© 2011 TutorialsPoint.COM


  Home     References     Discussion Forums     About TP  

JSTL Core <fmt:message> Tag


previous next AddThis Social Bookmark Button


The <fmt:message> tag maps key to localized message and performs parametric replacement.

Attribute:

The <fmt:message> tag has following attributes:

AttributeDescription RequiredDefault
keyMessage key to retrieveNoBody
bundleResource bundle to useNoDefault bundle
varName of the variable to store the localized messageNoPrint to page
scopeScope of the variable to store the localized messageNoPage

Example:

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<head>
<title>JSTL fmt:message Tag</title>
</head>
<body>

<fmt:setLocale value="en"/>
<fmt:setBundle basename="com.tutorialspoint.Example" var="lang"/>

<fmt:message key="count.one" bundle="${lang}"/><br/>
<fmt:message key="count.two" bundle="${lang}"/><br/>
<fmt:message key="count.three" bundle="${lang}"/><br/>

</body>
</html>

This would produce following result:

One 
Two 
Three


previous next Printer Friendly



  

Advertisement

Online Image Processing

Indian Baby Names