• Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynabeans Problems

 
Paul Mihai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok.. here is the problem:

I try capturing a resultset in a RowSetDynaClass but for some reason after doing this my iterator won't work and I get this exception:

javax.servlet.ServletException: Cannot create iterator for this collection

the collection I send is the RowSetDynaClass resulted from a sql querry.

here is the jsp for this:

and here is the code snippet out of the action class:


The source compiles and everything is ok if I set the bean for the iterator manually(and use a helper bean which I load the data into) the only problem is that when I try to pass on the dynabean it throws an exception.

I would like to know if I'm doing something wrong or have missunderstood something or just missed something.

Best regards

Paul
 
Paul Mihai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I see, there is nobody to know about the problem I have submitted some days ago.
I realise that my problem isn't a common one (or so it seems), all I wanted is to know the precise use of the org.apache.commons.beanutils.RowSetDynaClass

I figured out that I can use a simple dynabean and create my RowSetDynaClass myself (or one that looks like it).

I will test it today but the main idea is to make a class that extends the Collection

I will update this topic myself as I advance in this mather

Paul
 
Hafizur Rahman
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://struts.apache.org/userGuide/struts-logic.html#iterate
http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanutils/RowSetDynaClass.html

Please check the above documents.

Hope u get some light.
 
Paul Mihai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I had just to catch the rows
 
Paul Mihai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for everybody who's interested here's a excerp of what I finally did
I havn't added any special exceptions but I'm planing to



And after this I used :


Which is really nice and doesn't inflate the code where I only need one connection.

Ok I hope it helps some other clueless people like me

Paul
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!