• Post Reply Bookmark Topic Watch Topic
  • New Topic

doubts in CustomTags

 
naresh govindaswmay
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello <mylib:mytag> World!</mylib:mytag>

public class MyTag extends TagSupport

{

public int doAfterBody()

{

try

{

pageContext.getOut().println("In doAfterBody()");

}

catch(Exception e)

{

}

return SKIP_BODY;

}

}

Select 1 correct option.
A.Hello
B.Hello World!
C.Hello In doAfterBody() World!
D.Hello In doAfterBody()
E.None of the above.



hi,
I have selected d is the correct answer. But they said a is the corrct answer.Please clear this doubt.
 
Remko Strating
Ranch Hand
Posts: 893
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have not overridden the doStartTag() which default implementation returns SHIP_BODY. So the doAfterBody method is never evaluated.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which default implementation returns SHIP_BODY

SKIP_BODY
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!