jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Hill <ed-h...@uiowa.edu>
Subject Re: Submission... <display:table...> tag library
Date Tue, 08 Jan 2002 03:19:27 GMT
Gervase, thanks for your feedback - I took at look at the site you
referenced, and my comments are inline below...


> Ed, This is an intriguing concept. I am still a little confused about
> where the data comes from. You mention a key tag called table, but I am
> not sure how you would use it. For example, how would you use it with a
> JDBC resultset? How do you populate the Collections?

The tag design is heavily influenced by struts and other MVC design
patterns.  I assume that your Controller (or in a typical Model I design,
your Bean) has taken the actions need to load up a list of object's.  That
List would typically contain value objects of some type (Users, Cars, Fruit,
etc...), and then the Controller places the list in some scope (page,
request, session, etc...).

You then tell the table tag where you placed the list via the "name"
attribute.  The table tag then iterates over the list and uses reflection to
call various getXXX() methods on the value objects in the list to draw each
row/column.

So there is a clean seperation between the View and the Model.  The table
tag is nothing more then a view, it expects some other part of your
application to load and setup the model (the list of data).


> If you have an opportunity, please check out a somewhat similar tag I
> have developed. It's a little different from your in that I was trying
> to do two things:
>
>  - allow a non JDBC aware JSP coder to connect a ResultSet to an HTML
> table. I keep a sqlKey property in the tag which can either contain the
> SQL or (better) allow it to be maintained in the web.xml

I didn't want the table tag to be JDBC specific.  In my opinion by doing
that there was two problems 1) the view knew too many details about the
model and 2) I wanted it to be more generic and work with any List of any
Objects.  The reality is that we do our best to never expose JDBC specific
stuff in our JSP pages, we use DAO patterns to create value objects, and
have the DAO isolate the SQL.  I would be in the camp that doesn't think sql
based taglibs are a good idea (in most cases - there are always exceptions).

Having said that, of course the drawback is that currently if you have just
a ResultSet, you can't currently just pass that onto the table.  I'm sure
down the road that will be functionality that would make the tag appeal to
more people.


> - allow the JSP person to place an example table between the tag start
> and stop. If the table consists of a header and a data row, the tag
> figures out the formatting from the example. In this way, the JSP
> developer doesn't need extensive Java or JDBC knowledge.

I didn't go this route, instead I opted for stylesheets, and standard table
attributes to change the look and feel of the table.  I will certainly grant
you that this approach is probably more restrictive then yours, but when I
designed it I was trying to get all of our tables to looks basically the
same through out our applications

 >
>
> Gervase Gallant


-Ed Hill (ed-hill@uiowa.edu)
Software Developer - Information Technology Services - University of Iowa


>
>
> --- Ed Hill <ed-hill@uiowa.edu> wrote:
> > Hello,
> >
> > A few weeks ago, I mentioned in the struts-user list
> > a tag library that we
> > are developing which at the time I called
> > gui:table...  I didn't have the
> > source ready to go at the time - but rather then
> > trying to get it perfect in
> > isolation, I'll risk the public humiliation and go
> > ahead and make available
> > what I have now and try to work with others who are
> > interested in
> > helping me polish it up.
> >
> > Currently, this taglib has a single key tag called
> > "table" that takes a list
> > of objects and displays them as a table.  It has
> > various features
> > (alternating row colors, using a decorator for
> > formatting, sorting,
> > pagination, etc...)
> >
> > My goal over time will be to add other common
> > "high-level" web display
> > patterns to the tag library, for example:
> >
> >    - display:table
> >    - display:tree
> >    - display:tabs
> >    - display:inspector
> >    - etc...
> >
> > The source to this tag library is available at:
> >
> >
> > http://edhill.its.uiowa.edu/downloads/display.zip
> >
> > Examples, showing usage can be found at:
> >
> >     http://edhill.its.uiowa.edu/display-examples/
> >
> > Currently, documentation is little more then just
> > the examples.
> >
> > To be honest, my original intention was to donate
> > this taglib to struts if
> > there was interest, as we are heavy struts users
> > here at the U of Iowa, and
> > I wanted to give back if possible, but there is
> > nothing "struts-specific"
> > about the taglib (other then using some struts-like
> > naming conventions for
> > attributes), so it is probably more appropriately a
> > candidate for the taglib
> > project, and as such, I have been working on getting
> > the build process for
> > the tag working in a jakarta-taglib style.
> >
> > I welcome any and all feedback and advice.  If this
> > taglib seems like
> > something that would be useful for either struts or
> > taglibs, please let me
> > know, and I'll be happy to work with either group to
> > get it put into CVS and
> > on a more serious release schedule.
> >
> > I am currently being presumptuous, and have the
> > taglib living in the
> > org.apache.taglibs.display package, but if this
> > doesn't seem like something
> > that would be of use to taglibs, I will certainly
> > change the packaging to
> > something more appropriate.
> >
> > Thanks.
> >
> > -Ed Hill (ed-hill@uiowa.edu)
> > Software Developer - Information Technology Services
> > - University of Iowa
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:taglibs-dev-help@jakarta.apache.org>
> >
>
>
> =====
> Gervase Gallant
> Please add gervasegallant@yahoo.com to your address book.
> Check out my web site: http://www.javazoid.com
>
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
>
> --
> To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message