Я создаю приложение весенней загрузки для бронирования авиабилетов. Я определил контроллер для получения информации о рейсе из базы данных: [code]@Controller @RequestMapping("/home") public class FlightController {
@Autowired private FlightService flightService;
@GetMapping("/search") public String getFlights( @RequestParam("origin") String origin, @RequestParam("destination") String destination, Model model, HttpSession session) {
List flightList = flightService.getFightsByOriginAndDestination(origin, destination);
if(flightList.isEmpty()) { model.addAttribute("message", "No flights available for the given origin and destination."); return "home"; } else { model.addAttribute("flightList", flightList); model.addAttribute("username", session.getAttribute("username")); return "home"; } } } [/code] Теперь я хочу отобразить детали в сетке кендо, выполнив вызов ajax. Я пробовал что-то подобное, но это не сработало: [code]$(document).ready(function () {
] }); }, error: function (xhr, status, error) { console.error("Failed to fetch flight data:", error); } }); }); [/code] Я знаю, что что-то не так, но не могу указать на проблему. Может кто-нибудь помочь?