-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a Maven ZK Multi-Module project.
I want to put the common resources [java files, images, zul files and css/js files] in one module(Let say -- common.jar). Then make other many modules [.war] dependent on this jar module.
The structure:
The problem is that I am not able to load/access the non-java resources in those war modules.
Tip: I used this example: Inter-Web-Application Communication, but i failed to make it work.
Please I appreciate any help that can be given because I don't want to copy these same resources at every module.
Thanks
how are you trying to access them in your project from common.jar, are you using relative path or absolute path, if you show us the code where you refer these resource, we will be able to help you better
Dear Echarish,thank you in advance.
I said that I followed the Zkoss Inter-application communication example where they use the Classpath. But if you look well, there is no big difference with Relative Path.
For example: To access template-addon.xml, I use <language-config> <addon-uri>~common/template-addon.xml</addon-uri> </language-config> this template-addon.xml resides in the root of common.jar.
Thanks!
It would have helped to understand better how you are referring your resource in your a.war or b.war, i mean the code like if you refer them in web.xml or zul pages or somewhere else...
anyway here is what i would try to look
suppose my resource is in common.jar, and my common.jar project is like this common/src/resource/customProperties.properties
now to refer this property file in my war project i.e. a.war, i would refer it as classpath:resource/customProperties.properties, either in web.xml or if you use spring than in context files as well.
in case you are putting your resouces in some folder other than src of your jar, make sure when the jar is being exported that folder is getting exported as well.
let me know if it helps you in anyway.
Asked: 2015-03-26 11:54:32 +0800
Seen: 48 times
Last updated: Mar 31 '15