码迷,mamicode.com
首页 > 数据库 > 详细

spring mvc -- HttpMessageConverter、DispatcherServlet、Validator---@RequestBody @respondBody

时间:2019-12-30 17:50:35      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:org   RKE   hub   nta   cli   cat   handle   crud   imp   

When RESTful Web Service is developed using Spring MVC, the application is configured as given below. Among these, implementation is necessary for the portion marked with red frame.
技术图片
Sr. No.Process layerDescription
(1)
Spring MVC
(Framework)
Spring MVC receives a request from client and determines the REST API (handler method of Controller) to be called.
(2)
 
 
Spring MVC converts the JSON format message specified in request BODY to Resource object by using HttpMessageConverter.
(3)
 
 
Spring MVC performs input validation for the value stored in Resource object using Validator.
(4)
 
 
Spring MVC calls REST API.
Here, the Resource that has been converted from JSON and for which input validation is carried out, is delivered to REST API.
(5)
REST API
REST API calls Service method and performs the process for DomainObject such as Entity etc.
(6)
 
Service method calls the Repository method and performs CRUD process for the DomainObject such as Entity etc.
(7)
Spring MVC
(Framework)
Spring MVC converts the Resource object returned from REST API to JSON format message, by using HttpMessageConverter.
(8)
 
 
Spring MVC sets JSON format message in response BODY and responds to client.
 http://terasolunaorg.github.io/guideline/5.2.0.RELEASE/en/ArchitectureInDetail/WebServiceDetail/REST.html

spring mvc -- HttpMessageConverter、DispatcherServlet、Validator---@RequestBody @respondBody

标签:org   RKE   hub   nta   cli   cat   handle   crud   imp   

原文地址:https://www.cnblogs.com/feng9exe/p/12120485.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!