Changeset a436340 for src/main/java/edu/gjoko/schedlr/controllers
- Timestamp:
- 02/05/23 19:55:10 (22 months ago)
- Branches:
- master
- Children:
- 2b0a4db
- Parents:
- cc52b09
- Location:
- src/main/java/edu/gjoko/schedlr/controllers
- Files:
-
- 1 added
- 1 deleted
- 3 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 } -
src/main/java/edu/gjoko/schedlr/controllers/LoginController.java
rcc52b09 ra436340 12 12 13 13 @GetMapping(path = "/login") 14 public String getMapping(Model model) { 15 model.addAttribute("stakeholder", new Stakeholder()); 14 public String getMapping(@ModelAttribute Stakeholder customer, Model model) { 16 15 return "login"; 17 16 } -
src/main/java/edu/gjoko/schedlr/controllers/RegisterController.java
rcc52b09 ra436340 29 29 public String registerCustomer(@ModelAttribute Stakeholder customer, Model model) { 30 30 Stakeholder user = stakeholderService.saveStakeholder(customer); 31 model.addAttribute("user", user); 32 return "redirect:homepage"; 31 return "redirect:login"; 33 32 } 34 33
Note:
See TracChangeset
for help on using the changeset viewer.