Bug 7646 - One <fmt:param> tag must be supplied ...
Summary: One <fmt:param> tag must be supplied ...
Status: RESOLVED FIXED
Alias: None
Product: Taglibs
Classification: Unclassified
Component: Standard Taglib (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-31 20:38 UTC by David Geary
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Geary 2002-03-31 20:38:04 UTC
I have this code:

<fmt:message key='message.diskFull'>
   <fmt:param value='${5}'/>
</fmt:message>

For this properties file:

message.diskFull=Disk number <b>{0}</b> filled up at <b>{1, time}</b> on <b>
{1, date}</b>.

I get output like this:

Disk number 5 filled up at {1} on {1}.

But, the spec states:

One <fmt:param> action must be specified for each variable in the compound 
message or message pattern.

Because of that wording in the spec, I expected an error.

Ok, now go ahead and tell me why this one's not a bug. ;-)
Comment 1 Jan Luehe 2002-04-02 01:15:22 UTC
I agree this statement in section 8.8 (<fmt:param>):

  One <fmt:param> action must be specified for each variable in the compound 
  message or message pattern.

is misleading and should be removed.

Maybe we can reword the 2nd paragraph as follows:

  Parametric replacement takes place in the order of the <fmt:param>
  tags.  The compound message given by the parent <fmt:message> action
  is used as the argument to the applyPattern() method of a
  java.text.MessageFormat instance, and the values of the <fmt:param> tags
  are collected in an Object[] and supplied to that instance's format()
  method.