You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Sean Rohead <SR...@webmiles.com> on 2001/06/19 20:07:45 UTC

Another suggestion for DBTags

I like the tags for getting data from a result set (getColumn, getDate,
etc...), but it doesn't seem like these tags should be doing any formatting.
Rather, a set of general purpose tags for formatting dates and numbers need
to be written and these tags can enclose the result of getDate.  There are
lots of cases where I want to format dates and numbers and putting this
functionality in the dbtags means that functionality is *only* available
when iterating over result sets -- bad.  I'm thinking of something like:

<sql:resultSet id="results">
  <format:date style="SHORT"><sql:getDate position="1"/></format:date>
</sql:resultSet>

instead of

<sql:resultSet id="results">
  <sql:getDate format="SHORT" position="1"/>
</sql:resultSet>


Yes, it's more verbose, but far more flexible.

Re: Another suggestion for DBTags

Posted by Morgan Delagrange <mo...@apache.org>.
Sounds like a suggestion for another tag library, not for DBTags.  :)

On Tue, 19 Jun 2001, Sean Rohead wrote:

> I like the tags for getting data from a result set (getColumn, getDate,
> etc...), but it doesn't seem like these tags should be doing any formatting.
> Rather, a set of general purpose tags for formatting dates and numbers need
> to be written and these tags can enclose the result of getDate.  There are
> lots of cases where I want to format dates and numbers and putting this
> functionality in the dbtags means that functionality is *only* available
> when iterating over result sets -- bad.  I'm thinking of something like:
> 
> <sql:resultSet id="results">
>   <format:date style="SHORT"><sql:getDate position="1"/></format:date>
> </sql:resultSet>
> 
> instead of
> 
> <sql:resultSet id="results">
>   <sql:getDate format="SHORT" position="1"/>
> </sql:resultSet>
> 
> 
> Yes, it's more verbose, but far more flexible.
>