SpringMVC 使用Map类型作为目标方法的返回值
1、publicStringtestMap(Map<String,Object>map){map.put("names",Arrays.asList("Tom","All...
1、public String testMap(Map<String ,Object> map){
map.put("names", Arrays.asList("Tom","Allen","Hello"));
return SUCCESS;
}
2、public String testMap(){
Map<String ,Object> map = new TreeMap<String ,Object>();
map.put("names", Arrays.asList("Tom","Allen","Hello"));
return SUCCESS;
}
这两种方法有什么区别?可以详细告知吗? 展开
map.put("names", Arrays.asList("Tom","Allen","Hello"));
return SUCCESS;
}
2、public String testMap(){
Map<String ,Object> map = new TreeMap<String ,Object>();
map.put("names", Arrays.asList("Tom","Allen","Hello"));
return SUCCESS;
}
这两种方法有什么区别?可以详细告知吗? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询