HashMap map = new HashMap();
map.put("bookingNo", "1234");
map.put("contactPerson", "Peter");
//map.put("age", "18");
GeneralBean generalBean = new GeneralBean();
try {
//System.out.println(PropertyUtils.getSimpleProperty(userBean, "user"));
BeanUtils.populate(generalBean, map);
} catch (IllegalAccessException ex) {
Logger.getLogger(NewBookingController.class.getName()).log(Level.SEVERE, null, ex);
} catch (InvocationTargetException ex) {
Logger.getLogger(NewBookingController.class.getName()).log(Level.SEVERE, null, ex);
}
//BeanUtils.setProperty(userBean, "user", "peter");
System.out.println(generalBean.getBookingNo());
//System.out.println(BeanUtils.getProperty(map, "user"));
//System.out.println(BeanUtils.getProperty(map, "password"));
}