What is @ModelAttribute in Spring MVC?

后端 未结 13 1009
一个人的身影
一个人的身影 2020-11-22 08:43

What is the purpose and usage of @ModelAttribute in Spring MVC?

13条回答
  •  無奈伤痛
    2020-11-22 09:42

    @ModelAttribute will create a attribute with the name specified by you (@ModelAttribute("Testing") Test test) as Testing in the given example ,Test being the bean test being the reference to the bean and Testing will be available in model so that you can further use it on jsp pages for retrieval of values that you stored in you ModelAttribute.

提交回复
热议问题