[opencms-dev] JavaBean with ArrayList in openCMS

Arthur Visser arthur.visser at student.groept.be
Thu Apr 21 20:08:10 CEST 2005


I have made an application in OpenCms using a JavaBean.

In principle the Bean works fine and I can pass variables
between the bean and my jsp using setProperty and
getProperty commands.

However, I now expanded the bean with an ArrayList :

 

Public ArrayList getResults()   {

...

..

Return Results;

}

 

The Arraylist is filled with variables via a JDBC
connection, but this seems to be working fine.

 

The problem I now have is that I do not succeed to get the
full ArrayList into my jsp to read the values.

I tried various ways, one of which is partly copied below  :

 

<jsp:useBean id="gebruik"

class="com.opencms.beans.MyWeight" scope="session">

     <jsp:setProperty name="gebruik" property="*" />

<jsp:setProperty name="gebruik" property="lidid" value="<%=
lidid %>" />

</jsp:useBean>

 

<br>Aantal:<jsp:getProperty name="gebruik"
property="rowCount"/>

<table><tr>

<%

weightList =%><jsp:getProperty name="gebruik"
property="results"/><%;

Iterator it = weightList.iterator();

while (it.hasNext()) {

}

 

%>

 

</tr></table>

 

'rowCount' is displayed , no problem. 

I do not succeed to get my ArrayList 'results' and iterate
through it. Anybody has a suggestion or a piece of code that
works?

 

Thanks!

 

 

Arthur Visser

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050421/cad15354/attachment.htm>


More information about the opencms-dev mailing list