File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Custom tag handler, the usage of doTag() method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Custom tag handler, the usage of doTag() method." Watch "Custom tag handler, the usage of doTag() method." New topic
Author

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

Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
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

Joined: Feb 03, 2009
Posts: 69
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.


SCJP 5.0(84%), SCWCD 5.0(97%), SCDJWS 5.0(98%)
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Thanks for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Custom tag handler, the usage of doTag() method.