form表单通过hidden提交中文参数为空
jsp页面相关代码:脚本部分:functiononAddDrivingRange(type){varway_id=document.getElementById("way...
jsp页面相关代码:
脚本部分:function onAddDrivingRange(type){
var way_id=document.getElementById("wayId").value;
if(way_id==0){
alert("请先选择路线!");
return;
}
var v=window.showModalDialog("${pageContext.request.contextPath}/plan_add_drivingRange.action?way_id="+way_id+"&way_type="+type,"","DIALOGWIDTH:700px;DIALOGHEIGHT:520px");
//填充区间数据
var textareaValue="";
var range_ids="";
var range_names="";
for(var i=0;i<v[1].length;i++){
textareaValue+=v[1][i]+"\r\n";
range_ids+=v[0][i]+"_";
range_names+=v[1][i]+"_";
}
document.form1.driving_ids.value=range_ids;
document.form1.driving_names.value=range_names;
document.getElementById("rangeTextarea").innerHTML=textareaValue;
}
function onAddElectricRange(type){
var v=window.showModalDialog("${pageContext.request.contextPath}/plan_add_drivingRange.action?way_type="+type,"","DIALOGWIDTH:700px;DIALOGHEIGHT:520px");
document.getElementById("electricRange").innerHTML=v;
}
对应的action代码
public ActionForward selDrivingRang(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
System.out.println(request.getParameter"driving_names"));
return mapping.findForward("plan_add_drivingRange");
}
这里取出来的中文参数总是为空
我也写了过滤器,form采用post提交 展开
脚本部分:function onAddDrivingRange(type){
var way_id=document.getElementById("wayId").value;
if(way_id==0){
alert("请先选择路线!");
return;
}
var v=window.showModalDialog("${pageContext.request.contextPath}/plan_add_drivingRange.action?way_id="+way_id+"&way_type="+type,"","DIALOGWIDTH:700px;DIALOGHEIGHT:520px");
//填充区间数据
var textareaValue="";
var range_ids="";
var range_names="";
for(var i=0;i<v[1].length;i++){
textareaValue+=v[1][i]+"\r\n";
range_ids+=v[0][i]+"_";
range_names+=v[1][i]+"_";
}
document.form1.driving_ids.value=range_ids;
document.form1.driving_names.value=range_names;
document.getElementById("rangeTextarea").innerHTML=textareaValue;
}
function onAddElectricRange(type){
var v=window.showModalDialog("${pageContext.request.contextPath}/plan_add_drivingRange.action?way_type="+type,"","DIALOGWIDTH:700px;DIALOGHEIGHT:520px");
document.getElementById("electricRange").innerHTML=v;
}
对应的action代码
public ActionForward selDrivingRang(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
System.out.println(request.getParameter"driving_names"));
return mapping.findForward("plan_add_drivingRange");
}
这里取出来的中文参数总是为空
我也写了过滤器,form采用post提交 展开
若以下回答无法解决问题,邀请你更新回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询