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..67c0193b 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();