Servlet Filter that allows one to specify a character encoding for requests.
This is useful because current browsers typically do not set a character
encoding even if specified in the HTML page or form.

This filter can either apply its encoding if the request does not already
specify an encoding, or enforce this filter's encoding in any case
("forceEncoding"="true"). In the latter case, the encoding will also be
applied as default response encoding (although this will usually be overridden
by a full content type set in the view).

Method Detail

setEncoding

Whether this encoding will override existing request encodings
(and whether it will be applied as default response encoding as well)
depends on the "forceEncoding" flag.

setForceEncoding

public void setForceEncoding(boolean forceEncoding)

Set whether the configured encoding of this filter
is supposed to override existing request and response encodings.

Default is "false", i.e. do not modify the encoding if
ServletRequest.getCharacterEncoding()
returns a non-null value. Switch this to "true" to enforce the specified
encoding in any case, applying it as default response encoding as well.