Hy guys i want insert a LinkedHashMap into MyObject, with custom date format, and i have use BeanUtils with method populate:
public Object populate(Object obj, LinkedHashMap<String,Object> hash)
throws IllegalAccessException, InvocationTargetException {
Date dateempty=null;
DateTimeConverter dtConverter = new DateConverter(dateempty);
dtConverter.setPattern("dd/mm/yyyy");
ConvertUtils.register(dtConverter, java.util.Date.class);
BeanUtilsBean.getInstance().populate(obj, hash);
return obj;
}
if i call this method with value of hash:
hash.put("date","10/12/2013"); //this work
if hash is:
hash.put("date",""); //now this work