Tomcat--怎样到处使用UTF-8编码
来源:互联网 发布:餐厅日报表的算法 编辑:程序博客网 时间:2024/06/04 18:49
原文地址:https://wiki.apache.org/tomcat/FAQ/CharacterEncoding#Q3
Using UTF-8 as your character encoding for everything is a safe bet. This should work for pretty much every situation.
In order to completely switch to using UTF-8, you need to make the following changes:
Set URIEncoding="UTF-8" on your <Connector> in server.xml. References: HTTP Connector, AJP Connector.
Use a character encoding filter with the default encoding set to UTF-8
- Change all your JSPs to include charset name in their contentType.
For example, use <%@page contentType="text/html; charset=UTF-8" %> for the usual JSP pages and<jsp:directive.page contentType="text/html; charset=UTF-8" /> for the pages in XML syntax (aka JSP Documents).
- Change all your servlets to set the content type for responses and to include charset name in the content type to be UTF-8.
Use response.setContentType("text/html; charset=UTF-8") or response.setCharacterEncoding("UTF-8").
- Change any content-generation libraries you use (Velocity, Freemarker, etc.) to use UTF-8 and to specify UTF-8 in the content type of the responses that they generate.
Disable any valves or filters that may read request parameters before your character encoding filter or jsp page has a chance to set the encoding to UTF-8. For more information see http://www.mail-archive.com/users@tomcat.apache.org/msg21117.html.
- Tomcat--怎样到处使用UTF-8编码
- tomcat采用UTF-8编码
- Tomcat UTF-8 编码设置
- 设置Tomcat编码(UTF-8)
- Tomcat 配置 UTF-8 编码
- tomcat设置UTF-8编码
- 配置Apache和Tomcat使用UTF-8编码
- 设置Tomcat的UTF-8编码
- tomcat 接受编码变utf-8
- 配置Tomcat支持UTF-8编码
- 设置tomcat中的编码为utf-8
- 修改Tomcat 编码为UTF-8
- 设置Tomcat的UTF-8编码
- 设置Tomcat的UTF-8编码
- 设置Tomcat的UTF-8编码
- 设置Tomcat的UTF-8编码
- 设置Tomcat的UTF-8编码
- 设置Tomcat的UTF-8编码
- 1111
- kmalloc用法
- 大学计算机专业那些课
- hadoop中槽-slot是线程还是进程讨论
- Storm基础接口
- Tomcat--怎样到处使用UTF-8编码
- 入口 OnReadMessage
- 菜鸟的安卓框架记一
- 作为java高级程序员应该掌握什么?
- [LeetCode]Plus One
- 由wsdl快速生成客户端java代码
- 在线APP网站链接项目管理
- 我的选择—参加广州传智播客.Net培训
- HttpURLConnection学习