I would to set the datepicker mindate with the tomorrow date (server side, not client side).
I tried this jquery datepicker set minDate and maxDate from jsp with an adding:
<%
try {
Date now = new Date();
Calendar cal = Calendar.getInstance();
cal.setTime(now);
cal.add(Calendar.DAY_OF_YEAR, 1);
Date tomorrow = cal.getTime();
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
} catch (Exception e) {
System.out.println(e.getStackTrace());
}
%>
<script type="text/javascript">
var date = '<%=sdf.format(tomorrow) %>';
but I obtain both sdf cannot be resolved and tomorrow cannot be resolved exceptions.
I imported both java.util.* and java.text.SimpleDateFormat in the jsp page:
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.*" %>
Can you use the jstl?