开发者

getModel() vs getModelMap() in ModelAndView

Which one has to be used when ?

When I see the source code of ModelAndView class, getModel() is simpling calling the getModelMap(), W开发者_如何学运维hy are there two different methods doing same activity ?


Backwards compatibility. Earlier versions of Spring only had getModel(), newer versions added the more explicit getModelMap(). Note that the return type is slightly different also, getModelMap() returns the more tightly typed ModelMap class, rather than a raw pre-java5 Map.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜