spring mvc,ext,json 我都是最近刚刚接触。
我在网上找到一个spring-json的例子,public class SimpleJsonGetController implements Controller {        public ModelAndView handleRequest(HttpServletRequest request,
                        HttpServletResponse response) throws ServletException, IOException {                Map model = new HashMap();
                model.put("firstname", "Peter");
                model.put("secondname", "Schmitt");                return new ModelAndView("jsonView", model);
        }
}
返回json如下:
{"firstname":"Peter","secondname":"Schmitt"}spring mvc Controller 的ModelAndView只能返回map参数,可是ext那个控件只能接收json数组,例如:[{"firstname":"Peter","secondname":"Schmitt"},{"firstname":"Peter","secondname":"Schmitt"}]怎么才能让jsonView输出像上面这个json数组呢?谢谢