Options can be removed from the map
[demos/spring-boot] / src / main / java / de / juplo / demo / DemoController.java
index c74a6e9..a9391db 100644 (file)
@@ -47,4 +47,12 @@ public class DemoController
     }
     return display(form);
   }
+
+  @RequestMapping(path = "/", params = "remove")
+  public String remove(@ModelAttribute Form form, @RequestParam String remove)
+  {
+    Boolean value = form.map.remove(remove);
+    log.info("Removed option \"{}\" with value {} from the map", remove, value);
+    return display(form);
+  }
 }