Is it possible to maintain multiple values in a single javabean property?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   olivia_kyle
Posted On:   Monday, November 3, 2003 06:20 AM

I am building a web application using javabeans. My app deals with accounts that may have multiple insurance policies associated with them. When the user selects an account, I pull the data from the database and place it in the javabean. The policy data will be displayed in a table in my JSP.
One of the javabean's properties is "policy number" and could have multiple values in the database. How can I populate the javabean property with multiple values in order to display the table? An array perhaps?

THANKS!!!!

Re: Is it possible to maintain multiple values in a single javabean property?

Posted By:   Anin_Mathen  
Posted On:   Friday, January 2, 2004 10:12 AM

Yup you answered your own question.


You can return the values to the jsp from your bean using a
signature like this

String[] getPolicies()


But internally within the bean you might want to store the policy numbers in a List of some sort.


Hope this helps,

Anin
About | Sitemap | Contact