jsp and zul forEach

asked 2007-09-04 22:32:59 +0800

admin gravatar image admin
18691 1 10 129
ZK Team

Orignial message at:

By: y0gie


I've tried to iterate thru List of items...I've browsed thru old topics of same problems (replacing $ with #..36..,#..24.. or something like that) but it doesn't work. Am i missing something ?

Thank for your help

Here is the error i get:

java.lang.NoSuchMethodException: class org.zkoss.zul.Listitem: name=forEach args=[null]

Here is my code:

<%@ page language="java" contentType="text/html; charset=UTF-8"
<%@ taglib uri="/WEB-INF/zul" prefix="zk"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" href="/Partner/css/style.css" type="text/css" /> <title>ZK JSP Tag Library Demo</title> </head> <body> <div id="container"> <div id="header"> <h1><s:text name="naslov" /></h1> </div> <div id="wrapper"> <div id="content">

<zk:page zscriptLanguage="java">

<!-- ZUML -->
<zk:window border="normal" >
import si.tusek.jdbc.PartnerDAO;
import java.util.ArrayList;
import si.tusek.partner.PartnerVO;

UserVO vo = (UserVO)session.getAttribute("user");
PartnerDAO dao = new PartnerDAO();
List all = dao.getAllZul(vo.getId());
<zk:listbox id="box" multiple="true" rows="4">
<zk:listheader label="Title" />
<zk:listheader label="Email" />
<zk:listheader label="Phone"/>
<zk:listheader label="Something" />
<zk:listheader label="Else" />
<zk:listitem forEach="${all}" value="${each}" >
<zk:listcell label="${each.title}"></zk:listcell>
<zk:listcell label="${each.email}"></zk:listcell>
<zk:listcell label="${each.phone}"></zk:listcell>
<zk:listcell label="${each.something}"></zk:listcell>
<zk:listcell label="${each.else}"></zk:listcell>

<s:include value="/secure/navigation.jsp" /> <s:include value="/secure/footer.jsp" /></div> </body> </html>

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2007-09-10 03:43:48 +0800

admin gravatar image admin
18691 1 10 129
ZK Team

Orignial message at:

By: zanyking

EL -Expression will be evaluated by JSP Container not ZK, and we are not implemented ZK EL in ZK JSP Tag Lib currently.

In your case, you can simply use JSTL's foreach to accomplish your work.

You can download the sample code in:


link publish delete flag offensive edit

answered 2012-06-26 05:37:33 +0800

b24e gravatar image b24e

i want to zk tag with struts please suggestion me

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




Asked: 2007-09-04 22:32:59 +0800

Seen: 722 times

Last updated: Jun 26 '12

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