0

JSP lost padding when using jsp:include to include a zul file

asked 2008-08-14 13:09:30 +0800

wilsonlo gravatar image wilsonlo
57

Hi, I am encountering a problem where JSP lost padding when a zul file was included using jsp:include. Here is a sample code for the problem:

<%@ page language="java" contentType="text/html; charset=iso-8859-1"
pageEncoding="UTF8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Insert title here</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style></head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="118" align="center" valign="top" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="70" align="center" valign="top" background="topmenubg-1.gif">
<jsp:include page="test.zul"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

test.zul
----------
<?xml version="1.0" encoding="UTF-8"?>
<window title="More Menu Demo" border="normal">
</window>

the table displayed at full width of the browser when jsp:include was removed. I am using ZK 3.0.5. The gif file is a one pixel width picture.

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2008-08-19 07:45:22 +0800

wilsonlo gravatar image wilsonlo
57

hi, it seems that it is a problem in ZK norm.css.dsp, the body setting overridden in JSP by ZK.
Do you think this is something that can be fixed soon?

link publish delete flag offensive edit

answered 2008-08-20 03:57:21 +0800

zanyking gravatar image zanyking
99

How about set <body style="margin:0"> in your JSP?

Or, you can set org.zkoss.zul.theme.browserDefault in your zk.xml(there's an example in zkdemo's zk.xml).
this feature is ready since 3.0.6.

link publish delete flag offensive edit

answered 2008-08-21 03:40:25 +0800

wilsonlo gravatar image wilsonlo
57

Hi, zanyking,
Thank you for reply. Setting <body style="margin:0"> does not have the effect ask the jsp:include is within the <body></body> which I believe the body setting in zk will override jsp page. I have not yet upgrade to 3.0.6. I will give it a try when I have got the chance to do so.
Do you think this problem should be reported as bug?

link publish delete flag offensive edit

answered 2008-08-22 05:22:32 +0800

wilsonlo gravatar image wilsonlo
57

I got the problem solved by reloading body css after ZK is initiated, this way it will overwrite the body setting again.
I am not sure if body setting should be used within ZK machine, but I think it shouldn't override application setting. The setting should be left to the application itself.

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: 2008-08-14 13:09:30 +0800

Seen: 346 times

Last updated: Aug 22 '08

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