File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes No collection found Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "No collection found" Watch "No collection found" New topic

No collection found

utkarsh sinha

Joined: Oct 12, 2007
Posts: 5
How to populate the bean form with the dynamic content???

I used indexed properties with lazy initialization, lists in a form bean "question 6 of this forum's FAQ"

Well i tried to run the code given by Brent Sterling at "question 6 of this forum's FAQ"

but there is an error and i am not able to run the application:
javax.servlet.jsp.JspException: No collection found

jsp page is:

<logic:iterate id="orderItem" name="OrderIndexedForm" property="orderList">
<html:hidden name="orderItem" property="productId" indexed="true" />

<form-bean name="OrderIndexedForm" type="OrderIndexedForm" /> is
public class OrderItem
private String productId;
private String productName;
private String quantity;
public OrderItem() {
// TODO Auto-generated constructor stub
this.productId = productId;
this.productName = productName;
this.quantity = quantity;
}++++++++Getters and Setters+++++
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This error is telling you that the orderList property of the OrderForm bean is null. It should have a list of items. Go through the example again, and make sure your code exactly matches the example, including the creation of the IndexedBusinessLayer object.

Consultant, Sima Solutions
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948 is not clear to me what would cause your error. Are you using an action like DisplayOrderIndexedAction to display the page? This is where orderList is populated. If you cannot get it running, send me a message and I can try to get you the source code...though looking at the FAQ entry it seems that about all that is missing are the include and package declarations from the Java files and the innards of the bean OrderItem.

- Brent
I agree. Here's the link:
subject: No collection found
It's not a secret anymore!