如题,在springboot项目中如何让模态框动态获取列表信息。
首先@Controller中
@GetMapping("/")
public String index(HttpServletRequest request, Model model) throws Exception {
List AllStudent = studentServices.getallStudent();
List PassStudent = studentServices.getallPassStudent();
model.addAttribute(“AllStudent”, AllStudent);
model.addAttribute(“PassStudent”, PassStudent);
System.out.println(user);
model.addAttribute(“User”, user);
model.addAttribute(“StudentAccount”, studentServices.getStudentAccount());
model.addAttribute(“DiplomaAccount”, PassStudent.size());
String login = “Login in”;
if (IsLogin())
login = “Sign out”;
model.addAttribute(“Login”, login);
return “student/index”;
}
HTML中: