Last change
on this file since cc52b09 was cc52b09, checked in by Gjoko Kostadinov <gjoko.kostadinov@…>, 17 months ago |
Add search button functionality
|
-
Property mode
set to
100644
|
File size:
819 bytes
|
Line | |
---|
1 | package edu.gjoko.schedlr.controllers;
|
---|
2 |
|
---|
3 | import edu.gjoko.schedlr.entity.Search;
|
---|
4 | import org.springframework.stereotype.Controller;
|
---|
5 | import org.springframework.ui.Model;
|
---|
6 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
7 | import org.springframework.web.bind.annotation.ModelAttribute;
|
---|
8 | import org.springframework.web.bind.annotation.PostMapping;
|
---|
9 |
|
---|
10 | @Controller
|
---|
11 | public class HomePageController {
|
---|
12 |
|
---|
13 | @GetMapping(name = "/homepage")
|
---|
14 | public String getHomePageTemplate(Model model, @ModelAttribute("search")Search search ) {
|
---|
15 | model.addAttribute("search", search);
|
---|
16 | return "homepage";
|
---|
17 | }
|
---|
18 |
|
---|
19 | @PostMapping(name = "/homepage")
|
---|
20 | public String postHomePageTemplate(Model model, @ModelAttribute("search")Search search) {
|
---|
21 | model.addAttribute("search", search);
|
---|
22 | return "homepage";
|
---|
23 | }
|
---|
24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.