0

jsp include zk error

asked 2011-09-05 01:39:14 +0800

zhongji gravatar image zhongji
30

I don't know why that different:

c.zul:

<zk>
	<combobox id="focusPosition" height="21px" width="185px" mold="rounded" value="A2">
		<comboitem id="lbpos" label="A1" />
	</combobox>
</zk>

c.jsp:

<jsp:include page="./c.zul"/>

but c.jsp add :<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
it's ok ?

delete flag offensive retag edit

6 Replies

Sort by » oldest newest

answered 2011-09-05 22:56:30 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

hi, zhongji
I run you sample code without errors. What's your error message?

<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Insert title here</title>
</head>
<body>
A parent page which include a zul
<jsp:include page="./inner.zul"/>
</body>
</html>

link publish delete flag offensive edit

answered 2011-09-06 01:48:40 +0800

zhongji gravatar image zhongji
30

Thank you for your reply

Maybe I don't have description is clear

in zul file contain a combobox

if jsp file not include:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
the combobox look like not normal , that set height property

if jsp file include:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
the combobox normal

but , if zul is:

<zk>
	<zssapp width="100%" height="100%" src="/xls/zl002.xls"></zssapp>
</zk>

and jsp file include:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
then it only show the spreadsheet menubar, other part can not display. maybe not set height

link publish delete flag offensive edit

answered 2011-09-06 02:10:17 +0800

zhongji gravatar image zhongji
30

updated 2011-09-06 02:11:06 +0800

用中文说一下吧,也许你你能看明白
如果zul文件里是一个combobox,则在jsp中如果不加"<!DOCTYPE..",则combobox显示有问题,似乎是没有设置height属性
但如果加了"<!DOCTYPE.."则显示正常。

但如果zul是

<zk>
	<zssapp width="100%" height="100%" src="/xls/zl002.xls"></zssapp>
</zk>

zk spreadsheet里的例子
然后在jsp中include这个zul文件
问题就是,如果不加"<!DOCTYPE..",其他部分显示正常,但combobox显示不正常
如果加了"<!DOCTYPE..",则combobox显示正常,但是只有菜单栏和工具栏显示了,其他部分都不显示,看着好像也是height没有设置

谢谢帮助

link publish delete flag offensive edit

answered 2011-09-06 07:58:25 +0800

gaoylei gravatar image gaoylei
6

OMG,终于看到个用中文的

link publish delete flag offensive edit

answered 2011-09-06 21:42:30 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

hi, zhongji
We should always add <!DOCTYPE> in html page. Without it, browsers might render pages as not what you expected.
ref:
http://www.alistapart.com/articles/doctype/
http://www.w3.org/QA/Tips/Doctype

<zk>
	<zssapp width="100%" height="100%" src="/xls/zl002.xls"></zssapp>
</zk>

because zssapp's height is 100%, its height depends on its container size which might be specified in outer jsp. But jsp doesn't specify it, so it'll depend on browser's rendering.

I recommend you modify the height to a fixed number, ex: height="500px",and that will solve the problem.

link publish delete flag offensive edit

answered 2011-09-06 23:28:16 +0800

zhongji gravatar image zhongji
30

hawk, thanks you very much
it's ok

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: 2011-09-05 01:39:14 +0800

Seen: 331 times

Last updated: Sep 06 '11

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