Ignore:
Timestamp:
02/05/23 19:55:10 (22 months ago)
Author:
Gjoko Kostadinov <gjoko.kostadinov@…>
Branches:
master
Children:
2b0a4db
Parents:
cc52b09
Message:

Adding customer registration

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  
    11package edu.gjoko.schedlr.controllers;
    22
    3 import edu.gjoko.schedlr.entity.Search;
    43import org.springframework.stereotype.Controller;
    54import org.springframework.ui.Model;
    65import org.springframework.web.bind.annotation.GetMapping;
    7 import org.springframework.web.bind.annotation.ModelAttribute;
    86import org.springframework.web.bind.annotation.PostMapping;
     7
     8import java.security.Principal;
    99
    1010@Controller
     
    1212
    1313    @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);
    1616        return "homepage";
    1717    }
    1818
    1919    @PostMapping(name = "/homepage")
    20     public String postHomePageTemplate(Model model, @ModelAttribute("search")Search search) {
    21         model.addAttribute("search", search);
     20    public String postHomePageTemplate(Model model) {
    2221        return "homepage";
    2322    }
  • src/main/java/edu/gjoko/schedlr/controllers/LoginController.java

    rcc52b09 ra436340  
    1212
    1313    @GetMapping(path = "/login")
    14     public String getMapping(Model model) {
    15         model.addAttribute("stakeholder", new Stakeholder());
     14    public String getMapping(@ModelAttribute Stakeholder customer, Model model) {
    1615        return "login";
    1716    }
  • src/main/java/edu/gjoko/schedlr/controllers/RegisterController.java

    rcc52b09 ra436340  
    2929    public String registerCustomer(@ModelAttribute Stakeholder customer, Model model) {
    3030        Stakeholder user = stakeholderService.saveStakeholder(customer);
    31         model.addAttribute("user", user);
    32         return "redirect:homepage";
     31        return "redirect:login";
    3332    }
    3433
Note: See TracChangeset for help on using the changeset viewer.