If you do not want to see a clear text in the URL, such as http://localhost:8080/template_1/login.action?user= John
You can use JS's encodeURI Urldecoder.decode to use together to encrypt the URL
(1) JS on the page to the data var val = encodeURI (encodeURI ("to upload to the server side is the value")); Call 2 times encodeURI
href= "<%=basepath%>recordmanager/test_js_decodeuri.action?params=" +val
(2) server-side such
Copy Code code as follows:
HttpServletRequest request = Servletactioncontext.getrequest ();
String vstring = Request.getparameter ("params");
System.out.println ("Before conversion:" +vstring);
String destring = Urldecoder.decode (vstring, "UTF-8");
System.out.println ("After conversion:" +destring);
UTF-8 is consistent with the code on the page. For example: pageencoding= "UTF-8" on the JSP page it's going to be UTF-8.
In IE right key code can see, if the JSP on pageencoding= "UTF-8" ie on the right key code Uncode (UTF-8), if the JSP pageencoding= "GBK", then IE on the right key code (Simplified Chinese gb2312)