0

Zscript not working in JSP

asked 2009-05-21 13:22:30 +0800

ramyaguptha gravatar image ramyaguptha
27

Hi,

I am trying to integrate my jsp page with ZK. I have created the setup for zk using zkjsp-demo-0.9.0.zip(Runnable WAR file inside) setup. in my jsp page <zscript></zscript> is not getting executed onpage load, but it is executed when an event occurs in that page. for example I tried this code:
<%@ taglib uri="/WEB-INF/zul" prefix="zk" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ZK JSP Tag Library Demo</title>
</head>
<body>
<%
String myStr = "scriptlet String";
request.setAttribute("myStr",myStr);
%>
<zk:page>
<zk:label value="${myStr}"/>// OK!
<zk:zscript>
String str1 = "use " + requestScope.get("myStr")+ " in zscript.";// OK!
String str2 = "use " + myStr + " in zscript.";// will cause failure!
System.out.println("*********"+str1);
// Because ZK doesn't allow direct access to the request attributes.
</zk:zscript>
<zk:window>
<zk:button id="seatBtn" label="Upload">
<zk:attribute name="onClick">{



}</zk:attribute>
</zk:button>
</zk:window>
</zk:page>
</body>
</html>

The zscript is executed only when i click on the button.
Can you help me out.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2009-05-22 02:43:42 +0800

jumperchen gravatar image jumperchen
3909 2 8
http://jumperchen.blogspo... ZK Team

Hi,

I run your example, and work well.
Which ZK version are you using?

/Jumper

link publish delete flag offensive edit

answered 2009-05-22 05:26:24 +0800

ramyaguptha gravatar image ramyaguptha
27

Hi,
Thank you :)
I had been using ZK version 3.5.1. It is now working with 3.6.1.

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: 2009-05-21 13:22:30 +0800

Seen: 292 times

Last updated: May 22 '09

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