Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Calssic Vs Simple Custom tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Calssic Vs Simple Custom tags" Watch "Calssic Vs Simple Custom tags" New topic
Author

Calssic Vs Simple Custom tags

senthil rajan
Ranch Hand

Joined: Aug 31, 2005
Posts: 36
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
singh santosh
Ranch Hand

Joined: Jan 13, 2006
Posts: 136
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
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
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


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calssic Vs Simple Custom tags
 
Similar Threads
Classsic Vs Simple?
JspFragment
doubts regarding access and manipulation of body in Simple tags and in classic custo
exams on j2eecertificate.com
simple tags Vs Classic tags