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
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,
Make visible what, without you, might perhaps never have been seen. - Robert Bresson
posted 13 years ago
Hi Michael! Thanx for the reply, but still a piont that what is Bean.* for and in what situation we can use it? Naveed.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads