• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom Tag

 
Sandeep Chhabra
Ranch Hand
Posts: 340
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the start tag of simple custom tag is encountered, the JSP page's servlet invokes the handler's _________ Method.

I think the answer should be doTag(). But can it something like doStartTag()

Thanks for your help.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The question is about Simple tag. There is no doStartTag in Simple tag.

Thanks
 
Reshma Shanbhag
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To implement a Custom tag, the handler class implements javax.servlet.jsp.tagext.TagSupport (check the api for methods)

public int doStartTag() is called when the custom tag is encountered in a page.


public void doTag() is defined in javax.servlet.jsp.tagext.SimpleTagSupport class, which is extended to implement SimpleTag handler class. And this is called when simple tag is encountered in a page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic