-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I am wondering if it is possible to place zul files outside the web application folder or war file.
I would like to have my ViewModels and supporting classes as normally in WEB-INF/classes but certain zul files in a separate external location so I could, for instance, add some zul files on the fly.
In JSF this can be achieved by using javax.faces.view.facelets.ResourceResolver or javax.faces.application.ResourceHandler...
Any insight is highly appreciated. I was navigating the docs, especially ZK config reference manual 8.5.1 but didn't seem to find a fit. I'm wondering about org.zkoss.zk.ui.util.URIInterceptor
Ideally I would like to solve the problem declarively.
This is for production use. I have an application where plugins can be added at runtime. This works pretty well. In plugins, developers can bundle zul files...
I use jetty so app's .war ends up extracted to a random temp directory. By using servletContext.getRealPath("/") I know this physical path, so I simply extract the files there. That way, zul files are served with no effort
The problem arises in a clustered environment (same app running at different nodes), because the temp path is not the same across all nodes, so I need to use a predefined location to place zul files.
Thanks for reading!
After some more digging I found this (I cannot paste links):
wiki > Developer's Reference > Customization > UI Factory
So I will follow a strategy similar to that of loading zul from database, but reading instead from a static external filesystem location
I hope that should do it
I think Classpath Web Resource Path can fulfill your requirement.
Asked: 2019-03-30 04:05:33 +0800
Seen: 27 times
Last updated: Apr 11 '19
[ZK8.6 Preview] New media components coming soon!
Bug in Datebox with lenient=false and value 01.04.1981?
javascript cannot catch id of zul component. Please help.
failed to utilize getTop(), getLeft() on div(component). Please help.
zkoss issues with home page opening
is this for development or production use? An answer or recommendation would likely vary based on the intended purpose.
cor3000 ( 2019-04-01 12:51:18 +0800 )editHi cors3000, I added more text to the problem description. This text field for replying is limited. Thank you!
jgomer2001 ( 2019-04-01 21:27:29 +0800 )editThanks for contributing @hawk , it is close to what I need, however jars are added at runtime (using a plugin framework - pf4j) so unfortunately, these are not present in the classpath.
jgomer2001 ( 2019-04-03 21:25:21 +0800 )edit