jsp传值本地无乱码测试机出现乱码问题解决
程序员文章站
2023-11-12 15:21:22
jsp 代码如下: 复制代码 代码如下:
<a id="wd" name="wd" href="javascript:void(0);" onclick="wdquery()">文档</a>
<a id="xw" name="xw" href="javascript:void(0);" onclick="xwquery()">公司新闻</a>
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);
}
后台代码如下:
string keywords=info.getcellstr("i", 0, "keywords");
keywords=urldecoder.decode(keywords,"utf-8");
jsp 代码如下:
复制代码 代码如下:
<a id="wd" name="wd" href="javascript:void(0);" onclick="wdquery()">文档</a>
<a id="xw" name="xw" href="javascript:void(0);" onclick="xwquery()">公司新闻</a>
复制代码 代码如下:
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);
}
后台代码如下:
复制代码 代码如下:
string keywords=info.getcellstr("i", 0, "keywords");
keywords=urldecoder.decode(keywords,"utf-8");
上一篇: JSP 相关对象的使用介绍
下一篇: Java实现的Base64加密算法示例