Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Update section on POST encoding filter, remove reference to Tomcat 5.5 example webapp

...

POST requests should specify the encoding of the parameters and values they send. Since many clients fail to set an explicit encoding, the default is used (ISO-8859-1). In many cases this is not the preferred interpretation so one can employ a javax.servlet.Filter to set request encodings. Writing such a filter is trivial. Furthermore
6.x, 7.x::
Tomcat already comes with such an example filter. Please take a look at:
5.x::

No Format

webapps/servlets-examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.java
webapps/jsp-examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.java

6.x, 7.x::

No Format
webapps/examples/WEB-INF/classes/filters/SetCharacterEncodingFilter.java

5.5.36+, 6.0.36+, 7.0.20+, 8.x::
Since 7.0.20 the filter became first-class citizen and was moved from the examples into core Tomcat and is available to any web application without the need to compile and bundle it separately. See documentation for the list of filters provided by Tomcat. The class name is:

...