1. 程式人生 > >通過URL傳引數到後臺出現亂碼問題

通過URL傳引數到後臺出現亂碼問題

url="grid/dogetGrid.action?entrance="+encodeURI((encodeURI(entrancevalname)));

在前臺用encodeURI((encodeURI(引數)))將要傳的值進行轉碼

在後臺:

String     string=java.net.URLDecoder.decode(引數名"UTF-8");

進行反轉碼