Tomcat Configuration Gotchas

Common Tomcat configuration issues, starting with fixing request encoding by setting URIEncoding.

Sep 20, 2017 · 1 min read · 29 Words · -Views -Comments · Programming
Java 🇨🇳 阅读中文版
Read with AI

Choose an AI assistant

ChatGPT Open in a new tab with the article link and prompt
Claude Copy the prompt, then open Claude

Open Claude
Trouble reading the article?

If the prompt is missing, copy the full prompt below into your AI assistant. If the AI cannot read the article, paste the visible passage you want to discuss and add your question.

Tomcat illustration

Request Garbling (Encoding)

Add URIEncoding="UTF-8" in conf/server.xml:

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000"
           redirectPort="8443" URIEncoding="UTF-8" />

By default Tomcat uses ISO-8859-1 for request/response encoding. See the official docs for more details.

Authors
Developer, digital product enthusiast, tinkerer, sharer, open source lover