错误: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is freemarker.core.NonStringOrTemplateOutputException: For "${...}" content: Expected a string or something automatically convertible to string (number, date or boolean), or "template output" , but this has evaluated to a sequence (ArrayList wrapped into f.t.DefaultListAdapter):
出错代码:
后台:mv.addAttribute("list",data);
前台:var list = "${list}";
解决方法:
1.mv.addAttribute("list",data.toString());