-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4258623
By: spromano
Hi all,
I'm trying to use the DhtmlLayout filter in order to dynamically produce zul pages (I'm doing this in order to enrich an existing web app...). I've been trying for the last two days to solve an issue with the SAX parser, which keeps on raising exceptions, e.g.:
1- with a simple jsp like the following:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<window title="My First window" border="normal" width="200px">
Hello, World!
</window>
...I get the following message:
org.zkoss.zk.ui.UiException: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed
2- if I try to use a doctype declaration (see http://sourceforge.net/forum/message.php?msg_id=3797981), I have:
JSP:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE xhtml "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<window title="My First window" border="normal" width="200px">
Hello, World!
</window>
Exception:
org.zkoss.zk.ui.UiException: org.xml.sax.SAXParseException: The document type declaration for root element type "xhtml" must end with '>'.
I really don't know what to try more in order to address this issue. Any help is more than welcome.
Cheers,
Simon
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4258690
By: spromano
Hi all,
I'm trying to use the DhtmlLayout filter in order to dynamically produce zul pages (I'm doing this in order to enrich an existing web app...). I've been trying for the last two days to solve an issue with the SAX parser, which keeps on raising exceptions, e.g.:
1- with a simple jsp like the following:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<window title="My First window" border="normal" width="200px"> Hello, World!
</window>
...I get the following message:
org.zkoss.zk.ui.UiException: org.xml.sax.SAXParseException: The markup in the document following the root element must be well-formed
2- if I try to use a doctype declaration (see http://sourceforge.net/forum/message.php?msg_id=3797981), I have:
JSP:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE xhtml "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<window title="My First window" border="normal" width="200px"> Hello, World!
</window>
Exception:
org.zkoss.zk.ui.UiException: org.xml.sax.SAXParseException: The document type declaration for root element type "xhtml" must end with '>'.
I really don't know what to try more in order to address this issue. Any help is more than welcome.
Cheers,
Simon
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4260225
By: jumperchen
You need to define a namespace with "http://www.zkoss.org/2005/zul" ,and then use the following.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<x:window title="My First window" border="normal" width="200px"
xmlns:x="http://www.zkoss.org/2005/zul">
Hello, World!
</x:window>
please read the ZK- Small Talk : "Work with Legacy Web Applications, Part II
- JSP"
http://www.zkoss.org/smalltalks/legacy-jsp/legacy-jsp.html
Best Regards,
Jumper
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4260652
By: spromano
Hi Jumper,
thank you for the reply. I tried with the zul namespace added (as you suggest), but nothing changes. Maybe the problem is in the fact that the output of the jsp MUST be a well-formed zhtml page rather than a well-formed zul page? Indeed, if I turn the filter off, the page produced is a well-formed zul page, even though it has a blank line at the beginning...if I save this page as page.zul and try to load it form the browser, everything is ok. If I save it as page.zhtml, firefox is able to load it correctly, whereas IE gets a bit confused.
Or is there something related to the java jre (I'm using jre 1.5.0_05)?
Thanks a lot for your feedback,
Simon
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4261139
By: spromano
Hi again,
by now I solved the issue in the quickiest yet dirtiest way:
**********************************************************************
<%@ page language="java" contentType="text/html" pageEncoding="ISO-8859-1"
import="java.io.PrintWriter, java.io.FileOutputStream"%>
<%
try {
PrintWriter writer = new PrintWriter(new FileOutputStream("C:\\Programmi\\apache-tomcat-5.5.12\\webapps\\MyZkSamples\\jsp
\\DynamicZulFile.zul", false), true);
writer.println("<window title=\"My First window\" border=\"normal\"
width=\"200px\">");
writer.println("Hello, World!");
writer.println("</window>");
writer.flush();
writer.close();
}catch(Exception ex) {
ex.printStackTrace();
}
%>
<html>
<body>
<center>
<jsp:include page="DynamicZulFile.zul"/> </center> </body> </html>
********************************************************************************
***************************
I removed the filter and opted for the <jsp:include> tag...
After wasting two whole days, I'm getting convinced there's something wrong either in myself (;-)) or in the DhtmlLayoutFilter provided with ZK.
If someone has a "working" example I would really appreciate some "detailed"
info (tomcat version, jdk version, ZK version, whole web.xml file, plus a working jsp making use of the filter) about how the problem can be faced without getting crazy.
Thanks a lot in advance,
Simon
Asked: 2007-04-13 09:53:00 +0800
Seen: 576 times
Last updated: Apr 14 '07