Skip to content

Commit ea39a33

Browse files
committed
Document server.servlet.encoding.* configuration properties
Closes gh-32472
1 parent 666f68e commit ea39a33

File tree

1 file changed

+21
-0
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/web

1 file changed

+21
-0
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/web/servlet.adoc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,27 @@ For example, adding the following bean will automatically apply a `SameSite` of
611611
include::code:MySameSiteConfiguration[]
612612

613613

614+
[[web.servlet.embedded-container.customizing.encoding]]
615+
===== Character Encoding
616+
The character encoding behavior of the embedded servlet container for request and response handling can be configured using the `server.servlet.encoding.*` configuration properties.
617+
618+
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.
619+
Each containers providers default locale to charset mappings and you should verify that they meet your application's needs.
620+
When they do not, use the configprop:server.servlet.encoding.mapping[] configuration property to customize the mappings, as shown in the following example:
621+
622+
[source,yaml,indent=0,subs="verbatim",configprops,configblocks]
623+
----
624+
server:
625+
servlet:
626+
encoding:
627+
mapping:
628+
ko: "UTF-8"
629+
----
630+
631+
In the preceding example, the `ko` (Korean) locale has been mapped to `UTF-8`.
632+
This is equivalent to a `<locale-encoding-mapping-list>` entry in a `web.xml` file of a traditional war deployment.
633+
634+
614635

615636
[[web.servlet.embedded-container.customizing.programmatic]]
616637
===== Programmatic Customization

0 commit comments

Comments
 (0)