• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Bean creation

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Happy new year friends!
I have some confusions about 'Bean' creation,
- To create a bean it is only required(essential) to import the Bean.* and then use this class like a bean.
- Above assumption is not true and we can use any class ( not importing Bean.* ) like a bean providing that class uses some setter and getter methods in the pattern of bean.
- Any bean used in JSP can be in turn a Servlet.
Which of the above arguments are true, explain? Any body.
thnx
Naveed
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Naveed -
There's nothing about a JavaBean that functionally separates it from any other Java class. What's important is that a bean includes certain signifiers -- such as getter/setter methods -- that allow the system to control a JavaBean object at the descriptive level of 'properties' and 'events.'
So yes, you can instance a JavaBean like a class, but only if you want to treat it like any other class. By indentifying it as a bean (for example, through the jsp:useBean tag), you get to take advantage of its additional descriptive features.
Finally, all JSP pages are ultimately a kind of servlet, so it stands to reason that beans function the same way in both.
Hope this helps,
 
Naveed Ali
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Michael!
Thanx for the reply, but still a piont that what is Bean.* for and in what situation we can use it?
Naveed.
 
reply
    Bookmark Topic Watch Topic
  • New Topic