2

Just a clarification. Is ModelAndView object.addAttribute() equivalent to request.setAttribute. I went through a Spring MVC example the author added an attribute with ModelAndView object.addAttribute(), then in the jsp retrieved it with request.getAttribute().

I tried the same example, it worked for me. Any thoughts on this?

4

1 回答 1

3

ModelAndView#addObject(key,value)将属性放在request范围内。

于 2013-06-11T05:25:36.400 回答