• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tag library versus Javabean

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With both being capable to do what you want (taglib can handle postprocessing), how does one decide, when to use what?
Also writting your custom tag library is a time consuming process with a challenge of integrating the tag library with Java bean.
I havent come across any design pattern or best practices which talks about this.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personally, I like to keep my JavaBeans very business-object like. That is, primarily data containers with some behavior. However, when I want to provide specific presentation behavior based on that data I use a custom tag. Motivations for the custom tag are "can this functionality be used across other pages in my app?" If so, and the behavior is not tied to a specific type of data, then you may want to consider a custom tag. Often a motivation is more practical -- that is, as you build your app you will find places where it seems like you have to use scriptlet ... look at those sections and consider ... Could I put this behavior in the bean I am using? If not, or it doesn't seem appropriate, then probably a custom tag will meet your needs. Also, take a look at Struts, Jakarta TagLibs, and JSTL. Good Luck!
reply
    Bookmark Topic Watch Topic
  • New Topic