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
|
Rev | Line | |
---|
[204464d] | 1 | package edu.gjoko.schedlr.controllers;
|
---|
| 2 |
|
---|
[9280859] | 3 | import edu.gjoko.schedlr.entity.Search;
|
---|
[204464d] | 4 | import org.springframework.stereotype.Controller;
|
---|
| 5 | import org.springframework.ui.Model;
|
---|
| 6 | import org.springframework.web.bind.annotation.GetMapping;
|
---|
[9280859] | 7 | import org.springframework.web.bind.annotation.ModelAttribute;
|
---|
[763289e] | 8 | import org.springframework.web.bind.annotation.PostMapping;
|
---|
[204464d] | 9 |
|
---|
[044bd76] | 10 | @Controller
|
---|
[204464d] | 11 | public class HomePageController {
|
---|
| 12 |
|
---|
[044bd76] | 13 | @GetMapping(name = "/homepage")
|
---|
[9280859] | 14 | public String getHomePageTemplate(Model model, @ModelAttribute("search")Search search ) {
|
---|
| 15 | model.addAttribute("search", search);
|
---|
[204464d] | 16 | return "homepage";
|
---|
| 17 | }
|
---|
[763289e] | 18 |
|
---|
[044bd76] | 19 | @PostMapping(name = "/homepage")
|
---|
[9280859] | 20 | public String postHomePageTemplate(Model model, @ModelAttribute("search")Search search) {
|
---|
| 21 | model.addAttribute("search", search);
|
---|
| 22 | return "homepage";
|
---|
| 23 | }
|
---|
[204464d] | 24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.