Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why javaBeans  RSS feed

 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaBeans contain getter and setter methods.
**I think work which we can do through getAttribute() and setAttribute() ,
are being done again through javabeans.
***Plz tell me if there is any other special significance of javabeans.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not understand your question. Beans and scoped variables that you set with getAttribute and setAttribute have little to do with each other except that beans are frequently used as scoped variables.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's more, there is mothing JSP-specific about JavaBeans. They can be (and are) used in all Java contexts. Their particular siginificance is that their fields and corresponding getter/setter methods follow certain naming conventions, which makes it easy to use reflection on them.
 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But as far as i understand javaBeans are just used to get and set values of object by
<jsp:getProperty> and <jsp:setProperty> respectively.
##I think there is no special significance of beans,plz tell me if there is any thing that can be done only through javabeans.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raj Kumar Bindal:
I think there is no special significance of beans,plz tell me if there is any thing that can be done only through javabeans.


POJO Works.

- http://www.onjava.com/pub/a/onjava/2005/06/29/spring-ejb3.html
- http://www.martinfowler.com/bliki/POJO.html
- http://www.manning-source.com/books/crichardson/crichardson_ch01.pdf
- http://www.manning-source.com/books/crichardson/crichardson_ch02.pdf
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raj Kumar Bindal:
JavaBeans contain getter and setter methods.
**I think work which we can do through getAttribute() and setAttribute() ,
are being done again through javabeans.
***Plz tell me if there is any other special significance of javabeans.


I guess,

If you will not use JB then YOU will have to set ALL the objects/properties in scope instead of setting them in JB and set this JB in any scope.

You will not be able to use standard actions (useBean, getProperty and setProperty) and EL.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!