here it is again - this time as an attachment



-----Original Message-----
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 26, 2001 1:31 PM
To: Struts List
Subject: Re: problems with the logic:iterate tag


Could you submit your example as an attachment? In my mail reader at
least, some of the control characters were converted to ASCII, and it
is difficult to read. 

*********** REPLY SEPARATOR  ***********

On 1/26/2001 at 10:45 AM Florian Zwerina wrote:

Hi !

I have a problem with the <logic:iterate > tag

the following piece of 'code' works ok=20
(so I know I=B4m doing nothing wrong on the Controller/Model side):

<jsp:useBean id=3D"item" scope=3D"page" class=3D"com.mycomp.SomeData"/>

<table>
<%=09
        Iterator it =3D
((Collection)session.getAttribute("someList")).iterator();
        while (it.hasNext()){
                pageContext.setAttribute("item",it.next());
%>
  <tr>
    <td align=3D"left">
      <bean:write name=3D"item" property=3D"name"/>
    </td>
    <td align=3D"left">
      <bean:write name=3D"item" property=3D"manager"/>
    </td>
    <td align=3D"left">
      <bean:write name=3D"item" property=3D"ID"/>
    </td>
  </tr>
<% }  %>
</table>

but what I really like to do is
(our web designer would appreciate it !):

<jsp:useBean id=3D"item" scope=3D"page" class=3D"com.mycomp.SomeData"/>

<table>
<logic:iterate id=3D"item" name=3D"someList">
  <tr>
    <td align=3D"left">
      <bean:write name=3D"item" property=3D"name"/>
    </td>
    <td align=3D"left">
      <bean:write name=3D"item" property=3D"manager"/>
    </td>
  </tr>
</logic:iterate>

but with the second approach the table is always empty...

am I too stupid to use the iterate tag ?
or is something else wrong with my approach ?


pleas help !


Regards

flo



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/


I have a problem with the <logic:iterate > tag

the following piece of 'code' works ok
(therfore I know I am doing nothing wrong on the Controller/Model side):

<jsp:useBean id="item" scope="page" class="com.mycomp.SomeData"/>

<table>
<%
        Iterator it = ((Collection)session.getAttribute("someList")).iterator();
        while (it.hasNext()){
                pageContext.setAttribute("item",it.next());
%>
  <tr>
    <td align="left">
      <bean:write name="item" property="name"/>
    </td>
    <td align="left">
      <bean:write name="item" property="manager"/>
    </td>
    <td align="left">
      <bean:write name="item" property="ID"/>
    </td>
  </tr>
<% }  %>
</table>

but what I really like to do is the following
(our web designer would appreciate it !):

<jsp:useBean id="item" scope="page" class="com.mycomp.SomeData"/>

<table>
<logic:iterate id="item" name="someList">
  <tr>
    <td align="left">
      <bean:write name="item" property="name"/>
    </td>
    <td align="left">
      <bean:write name="item" property="manager"/>
    </td>
  </tr>
</logic:iterate>

but with the second approach the table is always empty...

am I too stupid to use the iterate tag ?
or is something else wrong with my approach ?


Reply via email to