tags:

views:

93

answers:

1

Which one has to be used when ?

When I see the source code of ModelAndView class, getModel() is simpling calling the getModelMap(), Why are there two different methods doing same activity ?

+3  A: 

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.

skaffman