• 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

Calssic Vs Simple Custom tags

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Please clarify my doubt.

What are the differences between Simple & classic custom tags? I think By using Simple custom tags, we can do all the stuff, then why we go for classic Custom tags?

Thanks,
Senthil
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi senthil,

yeh u r quite right ,y need to use custom tag when everything can be done be SimpleTag so simply...
But since SimpleTag is added from JSP2.0 so what about the code written before JSP2.0.What if u come across them some day while maintaining somebodys code .So we must know how they work(there is a good explanation in HFSJ also).
And its also on the exam .

regards
-santosh
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi senthil,

The Simple tag have a simpler life-cycle than the old custom tag. In most of the cases Simple tags are easy to develop than the Custom tags, as there is normaly only doTag method is to be implemnt.

But the Simple tag handlers are not reused. So every-time it create a new object when it invoked. This may be extra burden, if that tag object is complex.

Secondly, Yo can not use the JSP as the body-content to the Simple tag. That means You can not have Scripting element processing in Simple tag.

In case you want to process the non standard body (tagdependent) instead of only passing it to the output Stream, it require extra effords in case of Simple tags. The bodyContent object in the give you the methods to return the body as String.

Hope this help you

Thanks
 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic