Since servlet 3.0 specification it's possible to package web resources as a fragment project and deploy them on the main web project. When you build up and application which process .zul files taken through "web-fragment" projects, ZK can't load them.
ZK relies only on File().exists() to check if a requested .zul resource can be acquired. When having a 3.0 servlet web application, it's also important to check if, besides the File().exists() being false, one can still get an inputStream from the desired URL. If it's indeed possible, it means that the resource exists but not within the main project, therefore from within a web-fragment project.
In order to ZK to achieve this, you have to make a small patch in two classes.
I've made this patch into the following classes:
org.zkoss.zk.ui.metainfo.PageDefinitions from zk project
org.zkoss.web.util.resource.ResourceLoader from zkweb project
This classes are attached bellow.
It'd be good if you guys could verify the code and check if it's affordable to put this patch on a future bugfix release.