struts No Collection Found
I am getting this error:"javax.servlet.ServletException: No collection found
I have been googling for the answer and nothing helps. I do what they say but there seem to be a lot of unanswered questions about this.
Here are the details. The list has 4 elements in it.
//jsp looks like this
<logic:iterate name="protocolListForm" property="protocols" id="protocol">
list will be here
//Action looks like this
//Form looks like this
System.out.println("Size of list is " + results.size());
ProtocolListForm pForm = new ProtocolListForm(results);
private List<CollectionProtocol> protocols = null;
public ProtocolListForm(List <CollectionProtocol>results)
public List getProtocols()
public void setProtocols(List <CollectionProtocol>protocols)
this.protocols = protocols;
programmer should know where to look
Originally Posted by pegitha
I have encountered the same problem. The reason was I have included the same form bean as a bean in jsp with the same name.
As I guess the reason is the bean you defined in jsp, which have no collections assigned, is used instead of the one that is filled in Action class.
Remove the bean declaration or rename it, so it should work.
Java is the best for enterprise development!