hi pgrimard, this is my controller class
Code:
package eu.hotel.example.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import eu.hotel.example.dao.HotelDAO;
import eu.hotel.example.dao.ReservationDAO;
import eu.hotel.example.model.Reservation;
@Controller
public class HotelController {
@Autowired
private HotelDAO hoteldao;
@Autowired
private ReservationDAO reservationdao;
@RequestMapping("/")
public String getHotels(Model model) {
model.addAttribute("Hotel", hoteldao.findAll());
Reservation reservation = new Reservation();
//model.addAttribute("tblreservations", reservation);
return "home";
}
}
In mij HotelDAO I have my findall
Code:
package eu.hotel.example.dao;
import java.util.List;
import eu.hotel.example.model.Hotel;
public interface HotelDAO {
List<Hotel> findAll();
}