Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can I add other methods other tahn getter/setters in java bean ?

 
wei Qiao
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to get something done repeatedly in different jsp about a java bean object. Say, getReleatedChildren, which is not a property of the bean. Can I add this method to the bean?
Thanks!
 
David Freels
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can add as many methods to a bean as you would like, but only methods that follow the bean specification/convention will be exposed. Beans are just class files and can be created like any other class file so methods can be accessed like any class file. The bean convention is only so IDEs can easily grab a component and expose it to a user.
David
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!