package de.juplo.demo;
+import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
/**
- * Controller to demonstrate the behavior of the checkbox
+ * Controller to demonstrate the behavior of checkboxes
* @author Kai Moritz
*/
@Controller
@RequestMapping("/")
public String display(@ModelAttribute Form form)
{
- log.info("option={}", form.option);
+ log.info(
+ "option={}, inner={}{}",
+ form.option,
+ form.inner.option,
+ form.map
+ .entrySet()
+ .stream()
+ .map(entry -> entry.getKey() + "=" + entry.getValue())
+ .collect(Collectors.joining(", ", ", ", "")));
return "form";
}
}