Skip to content

Commit

Permalink
Document server.servlet.encoding.* configuration properties
Browse files Browse the repository at this point in the history
Closes gh-32472
  • Loading branch information
wilkinsona committed Oct 25, 2023
1 parent 666f68e commit ea39a33
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,27 @@ For example, adding the following bean will automatically apply a `SameSite` of
include::code:MySameSiteConfiguration[]


[[web.servlet.embedded-container.customizing.encoding]]
===== Character Encoding
The character encoding behavior of the embedded servlet container for request and response handling can be configured using the `server.servlet.encoding.*` configuration properties.

When a request's `Accept-Language` header indicates a locale for the request it will be automatically mapped to a charset by the servlet container.
Each containers providers default locale to charset mappings and you should verify that they meet your application's needs.
When they do not, use the configprop:server.servlet.encoding.mapping[] configuration property to customize the mappings, as shown in the following example:

[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
----
server:
servlet:
encoding:
mapping:
ko: "UTF-8"
----

In the preceding example, the `ko` (Korean) locale has been mapped to `UTF-8`.
This is equivalent to a `<locale-encoding-mapping-list>` entry in a `web.xml` file of a traditional war deployment.



[[web.servlet.embedded-container.customizing.programmatic]]
===== Programmatic Customization
Expand Down

0 comments on commit ea39a33

Please sign in to comment.