zoukankan      html  css  js  c++  java
  • spring mvc -- HttpMessageConverter、DispatcherServlet、Validator---@RequestBody @respondBody

    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.
    Application constitution of RESTful Web Service on Spring MVC
    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
  • 相关阅读:
    观察者模式股票提醒
    中介者模式虚拟聊天室
    模板方法模式数据库的连接
    职责链模式财务审批
    期末总结
    软件需求分析考试
    tomcat启动极其慢的解决方法困扰我一年多的问题终于解决
    状态模式银行账户
    解释器模式
    动态加载JS文件提升访问网站速度
  • 原文地址:https://www.cnblogs.com/feng9exe/p/12120485.html
Copyright © 2011-2022 走看看