Bug 6563

Summary: JstlFmtTLV rejects valid <fmt:locale> action element
Product: Taglibs Reporter: Hans Bergsten <hans>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Hans Bergsten 2002-02-19 23:14:47 UTC
The JstlFmtTLV validator rejects a valid <fmt:locale> element because it has a
scope attribute but no var attribute. This is valid syntax, and in fact, the
<fmt:locale> action doesn't support a var attribute because the name is hardcoded.

Something like this in the startElement() method fixes the problem:

  String localeTag = prefix + ":" + "locale";
  if (qn.startsWith(prefix + ":") && !localeTag.equals(qn) &&
    hasDanglingScope(a))
    fail(Resources.getMessage("TLV_DANGLING_SCOPE", qn));
Comment 1 Shawn Bayern 2002-02-19 23:18:53 UTC
Thanks for the report, Hans.

Fixed using an approach similar to the one you suggested.
Comment 2 peter_e 2002-08-01 08:59:43 UTC
The equivalent bug still exists in the JSTL fmt:setLocale element in 
the "standard taglibs" releases 1.0 and 1.0.1.