spring form标签的modelAttribute 与 @ModelAttribute 联合的一个坑

在页面使用

而在controller 里面没有在model 设置 对应key-value,理论上应该是空指针错误或者没有属性绑定错误,

如果有@ModelAttribute 进行注解返回对应实体,则会调用以下类

org.springframework.web.method.annotation.ModelFactory

的invokeModelAttributeMethods  方法,对注解的返回值设置相应的类型,如果类型第二个字母是大小,则第一个字母不进行相应的大小写转换

猜你喜欢

转载自blog.csdn.net/xuezhezhishen/article/details/84632653