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

Adding customer registration

File:
1 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    }
Note: See TracChangeset for help on using the changeset viewer.