For Programmers: Free Programming Magazines  


Home > Archive > Java Beans > January 2006 > New Problem Struts iterate Tag ArrayList with Beans









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author New Problem Struts iterate Tag ArrayList with Beans
SendMeAMail

2005-11-12, 6:58 pm

Hi,
after solving the last i get immediately the next problem.

In the Struts Action i create a new Bean.

Product

After getting Database Data I fill this Bean with the setter Methode in the
while ResultSet .next loop {}
After filling the Bean i put the Bean in an Arraylist (Products) this
Arraylist Products comes in the request and on the View I will get the Data
with

<logic:iterate id="products" name="products" scope="request">

<bean:write name="products" property="Productnr" />

<bean:write name="products" property="Productname" />

<bean:write name="products" property="Productdescription"/>

</logic:iterate>

Now the error now getter Method for Productnr .....

What is wrong? Canīt i put an Arraylist in the request for iterate the bean?
I think i dont know the princip!

Or I need to make Bean who has an ArrayList?

Please help!



SendMeAMail

2005-11-12, 6:58 pm

I have try the follow

<logic:iterate id="Product" name="products" scope="request">

<bean:write name="Product" property="Productnr" />

<bean:write name="Product" property="Productname" />

<bean:write name="Product" property="Productdescription"/>

</logic:iterate>

the Bean Product has the the follow getter Methods getProductnr()
getProductname() getProductdescription() but i get the follow error :

No getter method for property Productname of bean Product ???

Why? Do you have an answer?




"SendMeAMail" <SendMeAMail@gmx.info> schrieb im Newsbeitrag
news:dl58mu$s79$1@news01.versatel.de...
> Hi,
> after solving the last i get immediately the next problem.
>
> In the Struts Action i create a new Bean.
>
> Product
>
> After getting Database Data I fill this Bean with the setter Methode in
> the while ResultSet .next loop {}
> After filling the Bean i put the Bean in an Arraylist (Products) this
> Arraylist Products comes in the request and on the View I will get the
> Data with
>
> <logic:iterate id="products" name="products" scope="request">
>
> <bean:write name="products" property="Productnr" />
>
> <bean:write name="products" property="Productname" />
>
> <bean:write name="products" property="Productdescription"/>
>
> </logic:iterate>
>
> Now the error now getter Method for Productnr .....
>
> What is wrong? Canīt i put an Arraylist in the request for iterate the
> bean?
> I think i dont know the princip!
>
> Or I need to make Bean who has an ArrayList?
>
> Please help!
>
>
>



SendMeAMail

2005-11-12, 6:58 pm

Or is the name only a synony for products ???
If Yes, how can I get the Beans and their Propertys from the ArrayList
products?


"SendMeAMail" <SendMeAMail@gmx.info> schrieb im Newsbeitrag
news:dl59k5$sot$1@news01.versatel.de...
>I have try the follow
>
> <logic:iterate id="Product" name="products" scope="request">
>
> <bean:write name="Product" property="Productnr" />
>
> <bean:write name="Product" property="Productname" />
>
> <bean:write name="Product" property="Productdescription"/>
>
> </logic:iterate>
>
> the Bean Product has the the follow getter Methods getProductnr()
> getProductname() getProductdescription() but i get the follow error :
>
> No getter method for property Productname of bean Product ???
>
> Why? Do you have an answer?
>
>
>
>
> "SendMeAMail" <SendMeAMail@gmx.info> schrieb im Newsbeitrag
> news:dl58mu$s79$1@news01.versatel.de...
>
>



afifa_hab

2006-01-24, 4:02 am

try
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com