# How can i make Tomcat (with virtual hosts) to parse the zul page in subfolders?

lordrayden
3

I'm running ZK on a Apache Tomcat Server with virtual hosts. In my ZK project i've got subfolders in my WebContent. So my Problem is, that if i redirect to a zul page which is in a subfolder, that i only see the zul/xml content and not the parsed page. How can i make Tomcat to parse the zul page?

delete retag edit

Sort by » oldest newest most voted

rdgrimes
735 7

Tomcat does not parse ZUL pages. It routes them. If you will look at your web.xml, you should see that the zkLoader servlet is assigned to process *.zul pages. So, your real problem is to define the mappings so that the *.zul pages in the sub-directory get routed through servlet zkLoader. Obviously, this is not happening and so Tomcat is simply returning it in it's raw form. I recommend posting your web.xml and give more information as to your WebContent directory structure.

lordrayden
3
    <display-name>DisplayName</display-name>
<listener>
<description>Used to cleanup when a session is destroyed</description>
<display-name>ZK Session cleaner</display-name>
<listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
</listener>
<servlet>
<description>The ZK loader for ZUML pages</description>
<servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
<init-param>
<param-name>update-uri</param-name>
<param-value>/zkau</param-value>
</init-param>
</servlet>
<servlet>
<description>The asynchronous update engine for ZK</description>
<servlet-name>auEngine</servlet-name>
</servlet>
<servlet-mapping>
<url-pattern>*.zul</url-pattern>
</servlet-mapping>
<servlet-mapping>
<url-pattern>*.zhtml</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>auEngine</servlet-name>
<url-pattern>/zkau/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.zul</welcome-file>
</welcome-file-list>

[hide preview]