Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java bean in JSP ?  RSS feed

 
Manas Ahlaad
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
JSP has useBean property for using a java bean in JSP , this bean can be any class with get and set methods?
then why it is called a bean , bean should be something whose state can be changed at runtime and with its other specific properties (what are they??)
i write a class with set and get methods and use it in jsp:useBean tag effectively
can i call it a java bean ???
or should it have more properties ??
 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by manas ahlaad:
Hi all,
bean should be something whose state can be changed at runtime and with its other specific properties (what are they??)

You gave an exact definition of a bean. In JSP, by using useBean, setProperty & getProperty, you actually do the same thing, i.e., change the state of the bean and its properties as well at runtime(by calling setProperty). Than why you're feeling so hesitable to call that a Bean ?
 
Manas Ahlaad
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i dont need a bean to achieve that , right !
i can do that with a plain java class which has set and get methods.
then where is the bean getting an edge over class???
 
Manas Ahlaad
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The advantage derived by JavaBeans by liveraging on the introspection used by the bean containers to achive runtime changes is known.
Therefore the use of JavaBean components in visual components is evident,what i want to know is "what is the distictive characteristic of java beans in a non visual interface context that edges it over a normal java object?"
or
What advantage do i derive when i use a java bean instead of a Java Object in a non visual component context?
Hope i made myself clear
 
Manas Ahlaad
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyone to answer my question ,please .......
 
Michael OBrien
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have wondered the same thing. My guess would be looking at the JSP spec to see how the tag library implements the <jsp:usebean>.
Remember, also that the idea of the taglib is to allow HTML people access to extended functionality. So, perhaps the tag was intented for including Beans with human interfaces and not so much for accessing classes with no human interface.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!