SpringMVC注释使用entity实体传输

//Emp为实体
@RequestMapping(value="/*.do" ,method=RequestMethod.GET)
public void controller(Emp testEmp,HttpServletRequest request,HttpServletResponse response) throws Exception{
}
//数据类型绑定
@InitBinder
public void initBinder(WebRequestDataBinder binder){
  binder.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"),false));
}

你可能感兴趣的:(springMVC)