struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Husted <hus...@apache.org>
Subject Re: Struts 1.1 To-Do - RowSets
Date Sun, 08 Jul 2001 00:49:34 GMT
So now that I've spent some quality time with it, I've finding that Bill
Pfeiffer's rowSet tag plays well with the Struts tags. 

< http://husted.com/about/struts/rowsettags.htm >

I had to make a modification so that it would work with request scope
(rather than page scope), but it's doing the job. I've pinged Bill, and
I think we'll clean this up and see if Morgan wants to add it to dbTags. 

The standard dbTag requestSet tag expects to be enclosed within a
statement tag and makes the retrieval for you. Bill's version expects to
find a RowSet instead. Right now, the attribute name is hardwired, but
I'll see about making a runtime property. 

Here's what I was using with straight Struts, and then with the rowSet
tag. In the first case, I'm going through accessors that I wrapped
around the RowSet by hand. In the second case, I'm dealing directly with
the RowSet. 

<logic:iterate name="result" property="rows" id="row">
 <tr>
    <td>
      <html:link forward="donor" paramName="row" paramId="key"
paramProperty="donor">
        <bean:write name="row" property="donor" filter="true"/>
      </html:link> 
    </td>
    <td>
        <bean:write name="row" property="sortName" filter="true"/>
    </td>
    <td nowrap>
      <bean:write name="row" property="telephone" filter="true"/>
    </td>
    <td nowrap>
       <font size="1"><a href="mailto:<bean:write name="row"
property="email"/>"><bean:write name="row" property="email"
filter="true"/></a></font>
    </td>
    <td>
       <font size="1"><a href="http://<bean:write name="row"
property="website"/>" target="_blank"><bean:write name="row"
property="website" filter="true"/></a></font>
    </td>
  </tr>
</logic:iterate>


<db:rowSet id="row">
<tr>
    <td>
	<db:getColumn colName="donor" to="DONOR"/>
      <html:link forward="donor" paramName="DONOR" paramId="key">
        <db:getColumn colName="donor"/>      
      </html:link>     
    </td>
    <td>
        <db:getColumn colName="sortName"/>      
    </td>
    <td nowrap>
        <db:getColumn colName="telephone"/>      
    </td>
    <td nowrap>
	<db:getColumn colName="email" to="EMAIL"/>
	<font size="1"><a href="mailto:<bean:write name="EMAIL"/>"><bean:write
name="EMAIL" filter="true"/></a></font>
    </td>
    <td>
	<db:getColumn colName="website" to="WEBSITE"/>
	<font size="1"><a href="http://<bean:write
name="WEBSITE"/>"><bean:write name="WEBSITE" filter="true"/></a></font>
    </td>
  </tr>
</db:rowSet>

Note that here I've modified Bill's original source to use ROWSET for
the attribute name in request scope. 

I'll see about getting this cleaned up and added to dbTags and then
document using it with Struts, along with using the rest of the taglib
with the Generic connection pool.

-Ted.

Mime
View raw message