Because the JS URL in the process of passing value is JS own default character set code rules, we must turn it into our own code specifications
-------------using Url=encodeuri (encodeURI (URL)) in WebSphere; 2 times encodeURI Test succeeded, the first conversion did not attempt,
Processing method One.
JS Program code: Url=encodeuri (URL); Note that the entire URL
Server-side code: String linename = new String (Request.getparameter ("name"). GetBytes ("Iso-8859-1"), "UTF-8");
Treatment method Two.
Js:var url= "Name=" +name;
Url=encodeuri (encodeURI (URL)); 2 times encodeURI.
window.location = "<%=path%>/inner/line/line.jsp?" +url;
Server-side code:
String linename = request.getparameter (name);
Java: Character decoding
Linename = Java.net.URLDecoder.decode (Linename, "UTF-8"); This article links http://www.cxybl.com/html/wyzz/JavaScript_Ajax/20120721/32078.html
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.