From a452a993d5ebda3d4c826cf9e218636fe5243fda Mon Sep 17 00:00:00 2001 From: Thorsten Marx Date: Sat, 4 Nov 2023 07:27:08 +0100 Subject: [PATCH] working example of resourcehandler inside of module --- .../ui/http/UIJettyHttpHandlerExtension.java | 2 +- .../files/ui-module/assets/index.html | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 modules/ui-module/src/main/resources/files/ui-module/assets/index.html diff --git a/modules/ui-module/src/main/java/com/github/thmarx/cms/modules/ui/http/UIJettyHttpHandlerExtension.java b/modules/ui-module/src/main/java/com/github/thmarx/cms/modules/ui/http/UIJettyHttpHandlerExtension.java index 750f6f5f..3bbe2b03 100644 --- a/modules/ui-module/src/main/java/com/github/thmarx/cms/modules/ui/http/UIJettyHttpHandlerExtension.java +++ b/modules/ui-module/src/main/java/com/github/thmarx/cms/modules/ui/http/UIJettyHttpHandlerExtension.java @@ -57,7 +57,7 @@ public Mapping getHandler() { // ResourceFactory.of(resourceHandler) // .newClassLoaderResource("com/github/thmarx/cms/modules/ui/assets/", false) // ); - URL resource = UIJettyHttpHandlerExtension.class.getResource("/com/github/thmarx/cms/modules/ui/assets"); + URL resource = UIJettyHttpHandlerExtension.class.getResource("/files"); var fileURI = resource.toURI().toString().replace("jar:", ""); resourceHandler.setBaseResource(ResourceFactory.of(resourceHandler).newJarFileResource(URI.create(fileURI))); diff --git a/modules/ui-module/src/main/resources/files/ui-module/assets/index.html b/modules/ui-module/src/main/resources/files/ui-module/assets/index.html new file mode 100644 index 00000000..4c6725ad --- /dev/null +++ b/modules/ui-module/src/main/resources/files/ui-module/assets/index.html @@ -0,0 +1,26 @@ + + + + + + UI + +