From 86e3ced19b7c6c526546305a63a50134faaef711 Mon Sep 17 00:00:00 2001 From: CodeSteak Date: Wed, 17 Jun 2020 00:17:50 +0200 Subject: [PATCH] Secretly fix searchbar not showing term when searching --- .../hso/ecommerce/controller/shop/ShopSearchController.java | 3 +++ prototype/src/main/resources/templates/fragments/header.html | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java b/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java index 8e8980c..53d03fb 100644 --- a/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java +++ b/prototype/src/main/java/org/hso/ecommerce/controller/shop/ShopSearchController.java @@ -47,6 +47,9 @@ public class ShopSearchController { return "error/404"; } + // Show term in search box + model.addAttribute("searchterm", term != null ? term : ""); + return "shop/search"; } } \ No newline at end of file diff --git a/prototype/src/main/resources/templates/fragments/header.html b/prototype/src/main/resources/templates/fragments/header.html index 349f72c..9984032 100644 --- a/prototype/src/main/resources/templates/fragments/header.html +++ b/prototype/src/main/resources/templates/fragments/header.html @@ -11,7 +11,8 @@
- +
Login