Skip to content

Commit

Permalink
Drop support for rendering views from the HtmxHandlerInterceptor
Browse files Browse the repository at this point in the history
This was introduced by wimdeblauwe#128, but a HandlerInterceptor should never be responsible for rendering views.
  • Loading branch information
xhaggi committed Nov 4, 2024
1 parent ec390d9 commit e5cd567
Showing 1 changed file with 0 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ public void postHandle(HttpServletRequest request, HttpServletResponse response,
}

private void buildAndRender(HtmxResponse htmxResponse, ModelAndView mav, HttpServletRequest request, HttpServletResponse response) {
View v = htmxResponseHandlerMethodReturnValueHandler.toView(htmxResponse);
try {
Map<String, Object> model = mav != null ? mav.getModel() : Map.of();
v.render(model, request, response);
// ModelAndViewContainer is not available here, so flash attributes won't work
htmxResponseHandlerMethodReturnValueHandler.addHxHeaders(htmxResponse, request, response, null);
} catch (Exception e) {
Expand Down

0 comments on commit e5cd567

Please sign in to comment.