dev@jsr311.java.net

Re: JSR311: Note on Httpheader.getLanguage() and variants

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 31 Jul 2008 17:43:28 -0400

On Jul 31, 2008, at 5:16 PM, Bill Burke wrote:

> No I was just reading the javadoc on it.
>
I just did a quick test:

bash$ bsh
BeanShell 2.0b4 - by Pat Niemeyer (pat_at_pat.net)
bsh % import java.util.Locale;
bsh % Locale l = new Locale("xyzzy", "foobar");
bsh % print(l.toString());
xyzzy_FOOBAR
bsh % print(l.getCountry());
FOOBAR
bsh % print(l.getLanguage());
xyzzy
bsh % print(l.getDisplayCountry());
FOOBAR
bsh % print(l.getDisplayLanguage());
xyzzy
bsh %

The javadoc does say that the constructor doesn't do any validation so
I think we'll be OK with Locale.

Marc.

> Marc Hadley wrote:
>> On Jul 31, 2008, at 4:56 PM, Bill Burke wrote:
>>> I saw in 0.9 that getLanguage() now returns a Locale. HTTP 1.1
>>> does not require ISO 639 and 3166 defined country codes and using
>>> Locale basically forces us into using these standards. Maybe go
>>> back to String? What if a new browser/client version decides to
>>> switch to 639-3?
>>>
>> IIRC, Locale lets you construct an instance with any language and
>> country code and doesn't perform a validity check. Did you run into
>> a specific problem ?
>> Marc.
>> ---
>> Marc Hadley <marc.hadley at sun.com>
>> CTO Office, Sun Microsystems.
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
>> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.