http://slackspace.de/articles/log-request-body-with-spring-boot/ (filter + RequestWrapper:最優雅的寫法)java
https://howtodoinjava.com/servlets/httpservletrequestwrapper-example-read-request-body/ (RequestWrapper)
https://coderanch.com/t/364591/java/read-request-body-filter(RequestWrapper)
https://stackoverflow.com/questions/29152431/is-there-an-way-to-get-the-http-request-body-content-in-a-spring-boot-filter (ControllerAdvice的方式獲取)
https://gist.github.com/calo81/2071634 (filter + RequestWrapper)
https://coderanch.com/t/364591/java/read-request-body-filter (filter + RequestWrapper)git
Controller方法的入參不能夠寫多個@RequestBody。
對於 POST 請求,請求參數永遠都是一個,由於一個request中只包含一個request body. 理解了這個,就會明白Spring MVC不支持多個@RequestBody。github
Controller定義自定義參數對象解析
經過擴展 HandlerMethodArgumentResolver 來實現。(https://sdqali.in/blog/2016/01/29/using-custom-arguments-in-spring-mvc-controllers/)spring