0

How to embed gwt page into zul?

asked 2013-11-05 16:36:16 +0800

bratislav1983 gravatar image bratislav1983
54 1

updated 2013-11-07 02:38:30 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

I have created a simple GWT HTML page that looks like this :

<html>

<head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> <title>Title</title> <link rel="stylesheet" type="text/css" href="css/common.css"/> <script type="text/javascript" src="search/search.nocache.js"></script> </head>

<body>

<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0">
</iframe>

<noscript>
    <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
        Your web browser must have JavaScript enabled in order for this
        application to display correctly.</div>
</noscript>
...
<div class="main">
...
</div>
</body>

</html>

Now I want to convert this page into zul. I've changed the extension into zul and added namespace declarations in the <html> and tag like this :

<html xmlns="native" xmlns:zul="zul" xmlns:h="xhtml"> ... </html>

That works ok, but there's one small catch : whenever I want to load this zul, I have to refresh it manually (by hitting F5) in order for GWT part to start working. Chrome console will throw one error stating that search.nocache.js cannot be found (for some reason). When I refresh, everything is ok. I've also seen that jsessionid= is appended to nocache.js at the end, after ";", not sure if that's causing trouble or something else.

The reason why I embedded gwt into zul is because my web app was written in zk and I want to utilize gwt app and zk sessions.

Am I missing something here? Is there a better approach?

Please help.

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2013-11-06 01:41:18 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

Not sure why. you can try loading your gwt script using <script defer="true" src="whatever.js">

link publish delete flag offensive edit

answered 2013-11-06 10:35:31 +0800

bratislav1983 gravatar image bratislav1983
54 1

updated 2013-11-06 10:36:21 +0800

Hey thanx for answering.

I doesn't work. I've tried putting it in <head> and <body> and gwt part simply won't load.

The only way I've managed it to get working is to use <?script ... ?> tag, but then again F5 needs to be pressed to load gwt part.

Any more ideas?

link publish delete flag offensive edit

answered 2013-11-07 02:42:27 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

What are you trying to achieve? Use GWT components in zul page?

link publish delete flag offensive edit

answered 2013-11-07 10:15:29 +0800

bratislav1983 gravatar image bratislav1983
54 1

No..I have complex javascript calculations and I'm bad at javascipt..that's why I decided to use gwt since everything can be written in the plain-old java. On the other side, webapp iz written in zk, so I have to figure out how to combine those two.

It seems like sessions are problem here : if I already have a session (session cookie) in the browser, my zk+gwt app loads fine. The problem is only when you delete browser history/cache it needs F5 to start working, not sure why.

Better approach would probably be to utilize client-side programming in zk and to discard gwt completely, but as I said, I'm bad at javascript.

link publish delete flag offensive edit

answered 2013-11-07 10:22:04 +0800

bratislav1983 gravatar image bratislav1983
54 1

updated 2013-11-07 10:22:55 +0800

Ahh yes, all widgets on the page are zk widgets, so no gwt widgets at all (they are very primitive anyway).

And one more thing..the problem with nocache.js not being found was Jetty : it tends to append ;jsessionid at the end, but I solved this by disabling cookieless sessions (url rewriting). Problem with F5 unfortunately still exists.

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
1 follower

RSS

Stats

Asked: 2013-11-05 16:36:16 +0800

Seen: 43 times

Last updated: Mar 29 '17

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