<form:input path="expiryDate" size="15" />
You will notice that you cannot just do it as normal, but to let your SimpleFormController accept the binding, you have to override the following method:
@Override
protected void initBinder(PortletRequest request, PortletRequestDataBinder binder) throws Exception {
DateFormat df = new SimpleDateFormat("dd/MM/yyyy");
df.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(df, true));
super.initBinder(request,binder);
}
Tweet
Kindle

Comments