• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom Tag Handler problem

 
Vijay Chandran
Ranch Hand
Posts: 186
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,

I wrote the following JSP:


This is the entry i made in a TLD file:

This is the Tag handler class:


This is the exception stack trace i get when i run the JSP:


Kindly point the mistake i made here. Thanks in advance.

Regards,
Vijay

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to get the output stream for a tag, you should use pageContext.getOut().
 
Chithra Salam
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adding some more points ,

1)EVAL_PAGE is not a valid return from doAfterBody. The valid return values from doAfterBody are SKIP_BODY,EVAL_BODY_AGAIN.EVAL_PAGE is the valid return value from doEndTag.

2) Also as you are returning SKIP_BODY from startTag doAfterBody wont be invoked.It will get invoked only if in dd <body-content> is not declared empty, tag has body and if doStartTag return EVAL_BODY_INCLUDE.

3)If you haven't override doEndTag, the default return value is EVAL_PAGE.In your code as you have to print something implement doEndTag instead of doAfterTag.

Chithra Salam
SCJP-85%,SCWCD-inprogress
 
Vijay Chandran
Ranch Hand
Posts: 186
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much for the replies.



Regards,
Vijay
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic