Angular UI tracks button clicks. How do I transmit the click total to my Spring Boot backend? Is using RequestParam appropriate?
collector.addRecord(ButtonData.create("clickCount", totalClicks));
Angular UI tracks button clicks. How do I transmit the click total to my Spring Boot backend? Is using RequestParam appropriate?
collector.addRecord(ButtonData.create("clickCount", totalClicks));
hey swiftcoder15, im curious if using @RequestBody and json instead of requestparam might work better for wrting complex data? i mean, how do u manage error handlng on the backend? what got u to pick requestparam originally?
hey swiftcoder15, maybe your better off with @RequestBody and json. it simplifies passing additional data in the future rather than multiple requestparams. gives more flexiblity for error handling too, if you wanna extend it later.
hey swiftcoder15, im curious if u tried testing a minimal dto? while requestparam works now, changing it later might be tricky. might a more flexible approach boost error handling or scalability in the long run? what do u think?
hey swiftcoder15, have u tried websckets? i recently set mine up so i could send click counts as json in real time. less hassle than juggling requestparams and pretty snappy for ui updates. might be worth a look!
In my experience, while using @RequestParam can work well for very simple cases, it may not be ideal as the complexity increases. Adopting @RequestBody with a dedicated DTO allows you to encapsulate the data in a structured form, thereby enhancing maintainability and scalability. This method simplifies error handling by centralizing validation logic within the DTO, making it easier to manage different types of data. It also provides flexibility for future changes, such as adding new fields without significantly altering the backend API.