This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JavaBean and Tag Library!!  RSS feed

 
Brian Smith
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
could you please explain me why can't we use JavaBean in place of TagLibray? Why do we need to design TagLibrary?
thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use whatever you want. Some people just find tag libraries a very convenient way to package useful tools for JSP construction.
 
Faisal Khan
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I beleive Tag Libraries can be largely used to create re-usable web components which are generally project independent. For example, using JSTL is awsome compared to have to build that functionality into each business component.
We always need iteration through records, why build that into each of your bean when the effort can be done onces and re-used.
Another thing that comes to my mins is separation of roles. Things like JSTL can allow a fairly junior member of the team deal with lot of interface design, while the more experiences developers can concentrate on the business logic.
These are my thoughts anyway, please feel to correct me where I may be wrong.
 
Dana Hanna
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JavaBean provides a single structure's fields to be used on the page. A taglibrary has endless possibilities. I agree with the previous post - tag libraries are almost obsolete due to the JSTL (Java Standard Tag Library).
This library's most useful tag, IMO, is the iterator tag. This allows you to put a collection in the page/session/app scope, and iterate through it using the fields of each bean in the collection.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!