一:
二:代碼實現
1.
private final String SUCCESS="success";
/*
* 目標方法可以是Map類型(也可以是Model類型或者ModelMap類型)
*/
@RequestMapping("/testMap")
public String testMap(Map<String, Object> map) {
map.put("name", "dhx");
return SUCCESS;
}
2.測試頁面及結果頁面
<a href="spring/testMap">test testMap</a>
<br>
<h3>success</h3>
times: ${requestScope.time }
name: ${requestScope.name}