jakartaee / jakarta.ee

Jakarta EE is the future of cloud native Java. Jakarta EE open source software drives cloud native innovation, modernizes enterprise applications and protects investments in Java EE.
https://jakarta.ee
Eclipse Public License 2.0
158 stars 95 forks source link

get response body from the jakarta.servlet.http HttpServletResponse #1941

Open kalungedamaji opened 2 weeks ago

kalungedamaji commented 2 weeks ago

we added interceptor to intercept the request and response and need to get the response body in string format How should I access the response body.

class RequestResponseInterceptor(private val messageSender: AuditMessageSender) : HandlerInterceptor {

override fun afterCompletion(request: HttpServletRequest, response: HttpServletResponse, handler: Any, ex: Exception?) {

} 

}