This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

normal class and java Bean

 
Yeshwantrao Patil
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi frendz,

what is difference between normal class and java bean ? in jsp UseBean tag we can use only bean or both normal class and javabean ?..if we use both then whatz difference?



Thanx in advance
yeshwant
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basic difference is in constructor, bean must have public non parametric constructor, otherwise you will not be able to use jsp:useBean.
 
Yeshwantrao Patil
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx David Ulicny
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64843
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to Java in General (beginner).
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The other difference is with method names and conventions. Typically a Java Bean has properties. These properties are defined with getter and setter methods. For example, if you want to have a String property named foobar, then you need methods getFoobar() and setFoobar(String). The setter is optional if you want a read-only property.

Java Beans also allow for events and more complex property interactions. If you want more details, follow the link in my sig to the Java Tutorial and look for the trail about Java Beans.

Layne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic