简体   繁体   中英

Which layer should create a HttpResponse?

Do you know why HttpResponse is created in the controller layer? And what will happen if HttpResponse is created in the service layer?

HttpResponse should not be passed to the service layer.

The Controller layer is the conductor of operations for a request. It controls the transaction scope and manages the session related information for the request. The controller first dispatches to a command and then calls the appropriate view processing logic to render the response.

also Is a best practice.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM