users
[Top] [All Lists]

RE: [cinjug-users] Access of anonomuos bean paramters inside JSTL or Cus

To: <users@xxxxxxxxxx>
Subject: RE: [cinjug-users] Access of anonomuos bean paramters inside JSTL or Cust. Tag
From: "James Carman" <james@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 1 Oct 2004 22:30:21 -0400
Delivered-to: mailing list users@cinjug.org
Importance: Normal
In-reply-to: <20041001203923.49716.qmail@web41602.mail.yahoo.com>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
Organization: Carman Consulting, Inc.
Why don't you try to use the Jakarta Commons BeanUtils library.  You could
do a BeanUtils.describe() which returns to you a map (property name ->
property value).  Then, it would be trivial to display it using the JSTL
libraries (iterate the keySet() to define the columns).

-----Original Message-----
From: John Olmstead [mailto:jolmstead2k@xxxxxxxxx] 
Sent: Friday, October 01, 2004 4:39 PM
To: Cinjug
Subject: [cinjug-users] Access of anonomuos bean paramters inside JSTL or
Cust. Tag

Ladies and Gentlemen;

I have a requirement to develope a custom tag that will have passed to it a
collection of
beans, object type unknown, and render the bean fields as a header in an
html table and the
bean parameters in the rest of the table.  This tag would have many
oppertunities for use
throughout the application, hence the desire to write the code in a
reuseable class.

Of coarse , this is trivial in JSTL if I know the bean object type in the
collection that is
passed, but not knowing the object type certainly makes it more challenging.


Clearly, reflection would be involved to get the parameters and the field
names, but, If I
can't cast the object being retrieved from the collection, I don't think
using reflection on a
generic Object instance is going to help me.

Any ideas are appreciated.

Thank You;

John Olmstead 

=====
John Olmstead
jolmstead2k@xxxxxxxxx


                
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

---------
You may unsubscribe from this mailing list
by sending a blank email addressed to:
users-unsubscribe@xxxxxxxxxx

--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx



<Prev in Thread] Current Thread [Next in Thread>