If you do not want to see any text in the url, such as http: // localhost: 8080/template_1/login. action? User = James
You can use URLDecoder. decode of encodeURI of js to encrypt the url.
(1) JS sets the data var val = encodeURI ("value to be uploaded to the server") on the page; // calls encodeURI twice
Href = "<% = basePath %> recordManager/test_js_decodeURI.action? Params = "+ val
(2) server side
Copy codeThe Code is 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 ("converted:" + deString );
The UTF-8 is consistent with the Code on the page, for example: pageEncoding = "UTF-8" on the jsp page here is the UTF-8
Right-click on ie to see if pageEncoding = "UTF-8" ie on jsp right-click encoding uncode (UTF-8) If pageEncoding = "GBK" on jsp ", then, right-click on ie (Simplified Chinese gb2312)