You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "V. Cekvenich" <vc...@basebeans.com> on 2002/12/10 14:59:50 UTC

Re: JSTL x STRUTS bean display

In a secret place: http://jakarta.apache.org/struts/resources

you can find a link to this (www.basicPortal.com)
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/basicportal_07/portlets/proj/TasksLstPortlet.jsp?rev=1.4&content-type=text/vnd.viewcvs-markup

Here is another hiden place, where you can find that this was already 
answered like 4 times:
http://www.mail-archive.com/struts-user%40jakarta.apache.org/

.V

ps: (new e-mail is vc at baseBeans.com, not vic@baseBeans.com)



Joao Araujo wrote:
> 
>> >
>> >
>> >  I have a arraylist  containing a collection of beans, something like
>> >  :
>> >  List list = new ArrayList ();
>> >
>> >
>> >  list.add(bean1_1);
>> >  list.add(bean1_2);
>> >
>> >  request.setAttribute ("BEAN1_LIST",  list);
>>
>> <c:forEach var="item" items="${requestScope.BEAN1_LIST}">
>>  <c:out value="${item.Field1}"/>
>>  <c:out value="${item.Field2}"/>
>> </c:forEach>
> 
> 
>         This does not work. I tried this before.
>         Has to be something else.
> 
> Joao,
> 
>> -- 
>> To unsubscribe, e-mail:   
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail: 
>> <ma...@jakarta.apache.org>
> 




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL x STRUTS bean display

Posted by Kris Schneider <kr...@dotech.com>.
Not quite sure I understand why the basicPortal link is a good example of
looping. Here's the (reformatted) snippet:

<c:forEach var="row" items="${requestScope.formBean}">
  <tr>
    <td><li><c:out value="${requestScope.formBean.taskName}"/></td>
    <td>
      <c:url value="/do/port/tasks" var="url">
        <c:param name="ID" value="${requestScope.formBean.id}"/>
      </c:url>
      <a href ='<c:out value="${url}"/>'>
        <c:out value="${requestScope.formBean.shortCode}"/>
      </a>
    </td>
    <td><c:out value="${requestScope.formBean.taskType}"/></td>
    <td><c:out value="${requestScope.formBean.responsibleMail}"/></td>
  </tr>
</c:forEach>

Shouldn't all the requestScope.formBean references within the loop get changed
to row? Obviously, this page is taken out of context from the entire app, so
maybe I'm missing something...

Quoting "V. Cekvenich" <vc...@basebeans.com>:

> In a secret place: http://jakarta.apache.org/struts/resources
> 
> you can find a link to this (www.basicPortal.com)
>
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/basicportal_07/portlets/proj/TasksLstPortlet.jsp?rev=1.4&content-type=text/vnd.viewcvs-markup
> 
> Here is another hiden place, where you can find that this was already 
> answered like 4 times:
> http://www.mail-archive.com/struts-user%40jakarta.apache.org/
> 
> .V
> 
> ps: (new e-mail is vc at baseBeans.com, not vic@baseBeans.com)
> 
> 
> 
> Joao Araujo wrote:
> > 
> >> >
> >> >
> >> >  I have a arraylist  containing a collection of beans, something like
> >> >  :
> >> >  List list = new ArrayList ();
> >> >
> >> >
> >> >  list.add(bean1_1);
> >> >  list.add(bean1_2);
> >> >
> >> >  request.setAttribute ("BEAN1_LIST",  list);
> >>
> >> <c:forEach var="item" items="${requestScope.BEAN1_LIST}">
> >>  <c:out value="${item.Field1}"/>
> >>  <c:out value="${item.Field2}"/>
> >> </c:forEach>
> > 
> > 
> >         This does not work. I tried this before.
> >         Has to be something else.
> > 
> > Joao,
> > 
> >> -- 
> >> To unsubscribe, e-mail:   
> >> <ma...@jakarta.apache.org>
> >> For additional commands, e-mail: 
> >> <ma...@jakarta.apache.org>
> > 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSTL x STRUTS bean display

Posted by Kris Schneider <kr...@dotech.com>.
Try changing:

<c:out value="${item.Field1}"/> -> <c:out value="${item.field1}"/>

and:

<c:out value="${item.Field2}"/> -> <c:out value="${item.field2}"/>

Quoting "V. Cekvenich" <vc...@basebeans.com>:

> In a secret place: http://jakarta.apache.org/struts/resources
> 
> you can find a link to this (www.basicPortal.com)
>
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/basicportal_07/portlets/proj/TasksLstPortlet.jsp?rev=1.4&content-type=text/vnd.viewcvs-markup
> 
> Here is another hiden place, where you can find that this was already 
> answered like 4 times:
> http://www.mail-archive.com/struts-user%40jakarta.apache.org/
> 
> .V
> 
> ps: (new e-mail is vc at baseBeans.com, not vic@baseBeans.com)
> 
> 
> 
> Joao Araujo wrote:
> > 
> >> >
> >> >
> >> >  I have a arraylist  containing a collection of beans, something like
> >> >  :
> >> >  List list = new ArrayList ();
> >> >
> >> >
> >> >  list.add(bean1_1);
> >> >  list.add(bean1_2);
> >> >
> >> >  request.setAttribute ("BEAN1_LIST",  list);
> >>
> >> <c:forEach var="item" items="${requestScope.BEAN1_LIST}">
> >>  <c:out value="${item.Field1}"/>
> >>  <c:out value="${item.Field2}"/>
> >> </c:forEach>
> > 
> > 
> >         This does not work. I tried this before.
> >         Has to be something else.
> > 
> > Joao,
> > 
> >> -- 
> >> To unsubscribe, e-mail:   
> >> <ma...@jakarta.apache.org>
> >> For additional commands, e-mail: 
> >> <ma...@jakarta.apache.org>
> > 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>