编码问题
在开发中,我们解决编码问题的方案是:
a--修改服务器的编码为UTF-8
<Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />
b--设置request对象的编码为UTF-8
request.setCharacterEncoding("utf-8");
c--设置response对象的编码为UTF-8及输出类型
response.setContentType("text/html;charset=utf-8");