From: Kai Moritz Date: Tue, 21 Jan 2020 20:42:15 +0000 (+0100) Subject: WIP X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=70dd2a8892d7a010f68dfe41883f85e0aacc5b86;p=demos%2Fspring-boot WIP --- 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 @@
- +