From 70dd2a8892d7a010f68dfe41883f85e0aacc5b86 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Tue, 21 Jan 2020 21:42:15 +0100 Subject: [PATCH] WIP --- src/main/java/de/juplo/demo/DemoController.java | 8 ++++---- src/main/resources/templates/form.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/juplo/demo/DemoController.java b/src/main/java/de/juplo/demo/DemoController.java index 7c65a60..da09321 100644 --- a/src/main/java/de/juplo/demo/DemoController.java +++ b/src/main/java/de/juplo/demo/DemoController.java @@ -33,7 +33,7 @@ public class DemoController return "form"; } - @RequestMapping(path = "/", params = "card=add") + @RequestMapping(path = "/", params = { "card=add", "!add", "!remove" }) public String addCard(@ModelAttribute Form form) { Integer next = @@ -54,7 +54,7 @@ public class DemoController return "form"; } - @RequestMapping(path = "/", params = "card!=add") + @RequestMapping(path = "/", params = { "card!=add", "!add", "!remove" }) public String removeCard(@ModelAttribute Form form, @RequestParam Integer card) { Map content = form.cards.remove(card); @@ -67,7 +67,7 @@ public class DemoController return "form"; } - @RequestMapping(path = "/", params = "add") + @RequestMapping(path = "/", params = { "!card", "add", "!remove" }) public String addRow(@ModelAttribute Form form, @RequestParam Integer add) { LOG.info("Adding row {} to card #{}", form.names.get(add), add); @@ -80,7 +80,7 @@ public class DemoController return "form"; } - @RequestMapping(path = "/", params = "remove") + @RequestMapping(path = "/", params = { "!card", "!add", "remove" }) public String removeRow(@ModelAttribute Form form, @RequestParam String remove) { String[] parts = remove.split(":", 2); diff --git a/src/main/resources/templates/form.html b/src/main/resources/templates/form.html index eb6fb24..7a1ea54 100644 --- a/src/main/resources/templates/form.html +++ b/src/main/resources/templates/form.html @@ -18,7 +18,7 @@
- +
-- 2.20.1