use*_*655 5 spring spring-mvc jakarta-ee
春天和春天有什么区别
modelMap.put("key",value);
Run Code Online (Sandbox Code Playgroud)
和
modelMap.addAttribute("Key",value);
Run Code Online (Sandbox Code Playgroud)
addAttributes 意味着检查属性名称中是否不为空 -> 请参阅来源
/**
* Add the supplied attribute under the supplied name.
* @param attributeName the name of the model attribute (never <code>null</code>)
* @param attributeValue the model attribute value (can be <code>null</code>)
*/
public ModelMap addAttribute(String attributeName, Object attributeValue) {
Assert.notNull(attributeName, "Model attribute name must not be null");
put(attributeName, attributeValue);
return this;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9405 次 |
| 最近记录: |