标签:inf java put ref bsp mic info span 启动
SpringmvcTest.java
@RequestMapping("/springmvc") @Controller public class SpringmvcTest { private static final String SUCCESS = "success"; @RequestMapping(value="/testMap") public String testMap(Map<String,Object> map) { map.put("names", Arrays.asList("tom","jack","bob")); return SUCCESS; } }
Index.jsp
<a href="springmvc/testMap">testMap</a>
success.jsp
<p>Success</p> <p>names:${requestScope.names}</p>
启动服务器之后:
点击:
实际上传入的也可以是Model和ModelMap类型的参数。
标签:inf java put ref bsp mic info span 启动
原文地址:https://www.cnblogs.com/xiximayou/p/12178216.html