Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom tag handler, the usage of doTag() method.

 
Chinmaya Chowdary
Ranch Hand
Posts: 432
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, In custom tag handling, the doTag() uses getJspContext() to get the PageContext object, through it, it will get the jspwriter by calling getOut() method, uses write() method and writes to the response object and the output can be seen through browser. My question is, the custom tag handler (which extends SimpleTagSupport) is just like plain old java class. How it will get PageContext, who sets it, because of it, we are able to see the output through browser. Can you please tell me in detail, the underline mechansim? Thankyou.
 
udaykumar maddigatla
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
These tag classes will be invoked when we write a tag in the jsp page. That means when the ime of calling the tag it got the instance of JspContext object.

Observe that Your Tag class will extends one of the TagClass like SimpleTagSupport or TagSupport or BodyTagSupport.

 
Chinmaya Chowdary
Ranch Hand
Posts: 432
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic