url传中文参数转码
在tomcat的server.xml文件中加入

URIEncoding="UTF-8"


<Connector port="8080" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true"   URIEncoding="UTF-8"/>
lunzi   2007-10-17 19:29:35 评论:1   阅读:10301   引用:0
java中的转码 @2007-10-31 08:25:33  lunzi
public static String urlTool(String str,String encode){
String _s = null;
try {
_s = java.net.URLEncoder.encode(str,encode);
} catch (UnsupportedEncodingException e) {

e.printStackTrace();
}
         return _s;
}

发表评论>>

署名发表(评论可管理,不必输入下面的姓名)

姓名:

主题:

内容: 最少15个,最长1000个字符

验证码: (如不清楚,请刷新)

Copyright@2004-2010 powered by YuLog