From 1eecc28e54c331b57fbb1a44a152c2f7a46b0c9a Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Thu, 17 Sep 2020 19:09:26 +0300 Subject: [PATCH] Redirect invalid URL requests to default page by default. Do not filter these invalid requests by specific HTTP method types Signed-off-by: Pekka Helenius --- .../java/com/fjordtek/bookstore/web/BookController.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java index 9222f27..1475d86 100644 --- a/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java +++ b/bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java @@ -212,11 +212,11 @@ public class BookController { // Other URL requests @RequestMapping( - value = "*", - method = { RequestMethod.GET, RequestMethod.POST } + value = "*" ) public String errorWebForm(HttpServletRequest requestData) { - return httpExceptionHandler.notFoundErrorHandler(requestData); + //return httpExceptionHandler.notFoundErrorHandler(requestData); + return "redirect:" + bookListPageURL; } @RequestMapping(