From f6cc5f269fd4391a75edaea6fb23e846d413029e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magdalena=20Grodzi=C5=84ska?= Date: Thu, 21 Nov 2019 10:54:08 +0100 Subject: Add basic data fetching backend --- .../edu/mimuw/cloudatlas/client/ClientController.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java') diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java index 022c665..be853b9 100644 --- a/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java +++ b/src/main/java/pl/edu/mimuw/cloudatlas/client/ClientController.java @@ -202,6 +202,23 @@ public class ClientController { @GetMapping("/values") public String valuesPage(Model model) { + model.addAttribute("zoneName", new ContactsString()); + return "attribChart"; + } + + @PostMapping("/values") + public String valuesPage(@ModelAttribute ContactsString zoneName, Model model) { + boolean success = true; + AttributesMap attribData; + + try { + attribData = api.getZoneAttributeValues(zoneName.getString()); + } catch (Exception e) { + success = false; + System.err.println("Client exception:"); + e.printStackTrace(); + } + return "attribChart"; } } -- cgit v1.2.3