0

Problem while using html namespace.

asked 2010-04-22 03:10:07 +0800

baskaraninfo gravatar image baskaraninfo
526 2 2 9

When I used empty page, zk appends some text!

Source to reproduce:

<?page title="Some unwanted stuff shown!!" ?>
<zk xmlns:h="http://www.w3.org/1999/xhtml"
	xmlns:zk="http://www.zkoss.org/2005/zk">
	<h:html>
	</h:html>
</zk>

Output:

zkpe();}finally{zkme();} 

Is there any work around to solve this?

Thank you.

My Curent Working Environment:
ZK source 5.0.1 package
ZK Studio eclipse Plugin version 0.9.6
Eclipse version 3.5

delete flag offensive retag edit

9 Replies

Sort by » oldest newest

answered 2010-04-26 10:18:18 +0800

styleanand gravatar image styleanand
15 1

For me it worked in this way.
Hope this will help you to construct empy HTML page with out zkpe();}finally{zkme();} output on browser.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1.dtd">
<html lang="en" xml:lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:zk="http://www.zkoss.org/2005/zk">

<body>
<zk>

<h4>Hi welcome</h4>

</zk>
</body>
</html>

Thanks

link publish delete flag offensive edit

answered 2010-04-26 10:27:47 +0800

styleanand gravatar image styleanand
15 1

This one work too. As required

Try this :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1.dtd">
<zk xmlns:h="http://www.w3.org/1999/xhtml"
xmlns:zk="http://www.zkoss.org/2005/zk" >
<h:html>
</h:html>
</zk>

Thanks

link publish delete flag offensive edit

answered 2010-05-03 02:14:57 +0800

baskaraninfo gravatar image baskaraninfo
526 2 2 9

Thank you, Anand :)

When I ran your code as it is, am getting the following error:

org.zkoss.lang.SystemException: java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml1.dtd
	sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	org.zkoss.lang.Classes.newInstance(Classes.java:76)
	org.zkoss.lang.Exceptions.wrap(Exceptions.java:162)
	org.zkoss.lang.SystemException$Aide.wrap(SystemException.java:45)
	org.zkoss.util.resource.ResourceCache.get(ResourceCache.java:156)
	org.zkoss.web.util.resource.ResourceCaches.get(ResourceCaches.java:130)
	org.zkoss.zk.ui.metainfo.PageDefinitions.getPageDefinition(PageDefinitions.java:140)
	org.zkoss.zk.ui.impl.AbstractUiFactory.getPageDefinition(AbstractUiFactory.java:113)
	org.zkoss.zk.ui.http.DHtmlLayoutServlet.process(DHtmlLayoutServlet.java:230)
	org.zkoss.zk.ui.http.DHtmlLayoutServlet.doGet(DHtmlLayoutServlet.java:159)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

When I remove the following dtd declaration as shown below, I get "zkpe();}finally{zkme();} " on my output window:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1.dtd">

Any other work around to avoid this?

Thank you.

link publish delete flag offensive edit

answered 2010-05-04 07:06:45 +0800

iantsai gravatar image iantsai
2755 1

why you need to output an empty page?

link publish delete flag offensive edit

answered 2010-05-04 08:15:30 +0800

baskaraninfo gravatar image baskaraninfo
526 2 2 9

updated 2010-05-04 08:26:03 +0800

@iantsai

That sample snippet code is just to reproduce my problem.

Eventhough my page has some content, then also 'zkpe();}finally{zkme();}' code is appended to the end of the page as shown below :

Hello World! zkpe();}finally{zkme();

Which doesn't look nice.

I think you will understand the problem now.

Thank you.

link publish delete flag offensive edit

answered 2010-05-05 23:22:56 +0800

iantsai gravatar image iantsai
2755 1

Take a look at this article, it might help you how to out put some native html text content inside a zul:

http://www.zkoss.org/doc/devguide/ch07s17s02.html

link publish delete flag offensive edit

answered 2010-05-06 02:25:26 +0800

baskaraninfo gravatar image baskaraninfo
526 2 2 9

Thank you, iantsai :)

The following code works:

<?page title="Some unwanted stuff shown!!" ?>
<zk xmlns:h="http://www.zkoss.org/2005/zk/native">
	<h:html>
		<h:li>
			<textbox />
		</h:li>
	</h:html>
</zk>

I had replaced "http://www.w3.org/1999/xhtml" with "http://www.zkoss.org/2005/zk/native" and everything seems perfect.

Note: Now even an empty page rendered neatly.

Thanks for giving the reference link.

link publish delete flag offensive edit

answered 2010-07-23 04:33:57 +0800

scerro gravatar image scerro
273 3 9
www.desarrolloagil.es

hi all,

I am having the same error on my application and I don't know what should I do to solve it!
Its correct when I replace the expression "http://www.w3.org/1999/xhtml" with "http://www.zkoss.org/2005/zk/native" the text

zkpe();}finally{zkme();} 
is not showed on the browser anymore, but if you do that, the application doesn't work in safary, opera and chrome browsers (at least in my case).

I paste the zul page:


<?page id="indexPage" title="Login" cacheable="false" 
	language="xul/html" zscriptLanguage="Java"?>

<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" ?>

<?meta content="text/html; charset=UTF-8" 	pageEncoding="UTF-8"?>

<?meta name="description" content="A bigger sample application for the ZKoss framework. Uses other frameworks like Spring, Spring-Security, Hibernate, JasperReports, Generic-Hibernate-DAO. Works with a H2 Database who is started and demo-data filled by applications deploy on a tomcat." ?>

<?meta name="keywords" content="Zk Sample, zksample2, ZKoss, ZK, RIA, Ajax, Framework, Ajax framework, Java, JSF, Open Source, Web Development, Web, forsthaus" ?>
<?meta name="keywords" lang="de" content="Zk Beispiel, zksample2, ZKoss, RIA, ZK, Ajax, Framework, Ajax framekwork, Java, JSF, Open Source, Web Entwicklung, forsthaus" ?>
<?meta name="keywords" lang="en-us" content="Zk Sample, zksample2, ZKoss, ZK, RIA, Ajax, Framework, Ajax framework, Java, JSF, Open Source, Web Development, Web, forsthaus" ?>
<?meta name="keywords" lang="en" content="Zk Sample, zksample2, ZKoss, ZK, RIA, Ajax, Framework, Ajax framework, Java, JSF, Open Source, Web Development, Web, forsthaus" ?>


<zk xmlns:h="http://www.zkoss.org/2005/zk/native"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:n="http://www.zkoss.org/2005/zk/native"
	xsi:schemaLocation="http://www.zkoss.org/2005/zul http://www.zkoss.org/2005/zul/zul.xsd">

	<h:html>
	<h:head>

		<!-- Template stylesheet -->
<?link href="../../css/blue/screen.css" rel="stylesheet" type="text/css" media="all"?>
<?link href="../../css/blue/datepicker.css" rel="stylesheet" type="text/css" media="all"?>
<?link href="../../css/tipsy.css" rel="stylesheet" type="text/css" media="all"?>
<?link href="../../js/visualize/visualize.css" rel="stylesheet" type="text/css" media="all"?>
<?link href="../../js/jwysiwyg/jquery.wysiwyg.css" rel="stylesheet" type="text/css" media="all"?>
<?link href="../../js/fancybox/jquery.fancybox-1.3.0.css" rel="stylesheet" type="text/css" media="all"?>
<!--[if IE]>
	<?link href="../../css/ie.css" rel="stylesheet" type="text/css" media="all">
	<script type="text/javascript" src="../../js/excanvas.js"></n:script>
	<meta http-equiv="X-UA-Compatible" content="IE=7" />
<!-->

<!-- Jquery and plugins -->
<n:script type="text/javascript" src="../../js/jquery.js"/>
<n:script type="text/javascript" src="../../js/jquery-ui.js"/>
<n:script type="text/javascript" src="../../js/jquery.img.preload.js"/>
<n:script type="text/javascript" src="../../js/hint.js"/>
<n:script type="text/javascript" src="../../js/visualize/jquery.visualize.js"/>
<n:script type="text/javascript" src="../../js/jwysiwyg/jquery.wysiwyg.js"/>
<n:script type="text/javascript" src="../../js/fancybox/jquery.fancybox-1.3.0.js"/>
<n:script type="text/javascript" src="../../js/jquery.tipsy.js"/>
<n:script type="text/javascript" src="../../js/custom_blue.js"/>
	</h:head>
	
	
	<h:body>
	
		<h:div class="content_wrapper">

			<!-- Begin header -->
			<h:div id="header">
				<h:div id="logo">
					<h:img src="../../images/logo.png" alt="logo" />
				</h:div>
				<h:div id="search">
					<h:form action="dashboard.html" id="search_form" name="search_form"
						method="get">
						<h:input type="text" id="q" name="q" title="Search"
							class="search noshadow" />
					</h:form>
				</h:div>
				<h:div id="account_info">
					<h:img src="../../images/icon_online.png" alt="Online" class="mid_align" />
			Hello <h:a href="">Admin</h:a> (<h:a href="">1 new message</h:a>) | <h:a
						href="">Setting</h:a> | <h:a href="">Logout</h:a>
				</h:div>
			</h:div>
			<h:a href="javascript:;" id="show_menu"></h:a>
			<h:div id="left_menu">
				<h:a href="javascript:;" id="hide_menu"></h:a>
				<h:ul id="main_menu">
					<h:li>
						<h:a href="login_blue.html">
							<h:img src="../../images/icon_home.png" alt="Home" />Home
						</h:a>
					</h:li>
					<h:li>
						<h:a id="menu_pages" href="">
							<h:img src="../../images/icon_pages.png" alt="Pages" />Pages</h:a>
						<h:ul>
							<h:li>
								<h:a href="">Add new Pages</h:a>
							</h:li>
							<h:li>
								<h:a href="">Edit Pages</h:a>
							</h:li>
						</h:ul>
					</h:li>
					<h:li>
						<h:a href="">
							<h:img src="../../images/icon_posts.png" alt="Posts" />Posts</h:a>
						<h:ul>
							<h:li>
								<h:a href="">Add new Post</h:a>
							</h:li>
							<h:li>
								<h:a href="">Edit Post</h:a>
							</h:li>
							<h:li>
								<h:a href="">Delete Post</h:a>
							</h:li>
						</h:ul>
					</h:li>
					<h:li>
						<h:a href="">
							<h:img src="../../images/icon_media.png" alt="Media" />Media</h:a>
						<h:ul>
							<h:li>
								<h:a href="">Add new Media</h:a>
							</h:li>
							<h:li>
								<h:a href="">Edit Media</h:a>
							</h:li>
							<h:li>
								<h:a href="">Delete Media</h:a>
							</h:li>
						</h:ul>
					</h:li>
					<h:li>
						<h:a href="">
							<h:img src="../../images/icon_users.png" alt="Users" />Users</h:a>
						<h:ul>
							<h:li>
								<h:a href="">Add new Users</h:a>
							</h:li>
							<h:li>
								<h:a href="">Edit Users</h:a>
							</h:li>
							<h:li>
								<h:a href="">Delete Users</h:a>
							</h:li>
						</h:ul>
					</h:li>
				</h:ul>
				<h:br class="clear" />
				<h:div id="calendar"></h:div>
			</h:div>
			<!-- Begin content -->
	<h:div id="content">
		<h:div class="inner">
			<h:h1>Dashboard</h:h1>
			
			<!-- Begin shortcut menu -->
			<h:ul id="shortcut">
    			<h:li>
    			  <h:a href="modal_window.html" id="shortcut_home" title="Click me to open modal window">
				    <h:img src="images/shortcut/home.png" alt="home"/><h:br/>
				    <h:strong>Home</h:strong>
				  </h:a>
				</h:li>
    			<h:li>
    			  <h:a href="modal_window.html" title="Click me to open modal window">
				    <h:img src="images/shortcut/calendar.png" alt="calendar"/><h:br/>
				    <h:strong>Calendar</h:strong>
				  </h:a>
				</h:li>
    			<h:li>
    			  <h:a href="modal_window.html" title="Click me to open modal window">
				    <h:img src="images/shortcut/stats.png" alt="stats"/><h:br/>
				    <h:strong>Stats</h:strong>
				  </h:a>
				</h:li>
				<h:li>
    			  <h:a href="modal_window.html" title="Click me to open modal window">
				    <h:img src="images/shortcut/setting.png" alt="setting"/><h:br/>
				    <h:strong>Setting</h:strong>
				  </h:a>
				</h:li>
				<h:li>
    			  <h:a href="modal_window.html" id="shortcut_contacts" title="Click me to open modal window">
				    <h:img src="images/shortcut/contacts.png" alt="contacts"/><h:br/>
				    <h:strong>Contacts</h:strong>
				  </h:a>
				</h:li>
				<h:li>
    			  <h:a href="modal_window.html" id="shortcut_posts" title="Click me to open modal window">
				    <h:img src="images/shortcut/posts.png" alt="posts"/><h:br/>
				    <h:strong>Posts</h:strong>
				  </h:a>
				</h:li>
  			</h:ul>
			<!-- End shortcut menu -->
			
			<!-- Begin shortcut notification -->
			<h:div id="shortcut_notifications">
				<h:span class="notification" rel="shortcut_home">10</h:span>
				<h:span class="notification" rel="shortcut_contacts">5</h:span>
				<h:span class="notification" rel="shortcut_posts">1</h:span>
			</h:div>
			<!-- End shortcut noficaton -->
			
			
			<h:br class="clear"/>
			
			
			<!-- Begin one column window -->
			<h:div class="onecolumn">
				<h:div class="header">
					<h:span>List data</h:span>
				</h:div>
				<h:br class="clear"/>
				<h:div class="content">
					<h:form id="form_data" name="form_data" action="" method="post">
						<h:table class="data" width="100%" cellpadding="0" cellspacing="0">
							<h:thead>
								<h:tr>
									<h:th style="width:10px">
										<h:input type="checkbox" id="check_all" name="check_all"/>
									</h:th>
									<h:th style="width:30%">Column 1</h:th>
									<h:th style="width:20%">Column 2</h:th>
									<h:th style="width:30%">Column 3</h:th>
									<h:th style="width:15%">Column 4</h:th>
								</h:tr>
							</h:thead>
							<h:tbody>
								<h:tr>
									<h:td>
										<h:input type="checkbox"/>
									</h:td>
									<h:td>Maecenas lacinia orci at neque</h:td>
									<h:td><h:a href="">Sit amet</h:a></h:td>
									<h:td>Consectetur adipiscing</h:td>
									<h:td>
										<h:a href=""><h:img src="images/icon_edit.png" alt="edit" class="help" title="Edit"/></h:a>
										<h:a href=""><h:img src="images/icon_delete.png" alt="delete" class="help" title="Delete"/></h:a>
									</h:td>
								</h:tr>
								<h:tr>
									<h:td>
										<h:input type="checkbox"/>
									</h:td>
									<h:td>Maecenas lacinia orci at neque</h:td>
									<h:td><h:a href="">Sit amet</h:a></h:td>
									<h:td>Consectetur adipiscing</h:td>
									<h:td>
										<h:a href=""><h:img src="images/icon_edit.png" alt="edit" class="help" title="Edit"/></h:a>
										<h:a href=""><h:img src="images/icon_delete.png" alt="delete" class="help" title="Delete"/></h:a>
									</h:td>
								</h:tr>
								<h:tr>
									<h:td>
										<h:input type="checkbox"/>
									</h:td>
									<h:td>Maecenas lacinia orci at neque</h:td>
									<h:td><h:a href="">Sit amet</h:a></h:td>
									<h:td>Consectetur adipiscing</h:td>
									<h:td>
										<h:a href=""><h:img src="images/icon_edit.png" alt="edit" class="help" title="Edit"/></h:a>
										<h:a href=""><h:img src="images/icon_delete.png" alt="delete" class="help" title="Delete"/></h:a>
									</h:td>
								</h:tr>
								<h:tr>
									<h:td>
										<h:input type="checkbox"/>
									</h:td>
									<h:td>Maecenas lacinia orci at neque</h:td>
									<h:td><h:a href="">Sit amet</h:a></h:td>
									<h:td>Consectetur adipiscing</h:td>
									<h:td>
										<h:a href=""><h:img src="images/icon_edit.png" alt="edit" class="help" title="Edit"/></h:a>
										<h:a href=""><h:img src="images/icon_delete.png" alt="delete" class="help" title="Delete"/></h:a>
									</h:td>
								</h:tr>
							</h:tbody>
						</h:table>
						<h:div id="chart_wrapper" class="chart_wrapper"></h:div>
					<!-- End bar chart table-->
					</h:form>
					
					<!-- Begin pagination -->
						<h:div class="pagination">
							<h:a href="#">«</h:a>
							<h:a href="#" class="active">1</h:a>
							<h:a href="#">2</h:a>
							<h:a href="#">3</h:a>
							<h:a href="#">4</h:a>
							<h:a href="#">5</h:a>
							<h:a href="#">6</h:a>
							<h:a href="#">»</h:a>
						</h:div>
					<!-- End pagination -->
					
				</h:div>
			</h:div>
			
			<h:br class="clear"/>

		</h:div>
		
		<h:br class="clear"/><h:br class="clear"/>
		<html><![CDATA[  
		
		<!-- Begin footer -->
		<h:div id="footer">
			© Copyright 2010 by Your Company
		</h:div>
		]]></html>
		<!-- End footer -->
		
		
	</h:div>
		</h:div>
	</h:body>
	
	</h:html>
</zk>

link publish delete flag offensive edit

answered 2010-07-25 12:10:32 +0800

iantsai gravatar image iantsai
2755 1

the html + body part is controlled ZK and native out put is just about the body content which should inside a desktop(a Div in implementation).

If you want to fully control the HTML output, you should use ZK JSP instead.
(Bt the way, I found ZK JSP + ZK Client side programming works fine together)

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2010-04-22 03:10:07 +0800

Seen: 1,137 times

Last updated: Jul 25 '10

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More