Class MainController

java.lang.Object
de.gustavblass.fsu.fmi.roombooking.controller.MainController

@Controller public class MainController extends Object
Defines the behaviour of the web server for the path /.
  • Field Details

    • roomController

      @NonNull private final @NonNull RoomController roomController
      Used to pass the equipment types to the Model.
  • Constructor Details

  • Method Details

    • getIndex

      @GetMapping({"/","/en"}) @NonNull public @NonNull String getIndex(@NonNull @ModelAttribute("bookRoomDTO") @NonNull BookRoomDTO reservationDTO, @NonNull @NonNull org.springframework.ui.Model model) throws IllegalStateException
      Handles GET requests to the root path and returns the home page, including a find-rooms form.
      Parameters:
      reservationDTO - Used for form binding.
      model - Used to pass those equipment types to the form that exist in the database.
      Returns:
      The MainController.Template.INDEX page.
      Throws:
      IllegalStateException - If the equipment could not be added for unknown reason.