mvc可以使用ModelAndViev传递数据选择跳转的视图 controller中的代码, 把一个模拟的表单studentListSimulate传给ModelAndView @RequestMapping("/detial") public Model showStudentDetial(Model mod) { ModelAndView mav = new ModelAndView(); mav.addObject("studentListSimulate",
一.返回值Map 1.mapper.xml <select id="selectUserMapLimitOne" resultType="java.util.HashMap"> select id,name from user order by id desc limit 1 </select> 2.接口定义 /** * 获取仅含一个的map(map的size=字段个数) * @return */ Map<String,Object&g
mapperl.xml中: <select id="getAmount" parameterType="int" resultType="java.util.HashMap"> <![CDATA[ select count(*) as amount, estate_type as type, status from estate where status=#{status} group by estate_type ]]>
map结构的数据,js接收到的结构是elements下面的一个 [ {key:***,value:***}, {key:***,value:***} ] 这样子的集合,需要经过下面代码的转换才能重新变成map的结构 function seamobj2map(result) { var elem; var map = {}; for (var i in result.elements) { elem = result.elements[i]; map[elem.key] = elem.value;