I came across these two classes, I found their function well the same. What are the differences between them and when is the time to use a specific one?
I came across these two classes, I found their function well the same. What are the differences between them and when is the time to use a specific one?
ResponseEntity: means to represent the entire HTTP response. You can control anything that happens: status code, headers, and body.
Working with microservice, ResponseEntity to send response complete, with status, with header and body.
ModelAndView : This class is used to specify the view that will be rendered and what data it will use for that.
ModelAndView default MVC.
I hope I have helped
On the usability issue, ResponseEntity
is heavily used in service-oriented architectures (SOA), specifically in building APIs #, as response element (response, hence the name) for the call of a given service.