java urlencode

如果在访问某个URL时其中含有中文的话,需要encode成16进制.

在java中有专门的类来处理这个,分别是:URLEncoder和URLDecoder类

注意:只能对url中的字段进行encode,不能对所有url进行encode.

refurl:http://www.java3z.com/cwbwebhome/article/article2/2414.html?id=1101

 http://stackoverflow.com/questions/10786042/java-url-encoding-of-query-string-parameters

猜你喜欢

转载自wandejun1012.iteye.com/blog/2231339