每个页面头加入:
<%@page pageEncoding=" UTF-8 " contentType="text/html; charset= UTF-8 " %>
或者在tomcat的server.xml中加入:
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"
URIEncoding='UTF-8'
/>
注意红色部分要一致!
apache 中有个charset文件
修改:AddDefaultCharset off
本文介绍如何在每个页面头部设置UTF-8编码,并展示了在Tomcat的server.xml文件及Apache中进行相应配置的方法。
346

被折叠的 条评论
为什么被折叠?



