What’s the difference in using Modelandview and Responseentity?

Asked

Viewed 2,377 times

2

I came across these two classes, I found their function quite equal. What are the differences between them and when is the time to use a specific?

2 answers

3


Responseentity: means representing the entire HTTP response. You can control anything that happens: status code, headers and body.

Working with microservice, Responseentity to send reply complete, with status, header and body.

Modelandview: this class is used to specify the view that will be rendered and what data it will use for this.

Modelandview standard MVC.

I hope I’ve helped

0

On the issue of usability, the ResponseEntity is widely used in service-oriented architectures (SOA), specifically in the construction of Apis REST, as a response element (sponse, hence the name) for a service call.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.