jsp:
encodeURI() 函数可把字符串作为 URI 进行编码。
var goodname=$("#select").val();
window.location.href="goodAction_select.action?good.goodname="+encodeURI(encodeURI(goodname));
alert(goodname);
action:
UrlDecode是对字符串进行URL解码的编码处理函数。 通过urlencode编码后的字符串,可通过UrlDecode进行解码
String str = URLDecoder.decode(this.good.getGoodname(), "UTF-8");
goodslist=goodsService.getGoodsByName(str);