首页 > 编程 > JSP > 正文

jsp传值本地无乱码测试机出现乱码问题解决

2024-09-05 00:17:41
字体:
来源:转载
供稿:网友

jsp 代码如下

复制代码 代码如下:www.CuoXIn.com

<a id="wd" name="wd" href="javascript:void(0);" onclick="wdQuery()">文档</a>
<a id="xw" name="xw" href="javascript:void(0);" onclick="xwQuery()">公司新闻</a>

复制代码 代码如下:www.CuoXIn.com

function wdQuery(){
var keywords= document.getElementById("i-0-keywords").value;
var loginName= document.getElementById("i-0-loginName").value;
//alert("keywords2=="+keywords+"-loginName=="+loginName);
keywords=encodeURI(keywords);
keywords=encodeURI(keywords);
loginName=encodeURI(keywords);
loginName=encodeURI(keywords);
// alert("keywords2=="+keywords+"-loginName=="+loginName);
$("#wd").attr("href","${ctx}/DispatchAction.do?serviceName=SearchWeb&efFormEname=FS01&methodName=query&i-0-moduleId=bmoa_bmdc&i-0-keywords="+keywords+"&i-0-loginName="+loginName);
}
function xwQuery(){
var keywords= document.getElementById("i-0-keywords").value;
var loginName= document.getElementById("i-0-loginName").value;
// alert("keywords2=="+keywords+"-loginName=="+loginName);
keywords=encodeURI(keywords);
keywords=encodeURI(keywords);
loginName=encodeURI(keywords);
loginName=encodeURI(keywords);
// alert("keywords2=="+keywords+"-loginName=="+loginName);
$("#xw").attr("href","${ctx}/DispatchAction.do?serviceName=SearchWeb&efFormEname=FS01&methodName=query&i-0-moduleId=bmoa_bair&i-0-keywords="+keywords+"&i-0-loginName="+loginName);
}

后台代码如下
复制代码 代码如下:www.CuoXIn.com

String keywords=info.getCellStr("i", 0, "keywords");
keywords=URLDecoder.decode(keywords,"UTF-8");

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表