在网上查了了不少资料:总结一下
1、提交的URL(http:\\127.0.0.1\jbpm\search.do?name=名字) 中中文参数处理:
String name = request.getParameter("name");
String encoding = request.getCharacterEncoding();
String filename = new String(fname.getBytes("ISO8859-1"),encoding);
2、URL中含中文名(如图片文件)(http:\\127.0.0.1\jbpm\upload\中文.jpg)
在保证页面及Severlet都是utf-8编码的前提下:
修改tomcat配置(<tomcat>\conf\server.xml)如下:
<Connector
port="9080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" [color=red]URIEncoding= "utf-8"[/color]/>
[color=red]URIEncoding= "utf-8"[/color]为添加部分
1、提交的URL(http:\\127.0.0.1\jbpm\search.do?name=名字) 中中文参数处理:
String name = request.getParameter("name");
String encoding = request.getCharacterEncoding();
String filename = new String(fname.getBytes("ISO8859-1"),encoding);
2、URL中含中文名(如图片文件)(http:\\127.0.0.1\jbpm\upload\中文.jpg)
在保证页面及Severlet都是utf-8编码的前提下:
修改tomcat配置(<tomcat>\conf\server.xml)如下:
<Connector
port="9080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" [color=red]URIEncoding= "utf-8"[/color]/>
[color=red]URIEncoding= "utf-8"[/color]为添加部分