我想將時間戳變量從jsp傳遞給servlet,但是在jsp文件本身中,當我將它放入輸入標記的值內部時。是visbible,請附上圖片和代碼更好的理解。任何幫助,將不勝感激。無法將時間戳變量從jsp傳遞給servlet
<%
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S");
Date parsedDate = df.parse((request.getParameter("dateOut")));
java.sql.Timestamp timestamp = new Timestamp(parsedDate.getTime());
AdminService adminservice = new AdminService();
out.println(timestamp);
//BookLoans booksl =adminservice.getallBookloansDateout(t);
%>
<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">DUE DATE</h4>
</div>
<form action="overrideDuedate" method="post">
<div class="modal-body">
ENTER NUMBER OF DAYS YOU WANT TO EXTEND BOOK BY
<input type="text" name="extendDays">
<input type="text" name="dateOut" value=<%=timestamp%>>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">OVERRIDE DATE</button>
</div>
</form>
做些什麼呢? – 11thdimension
我想要這種格式。 @ 11thdimension – codeLearner