From 1df571deba23c52c525da81c7ce91c061014f05d Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Tue, 14 Nov 2023 11:22:35 +0100 Subject: [PATCH] Fix the problem with Template#getFragment() on quarkus 3.5+ --- .../java/io/quarkiverse/qute/web/runtime/QuteWebHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/src/main/java/io/quarkiverse/qute/web/runtime/QuteWebHandler.java b/runtime/src/main/java/io/quarkiverse/qute/web/runtime/QuteWebHandler.java index 7810d59b..7ad61592 100644 --- a/runtime/src/main/java/io/quarkiverse/qute/web/runtime/QuteWebHandler.java +++ b/runtime/src/main/java/io/quarkiverse/qute/web/runtime/QuteWebHandler.java @@ -135,7 +135,9 @@ private void handlePage(RoutingContext rc) { // It is possible to specify the fragment via query param, e.g. /item?frag=detail String fragmentId = rc.request().getParam(FRAGMENT_PARAM); if (fragmentId != null) { - Fragment fragment = template.getFragment(fragmentId); + // Note that we have to use the original instance to obtain the fragment + // because getFragment() invoked upon the injectable template returns an injectable fragment and never null + Fragment fragment = originalInstance.getTemplate().getFragment(fragmentId); if (fragment == null) { LOG.errorf("Fragment [%s] not found: %s", fragmentId, rc.request().path()); rc.response().setStatusCode(404).end();