You are here

fmt:message within fmt:message

You can use a fmt:message as a parameter to a fmt:message like the following:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<html:html locale="true">
<body>
<fmt:message key="main">
  <fmt:param>
    <fmt:message key="sub1"/>
  </fmt:param>
  <fmt:param>
    <fmt:message key="sub2"/>
  </fmt:param>
</fmt:message>
</body>
</html:html>

where the keys are:

main=Here is an {0} of how fmt:message {1}
sub1=example
sub2=works