spring - modelMap.put() v/s modelMap.addAttribute() -


in spring, difference between

modelmap.put("key",value); 

and

modelmap.addattribute("key",value); 

addattributes implies check not null in attribute name -> see sources

 /**      * add supplied attribute under supplied name.      * @param attributename name of model attribute (never <code>null</code>)      * @param attributevalue model attribute value (can <code>null</code>)      */     public modelmap addattribute(string attributename, object attributevalue) {         assert.notnull(attributename, "model attribute name must not null");         put(attributename, attributevalue);         return this;     } 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -