- @ResponseBody //此注解直接像页面写值
- @RequestMapping("testAjaxJson") //因为添加了jackson.jar 返回为List,实际为到达页面后为json
- public List<Student>
testAjaxJson(){
- System.out.println("------------join---testAjaxJson-------------");
- Student stu1 =
new
Student(1,
"zs",
new
Date(), null);
- Student stu2 =
new
Student(1,
"ls",
new
Date(), null);
- Student stu3 =
new
Student(1,
"ww",
new
Date(), null);
- List<Student> list =
new ArrayList<>();
- list.add(stu1);
- list.add(stu2);
- list.add(stu3);
- return list;
- }
|