Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

No collection found

 
utkarsh sinha
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic