Comments on: Optimistic Locking mit dem ETag Header https://schegge.de/2020/09/optimistic-locking-mit-dem-etag-header/ Thoughts on agile software development Thu, 28 Nov 2024 12:47:13 +0000 hourly 1 https://wordpress.org/?v=6.7.1 By: Jens https://schegge.de/2020/09/optimistic-locking-mit-dem-etag-header/#comment-162 Fri, 20 Sep 2024 06:42:50 +0000 https://schegge.de/?p=2565#comment-162 In reply to Jens.

I have found some code about the initialization of the HandlerMethodReturnValueHandler.
It uses a custom InitializingBean an the EtagHeaderResultReturnValueHandler wraps two
HandlerMethodReturnValueHandler from the RequestMappingHandlerAdapter.


private HandlerMethodReturnValueHandler wrap(HandlerMethodReturnValueHandler handler) {
if (handler instanceof RequestResponseBodyMethodProcessor
|| handler instanceof RepresentationModelProcessorHandlerMethodReturnValueHandler) {
return new EtagHeaderResultReturnValueHandler(handler);
}
return handler;
}

Hope this helps.

]]>
By: Jens https://schegge.de/2020/09/optimistic-locking-mit-dem-etag-header/#comment-161 Thu, 19 Sep 2024 13:53:09 +0000 https://schegge.de/?p=2565#comment-161 In reply to Lucca.

I am sorry but there is no puplic repository where you have access to the source code.
Registering the custom HandlerMethodReturnValueHandler was/is tricky.
As far as I remember, you have to use the RequestMappingHandlerAdapter and get the List of all HandlerMethodReturnValueHandler and inject the custom one at a appropiate place.
But I will look throw my private repositories for further information.

]]>
By: Lucca https://schegge.de/2020/09/optimistic-locking-mit-dem-etag-header/#comment-160 Thu, 19 Sep 2024 13:32:47 +0000 https://schegge.de/?p=2565#comment-160 Is there a git repo where you can inspect the entire implementation. I am struggling to get the custom return value handler to work. I cant even get the handler to be registered and be called on a normal get request.

Greetings Lucca

]]>