Now that I've started to use the RowSet version of the dbTag ResultSet
tags, I'm finding them very useful. It starts out like the
logic:iterator/bean:write duo, but offers several other useful options:
* A loop property, to display one column and stop.
* A colName property to retrieve the value by column name.
* Speciality accessors for numeric and date columns, with useful
transformation switches.
I've updated the taglib Bill Pfeiffer started so that it can take the
name and property parameters like the Struts tags. The JAR, with source,
is up on More About Struts now.
< http://husted.com/about/struts/rowsettags.htm >
The usage is quite simple.
* From your action, insert the RowSet into the request context, either
on its own or as a property of another object.
* In your JSP, start out with something like
<db:rowSet id="row" name="result" property="rows.values">
where you would use the Struts iterator.
* To expose column values, use
<db:getColumn colName="contact"/>
* To transfer a column to a scripting value, to use with bean or logic
tags, use
<db:getColumn colName="contact" to="CONTACT"/>
See the Jakarta Tablibs dbTag documentation for more. It works the same
as the ResultSet tag, but with a given RowSet.
I also have an update to the RowSet iterator class (ValueIterator) up
too. This one includes generic toMap() and Set(map) methods for
transfering data to and from the RowSet. It uses MetaData and so can be
used with any RowSet without subclassing.
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/