javaweb中页面间的传值问题。求助! 10
如题,我想传“2018-11-14”的字符串,但是在request接收还是传给后台的时候不知为何就变成了1993!。。。肯定是直接运算减法了!,想知道如何修改,下面贴代码...
如题,我想传“2018-11-14”的字符串,但是在request接收还是传给后台的时候不知为何就变成了1993!。。。肯定是直接运算减法了!,想知道如何修改,下面贴代码。
报错:
GET http://localhost:8080/select1?pn=1&date1=1993 500 ()
模态框:
<div class="modal fade" id="hotelSelect1Modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">请输入查询日期</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-6 control-label">日期格式:xxxx-xx-xx</label>
</div>
<div class="form-group">
<input class="col-sm-4 col-sm-offset-2" type="text" value="2018-11-14" name="date1" id="date1">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" id="select1_btn" class="btn btn-default" data-dismiss="modal"
onclick="select1()">查询</button>
</div>
</div>
</div>
</div>
模态框的按钮onclick方法为select1()
window.location.href ="../views/selectavg.jsp?date1="+document.getElementById("date1").value;
selectavg.jsp:
function to_page(pn) {
$.ajax({
url: "${APP_PATH}/select1",
data: {
pn: pn,
date1: <%=request.getParameter("date1")%>
},
......
由报错信息看出就是上面的request.getParameter("date1")得到了1993,我想得到原来的2018-11-14请问该怎么改? 展开
报错:
GET http://localhost:8080/select1?pn=1&date1=1993 500 ()
模态框:
<div class="modal fade" id="hotelSelect1Modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span>
</button>
<h4 class="modal-title" id="myModalLabel">请输入查询日期</h4>
</div>
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-6 control-label">日期格式:xxxx-xx-xx</label>
</div>
<div class="form-group">
<input class="col-sm-4 col-sm-offset-2" type="text" value="2018-11-14" name="date1" id="date1">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" id="select1_btn" class="btn btn-default" data-dismiss="modal"
onclick="select1()">查询</button>
</div>
</div>
</div>
</div>
模态框的按钮onclick方法为select1()
window.location.href ="../views/selectavg.jsp?date1="+document.getElementById("date1").value;
selectavg.jsp:
function to_page(pn) {
$.ajax({
url: "${APP_PATH}/select1",
data: {
pn: pn,
date1: <%=request.getParameter("date1")%>
},
......
由报错信息看出就是上面的request.getParameter("date1")得到了1993,我想得到原来的2018-11-14请问该怎么改? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询