-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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?
<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-name>zkLoader</servlet-name>
<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>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<description>The asynchronous update engine for ZK</description>
<servlet-name>auEngine</servlet-name>
<servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>zkLoader</servlet-name>
<url-pattern>*.zul</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>zkLoader</servlet-name>
<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>
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.
Asked: 2013-04-23 15:30:55 +0800
Seen: 23 times
Last updated: Apr 29 '13