发表于: 2018-03-19 10:06:46
2 623
今天完成的事:
1. 学习如何捆绑错误信息。比如必填项,如果缺失出现错误提示在原页面。 核心:
@Valid @ModelAttribute("customer") Customer theCustomer, BindingResult theBindingResult) {
if(theBindingResult.hasErrors()) {
return "customer-form";
}
else {
return "customer-confirmation";
}
效果图
2.用@InitBinder 避免空格键的合理输入
明天计划:2个section
评论