• 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

doubts in CustomTags

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 893
Tomcat Server Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have not overridden the doStartTag() which default implementation returns SHIP_BODY. So the doAfterBody method is never evaluated.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

which default implementation returns SHIP_BODY


SKIP_BODY
 
reply
    Bookmark Topic Watch Topic
  • New Topic