WIP
[demos/spring-boot] / src / main / java / de / juplo / demo / DemoController.java
index a83a4b1..cc2fcba 100644 (file)
@@ -32,7 +32,7 @@ public class DemoController
     return "form";
   }
 
-  @RequestMapping(path = "/", params = "add=card")
+  @RequestMapping(path = "/", params = "card=add")
   public String addCard(@ModelAttribute Form form)
   {
     Integer next =
@@ -46,17 +46,15 @@ public class DemoController
     return "form";
   }
 
-  @RequestMapping(path = "/", params = "remove=card")
-  public String removeCard(
-      @ModelAttribute Form form,
-      @RequestParam Integer card)
+  @RequestMapping(path = "/", params = "card!=add")
+  public String removeCard(@ModelAttribute Form form, @RequestParam Integer card)
   {
     Map<String, Boolean> content = form.cards.remove(card);
     LOG.info("Removed card #{} with content: {}", card, content);
     return "form";
   }
 
-  @RequestMapping(path = "/", params = "add!=card")
+  @RequestMapping(path = "/", params = "add")
   public String addRow(@ModelAttribute Form form, @RequestParam Integer add)
   {
     LOG.info("Adding row {} to card #{}", form.row.get(add), add);
@@ -64,7 +62,7 @@ public class DemoController
     return "form";
   }
 
-  @RequestMapping(path = "/", params = "remove!=card")
+  @RequestMapping(path = "/", params = "remove")
   public String removeRow(@ModelAttribute Form form, @RequestParam String remove)
   {
     String[] parts = remove.split(":", 2);