Changeset 763289e for src/main/java/edu/gjoko/schedlr/controllers
- Timestamp:
- 10/31/22 23:42:15 (2 years ago)
- Branches:
- master
- Children:
- 044bd76
- Parents:
- 204464d
- Location:
- src/main/java/edu/gjoko/schedlr/controllers
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/edu/gjoko/schedlr/controllers/HomePageController.java
r204464d r763289e 4 4 import org.springframework.ui.Model; 5 5 import org.springframework.web.bind.annotation.GetMapping; 6 import org.springframework.web.bind.annotation.PostMapping; 7 import org.springframework.web.bind.annotation.RestController; 6 8 7 @ Controller9 @RestController(value = "/homepage") 8 10 public class HomePageController { 9 11 10 @GetMapping (value = "/homepage")12 @GetMapping 11 13 public String getHomePageTemplate(Model model) { 12 14 return "homepage"; 13 15 } 16 17 @PostMapping 18 public String postHomePageTemplate(Model model) { 19 return "homepage"; 20 } 14 21 } -
src/main/java/edu/gjoko/schedlr/controllers/LoginController.java
r204464d r763289e 1 1 package edu.gjoko.schedlr.controllers; 2 2 3 import edu.gjoko.schedlr.entity.Stakeholder; 3 4 import org.springframework.stereotype.Controller; 4 5 import org.springframework.ui.Model; 5 6 import org.springframework.web.bind.annotation.GetMapping; 7 import org.springframework.web.bind.annotation.ModelAttribute; 8 import org.springframework.web.bind.annotation.PostMapping; 6 9 7 10 @Controller 8 11 public class LoginController { 9 12 10 @GetMapping( value= "/login")13 @GetMapping(path = "/login") 11 14 public String getMapping(Model model) { 15 model.addAttribute("stakeholder", new Stakeholder()); 12 16 return "login"; 13 17 } 18 19 @PostMapping(path = "/login") 20 public String loginCustomer(@ModelAttribute Stakeholder customer, Model model) { 21 return "redirect:homepage"; 22 } 14 23 } -
src/main/java/edu/gjoko/schedlr/controllers/RegisterController.java
r204464d r763289e 20 20 } 21 21 22 @GetMapping( "/register_customer")22 @GetMapping(value ="/register_customer") 23 23 public String getCustomerRegisterPage(Model model) { 24 24 model.addAttribute("stakeholder", new Stakeholder()); … … 30 30 Stakeholder user = stakeholderService.saveStakeholder(customer); 31 31 model.addAttribute("user", user); 32 return " homepage";32 return "redirect:homepage"; 33 33 } 34 34 35 @GetMapping( "/register_business")35 @GetMapping(value = "/register_business") 36 36 public String getBusinessRegisterPage(Model model) { 37 37 return "register_business"; 38 38 } 39 39 40 @PostMapping( "/register_business")40 @PostMapping(value = "/register_business") 41 41 public String registerBusiness(Model model) { 42 42 return "register_business";
Note:
See TracChangeset
for help on using the changeset viewer.