我是 Bootstrap 的新手。但我对 HTML 非常熟悉。问题是我无法从 JSP 获取参数值。参数来自带有 Bootstrap 3 的 HTML 页面。这是代码。我不明白。如果我只制作简单的 html 页面,那么我可以获得参数。
<form class="form-horizontal" method="POST" action="makeResv.jsp">
<div class="container">
<div class="row">
<div class="control-group col-md-5">
<label for="checkIn">date1</label>
<div id="date-container">
<div class="input-group date">
<input type="text" id="checkIn" class="form-control"><span
class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
</div>
</div>
</div>
<div class="control-group col-md-5">
<label for="checkOut">date2</label>
<div id="date-container">
<div class="input-group date">
<input type="text" id="checkOut" class="form-control"><span
class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
</div>
</div>
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-success">search</button>
</div>
</div>
</div>
</form>
在 JSP 页面中,我只是在执行以下操作。
String checkIn = request.getParameter("checkIn");
String checkOut = request.getParameter("checkOut");
out.println(checkIn + " " + checkOut);
上面的带有 Bootstrap 的 HTML 代码有什么问题?请给我一些建议。谢谢!!
顺便说一句,我正在使用 datepicker JavaScript 库,但我认为这不会影响结果。我无法在此处添加库代码,但无论如何它都很好用。 https://github.com/eternicode/bootstrap-datepicker