Нужно было использовать ModelAndView
@GetMapping("/fill-blank")
public ModelAndView getRequest(@RequestParam(name = "course", required = false, defaultValue = "1") String idCourse, ModelMap model) {
List<Course> courses = courseDao.getCourses();
List<CourseDto> courseDtoList = new ArrayList<>();
for (Course course : courses) {
if (course.getId() == Integer.parseInt(idCourse))
courseDtoList.add(convertToDto(course));
}
for (Course course : courses) {
if (course.getId() != Integer.parseInt(idCourse))
courseDtoList.add(convertToDto(course));
}
model.addAttribute("courseCard", courseDtoList);
return new ModelAndView("/request_course", model);
}
<code>