• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can a Map be a JavaBean Property?  RSS feed

 
JiaPei Jen
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know how to create a JavaBean - zero argument constructor, private field variables, and public get and set methods to expose the properties.

I have an Object of Map type. How do I store this object as a property of a JavaBean?
 
Weronpc
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know much about Java beans, let me know I am wrong, I will ask around for you.

int y;
//should be same as
Map x;

maybe you have to import the package where the Map class belong to.

Mike
[ June 15, 2004: Message edited by: mike chi ]
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37249
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JiaPei,
To you want to have the Map as part of another bean or as the bean itself?

Mike,
Those are just regular variables in your post. A javabean is a way of using XML like syntax in a JSP to minimize the amount of "real" code. For example,
<jsp:useBean id="test" class="java.util.Map" />
 
Lavern Matthew
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at http://dynclass.sourceforge.net/
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!