Download ZUL from Jar

Does anyone know how to download Zul from Jar? I have a library project that contains Zul. I am currently using createComponents (String uri, Component parent, Map arg), but I do not know or cannot link to the uri in the bank.


I am using now:

public static Component createComponentsFromJar(final String path, final Component parent, final Map<?,?> arg) throws IOException { final InputStream resourceAsStream = ComponentHelper.class.getClassLoader().getResourceAsStream(path); final PageDefinition pageDefinition = Executions.getCurrent().getPageDefinitionDirectly(new InputStreamReader(resourceAsStream), "zul"); resourceAsStream.close(); return Executions.createComponents(pageDefinition, parent, arg); } 

Are there any problems with this method of creating new pages? Some binding problems or questions?

+4
source share
1 answer

Executions.createComponents will work with the ZK Specific URI (see Inter-Application Communication ), where "~. /" In the ZK Specific URI will get the file under "classpath / web /", take your zul page in the section "src / web / zul / pages "as shown below:

zul page under src

And you export the src folder as a jar, then you can create a component with a zul file in the bank, as shown below:

 Executions.createComponents("~./zul/pages/zulInJar.zul", parent, null); 
+6
source

All Articles