Can i show parts an object to the user in a view, and retrieve the full object upon a POST request?

StackOverflow https://stackoverflow.com/questions/22145305

  •  19-10-2022
  •  | 
  •  

Question

I have a webapp where i call several independent webservices to retrieve information, and i show this info to the user.

Every object that i show is parsed and i am using my own domain-objects (pojo's).

After passing this info to the view, and showing them to the user, the user can act upon them (for an example: accept or deny an sales-offer).

Upon accepting / denying i want to track this action, and i have the underlying services in place, but how do I reference the same instance of the object i just passed to the view?

I should not call the web-service again to retrieve it, since this technically will be a new instance.

it is possible to use custom attributes on a tag or hidden form-elements to keep relevant data and parse it back to my controller, but this feels dirty.

I feel like there should be an innate method of doing this, but i don't know where to look. Any pointers ? :)

I just spring-boot-1.0.0rc1 (underlying thymeleaf 4 + Spring-webmvc-4)

No correct solution

OTHER TIPS

yes you can when I show a object to user view. Let show it in a object be displayed here then which field you dont want to show to user just make it hidden by "hidden" attribute. Then when you post the form to the controller spring will auto grab the object for you, you can see more detail/ step by step from this article http://chiase.azurewebsites.net/?p=471

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top