I would never write code to return a Map when its fate was simply to
be converted back into a Collection by a function :)  Sometimes what's
there is a Map, for whatever reason. Example: config data loaded from
a YAML file is "naturally" a Map.  The functions to un-wrap Map
instances are great for that sort of thing.

For populating select tags, I've fallen into the pattern of writing
helper beans to pull stuff from the database and return lists of
entities. The stripes options-collection tag is pretty awesome.  (I
still write little tag files - not Java - to wrap the access to the
beans, mostly to provide a layer of maintenance indirection and to
make it easier to cache bean instances in the request scope, since
jsp:useBean is so obtuse about that.)

On Tue, Jul 28, 2009 at 12:00 PM, Lionel<[email protected]> wrote:
> Mike McNally wrote:
>> I have EL functions in my library  to extract keys and values and
>> Map.Entry lists out of a Map; they're really simple to do and they're
>> very useful in such situations.
>
> The less code I write, the better I feel :)
> Of course, you can easily write a tag that will extract values from a
> hashmap to create the options and optionsGroup, but is it the best solution
> ?
> Using a Collection with a group property means no tag, no code, and nothing
> to maintain: a single sql select, nothing to build a hashmap that will be
> unbuilt after.
>
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>



-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to