Dowemo


 function searchWeather(){


 window.location.href = ctx+"/weather/getInfos?cityName="+encodeURI(encodeURI(cityName));


 }







String cityName = URLDecoder.decode(request.getParameter("cityName"), "UTF-8");






Url passing chinese
If the jsp page, CharacterEncodingFilter, org, springframework, web. Filter. Is the utf, myeclipse. myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse, myeclipse.......
Direct chinese is usually not, and if there's any code, you can try it in the following ways.
Currently collected in 4 methods, the chinese documentPath for example:
1. Commit to form mode and don't submit a hyperlink without a hyperlink.

2. Commit through encodeuri ( encodeuri ( checkText ) ), with URLDecoder. Decode in the java code:

A function download ( documentPath ) % var url =""+ documentPath; url = encodeuri ( encodeuri ( url ) ); window. Location. Href = url; %.

Java code for chinese:
String documentPath = ( string ) request. Getparameter ( 'documentPath ').
DocumentPath = URLDecoder. Decode ( documentPath, utf-8 ).

3. Modify urlencoding in server. Xml for tomcat, add => utf-8".

4. Chinese from java to jsps and upload to java via urls:
Java encoding: URLEncoder. Encode ( URLEncoder. Encode ("passed chinese","utf-8") ).
Java decoding code: URLDecoder. ( request. Getparameter ( 'documentPath '),"utf-8").




Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs