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

Beans for jsp

 
Danish Shaukat
Ranch Hand
Posts: 340
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!
I'm making beans for my jsp's.
Can we have any method in our beans other than get and set methods.
Regards
Danish Shaukat
 
prabhat kumar
Ranch Hand
Posts: 114
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sure u can have ..
and u can acees them by using fully qualified nameslike
objectname.method()
u can't use properties tags for setting and getting them
 
Dustin Marx
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaBeans are basically just Java classes that meet a few minor restrictions (such as having a constructor that accepts no arguments). This is one of the reasons I like moving Java syntax out of a JSP and into a JavaBean when possible -- the underlying JavaBean can be used by other non-JSP applications (any applications that can make use of Java classes). This is also why I try to make my Java custom tag handler classes as small as possible and have them utilize JavaBeans -- while the JavaBeans are as reusable as the functionality placed in them, Java tag handlers are really only usable by JSPs.
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
Hai Shaukat
u can hav ur methods in beans its as good as having
methods in ur java application
cook ur business logic with beans so tah they can be used in very many places
bye
Originally posted by Danish Shaukat:
Hi all!
I'm making beans for my jsp's.
Can we have any method in our beans other than get and set methods.
Regards
Danish Shaukat


------------------
Thanks & Regards
Praveen
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic