Vic Cekvenich wrote:
> How do I get a row count or an enumeration of a JDBC Result set?
> (I want to retrieve a few rows and display them and iterate, for which I
> need an enumeration)

You should really check the Sun site for documentation regarding the
ResultSet. 

AFAIK, it does not generate an enumeration on its own.

I've done something similar using ArrayLists and reflection. 

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg14397.html


> Do I populate FormBean that has the resultset set in perform() of Action
> and then set it as a session?

This would be a design decision, so there won't be any one "right"
answer.

Personally, I use a helper class that is called from perform() and that
returns a collection of JavaBeans, where each bean represents a row in
the resultset, and send that through the request. 


> How do I use Struts with Cocoon best?

There have been a few posts regarding this  (http://mail-archive.com),
but I don't believe there's been a definative answer. 

Personally, I would consider transforming the XML into a bean, using
something like the Commons-Digester, and then pass that to the view in
the request. This would give you the full benefit of existing custom
tags, and the opportunity to use the bean with other platforms (WAP,
Swing, et al). 

There's a good example of doing this in the RSS directory, where it
reads a Rich Site Summary XML file and convert it into a Channel bean,
with a nested array of items. Sweet.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/about/struts/

Reply via email to