Name

<locale-encoding-mapping-list>

Synopsis

The <locale-encoding-mapping-list> element defines mappings between locales and response encodings. If you use more than one element of this type, the container merges them.

Syntax

<locale-encoding-mapping-list>
  <locale-encoding-mapping>
    <locale>locale</locale>
    <encoding>encoding</encoding>
  </locale-encoding-mapping>+
</locale-encoding-mapping-list>

Unless a specific response encoding is been specified explicitly, setting the locale for a response also sets its encoding. The <locale-encoding-mapping-list> element allows you to define how locales map to response encodings, overriding the container’s default mappings. The <locale> element contains the locale value as an ISO-639 language code, optionally combined with an ISO-3166 country code, separated by an underscore or a dash. The <encoding> element contains an encoding (charset) value recognized by Java:

<locale-encoding-mapping-list>
  <locale-encoding-mapping>
    <locale>en-US</locale>
    <encoding>UTF-8</encoding>
  </locale-encoding-mapping>
  <locale-encoding-mapping>
    <locale>ja</locale>
    <encoding>Shift_JIS</encoding>
  </locale-encoding-mapping>
</locale-encoding-mapping-list>

Get JavaServer Pages, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.