After tracing through BundleSupport and LocaleSupport classes of org/apache/taglibs/standard/tag/core/fmt, I discovered that the preferred locales as provided by the Accept-Language request header were being ignored. The problem is that the algorithm will check to see if the context init param, or scoped attribute javax.servlet.jsp.jstl.fmt.locale was set before interrogating the browser locales. This is correct based on the spec, however, the problem lies in LocaleSupport.parseLocale(String, String) - line 170. If a null value was returned, as it would be of javax.servlet.jsp.jstl.fmt.locale was not set, parseLocale(String, String) will return the default locale of the system where the container runs, and thus return a value when none should be returned (See line 221 of BundleSupport). Based on the spec (Section 8.3.2, page 8-73), I would think that consideration of the containers default locale would be illegal. I changed the null check in LocalSupport.parseLocale(String, String) to return null instead of the default locale (see diff below) and the algorithm began to work as expected. I haven't spent the time to see if the diff below has any side effects, but I believe this is enough information to correct the issue. ***************************************************************** Index: LocaleSupport.java =================================================================== RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/fmt/LocaleSupport.java,v retrieving revision 1.14 diff -u -r1.14 LocaleSupport.java --- LocaleSupport.java 23 Mar 2002 01:33:50 -0000 1.14 +++ LocaleSupport.java 25 Mar 2002 03:55:29 -0000 @@ -175,7 +175,8 @@ int index = -1; if ((locale == null) || locale.equals("")) { - return Locale.getDefault(); + //return Locale.getDefault(); + return null; } if (((index = locale.indexOf(HYPHEN)) > -1) *************************************************************
*** This bug has been marked as a duplicate of 7423 ***