tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William McKenzie" <>
Subject RE: Building my own agregates
Date Wed, 03 Jul 2002 12:44:47 GMT
It seems like if david does need a collections taglib it would be fairly
simple to create such a thing on his own?

-----Original Message-----
From: Shawn Bayern [] 
Sent: Wednesday, July 03, 2002 7:45 AM
To: Tag Libraries Users List
Subject: Re: Building my own agregates

JSTL isn't really meant for creating objects; it's meant for working
them.  You can use <c:set> to store objects, move them between scopes,
etc., but we don't provide tags for creating HashMaps and so forth.  The
main reason for this is that it's beyond what most people seem to be
with JSP pages; in most applications, logic like this would fall to a
servlet, filter, listener, or other Java code.  (In fact, I proposed a
"Collections Taglib" at taglibs-dev, but there was, to be completely
honest, very little interest in the proposal.  I suspect that by and
large, people don't need such a facility -- or, at least, they haven't
us know they do.)

As you suggest, you can attempt to stretch JSTL by using <jsp:useBean>
create objects and <c:set target="..." property="..."> to create or edit
elements of Map objects.  But you'll end up with large collections of
in your JSP pages that have nothing to do with display, so even in small
applications, it might be easier to move the code elsewhere.

Shawn Bayern
"JSTL in Action"
(coming in July 2002 from Manning Publications)

On Wed, 3 Jul 2002, David Goodenough wrote:

> I am building a site using JSTL (1.0).  I need to be able to build up
lists of
> objects, and components of those objects, during the life of a
> So I thought that should be easy, JSTL supports Vector and Map
objects, all I
> need to be able to do it create them for myself rather than using the
> I get handed by things like the SQL tags.
> And I had vague memories of discussions (which I can not now find, I
> used the wrong keywords) of using jsp:useBean to do such things, but I
> not find any reference to it in the taglibs spec, and so I thought I
> ask here.
> What I need to be able to achieve, although I know this will not work,
> <c:set var="list" value="new java.util.Vector( )" />
> and then later to be able to create an object such as a Hashtable and
> it to the list, for which I would have expected to be able to do
> like creating a new Hashtable, setting the values that I need within
> and then adding it to the Vector list.  But I do not see how to invoke
> relevant method on list.
> In the "old" days, in my first JSP work, I had mountains of embedded
> but I am trying to follow the new paradym and not embed java and just
> tags, but I can not see how to do this without embedded java.
> Is there an FAQ or guide to such things around somewhere?
> Thanks in advance
> David
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message