- Timestamp:
- 02/05/23 19:55:10 (21 months ago)
- Branches:
- master
- Children:
- 2b0a4db
- Parents:
- cc52b09
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/edu/gjoko/schedlr/controllers/HomePageController.java
rcc52b09 ra436340 1 1 package edu.gjoko.schedlr.controllers; 2 2 3 import edu.gjoko.schedlr.entity.Search;4 3 import org.springframework.stereotype.Controller; 5 4 import org.springframework.ui.Model; 6 5 import org.springframework.web.bind.annotation.GetMapping; 7 import org.springframework.web.bind.annotation.ModelAttribute;8 6 import org.springframework.web.bind.annotation.PostMapping; 7 8 import java.security.Principal; 9 9 10 10 @Controller … … 12 12 13 13 @GetMapping(name = "/homepage") 14 public String getHomePageTemplate(Model model, @ModelAttribute("search")Search search) {15 model.addAttribute("search", search);14 public String getHomePageTemplate(Model model, Principal principal) { 15 System.out.println(principal); 16 16 return "homepage"; 17 17 } 18 18 19 19 @PostMapping(name = "/homepage") 20 public String postHomePageTemplate(Model model, @ModelAttribute("search")Search search) { 21 model.addAttribute("search", search); 20 public String postHomePageTemplate(Model model) { 22 21 return "homepage"; 23 22 }
Note:
See TracChangeset
for help on using the changeset viewer.