aspose file tools*
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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "No collection found" Watch "No collection found" New topic
Author

No collection found

utkarsh sinha
Greenhorn

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
org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:281)
org.apache.jsp.order_005findexed_jsp._jspService(order_005findexed_jsp.java:104)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

jsp page is:

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

struts-config.xml
<form-bean name="OrderIndexedForm" type="OrderIndexedForm" />
OrderItem.java is
public class OrderItem
{
private String productId;
private String productName;
private String quantity;
public OrderItem() {
super();
// 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.


Merrill
Consultant, Sima Solutions
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
Hmmm...it 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: http://aspose.com/file-tools
 
subject: No collection found