-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have two jsp-files:
test.jsp:
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <html xmlns:x="http://www.zkoss.org/2005/zul"> <body> <x:include src="testinclude.jsp"/> <x:label value="Label" width="150px" /> </body> </html>
And testinclude.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <html xmlns:x="http://www.zkoss.org/2005/zul"> <body> <x:textbox value="x" width="150px" /> </body> </html>
in web.xml I have:
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <display-name>x</display-name> <description></description> <servlet> <description>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>8</load-on-startup> </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> <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>auEngine</servlet-name> <url-pattern>/zkau/*</url-pattern> </servlet-mapping> <filter> <filter-name>zkFilter</filter-name> <filter-class>org.zkoss.zk.ui.http.DHtmlLayoutFilter</filter-class> <init-param> <param-name>extension</param-name> <param-value>html</param-value> <!-- Use XHTML components as default. --> </init-param> </filter> <filter-mapping> <filter-name>zkFilter</filter-name> <url-pattern>/jsp/test.jsp</url-pattern> <url-pattern>/jsp/testinclude.jsp</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> </web-app>
When I open test.jsp in browser, result looks like this:
zkb('zhtml.Widget','z_c2_6','',{ prolog:'',epilog:''}); zkb('zhtml.Widget','z_c2_7','',{ prolog:'',epilog:''}); zkb('zul.inp.Textbox','z_c2_8','',{ $$onError:false,$$onSize:false,$$onChange:false,width:'150px',value:'x'}); zke(); zke(); zke();
Label
Am I missing something or is it problem with version 5.0.1, because this worked fine in 3.6.1?
Hi, pzk,
We don't use that filter no longer ,
you can refer this doc,
and download latest ZK JSP (1.4.0-RC)
but that doc has some changed
change the <%@ taglib uri="http://www.zkoss.org/2005/zul/jsp" prefix="z" %>
to <%@ taglib uri="http://www.zkoss.org/jsp/zul" prefix="z"%>
now your sample is work fine
test.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://www.zkoss.org/jsp/zul" prefix="z"%> <html> <body> <z:page> <z:label value="Label" width="150px" /> <z:include src="testinclude.jsp" /> </z:page> </body> </html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib uri="http://www.zkoss.org/jsp/zul" prefix="z"%> <html> <body> <z:page> <z:textbox value="x" width="150px" /> </z:page> </body> </html>
Thanks for the answer.
ZK Jsp is licensed as GPL and I can't use that. What do you mean by "We don't use that filter no longer"? If I leave the include tag out of my example, it works fine. Is it ok to use ZK 5.0.1 like this, or will it stop working someday?
OK,
What do you mean by "We don't use that filter no longer"?
It‘s my mistake.
It still works on ZK 5,
I will find where the problem is.
Why don't you use JSP's include ?
Asked: 2010-03-19 03:59:21 +0800
Seen: 480 times
Last updated: Mar 25 '10