From 5a2d4ebe976e3ecd71e21a432c3d626236a190f0 Mon Sep 17 00:00:00 2001 From: Dmitry Isaenko Date: Tue, 23 Jan 2024 18:22:18 +0300 Subject: [PATCH] correct search --- .../java/ru/redrise/marinesco/library/web/SearchController.java | 2 ++ src/main/resources/templates/fragments/header.html | 2 +- src/main/resources/templates/search.html | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/ru/redrise/marinesco/library/web/SearchController.java b/src/main/java/ru/redrise/marinesco/library/web/SearchController.java index 5bda079..0991d43 100644 --- a/src/main/java/ru/redrise/marinesco/library/web/SearchController.java +++ b/src/main/java/ru/redrise/marinesco/library/web/SearchController.java @@ -37,6 +37,8 @@ public class SearchController { if (search.trim().equals("")) return "search"; + model.addAttribute("searchPattern", search); + if (search.length() < 4){ model.addAttribute("error", "Should be at least 4 chars"); return "search"; diff --git a/src/main/resources/templates/fragments/header.html b/src/main/resources/templates/fragments/header.html index 6b59ee2..2786a70 100644 --- a/src/main/resources/templates/fragments/header.html +++ b/src/main/resources/templates/fragments/header.html @@ -63,7 +63,7 @@
  • - +
    diff --git a/src/main/resources/templates/search.html b/src/main/resources/templates/search.html index 33050b9..cad26d7 100644 --- a/src/main/resources/templates/search.html +++ b/src/main/resources/templates/search.html @@ -38,7 +38,7 @@

    Series

    -
    +