This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Implementation of CLassic tag Handler 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 "Implementation of CLassic tag Handler" Watch "Implementation of CLassic tag Handler" New topic

Implementation of CLassic tag Handler

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Here is a implementation of classic Tag Handler.It shows the use of doAfterTag().




MOvies NOW
Before BOdy
After body

I am not able to get the other 2 elements of the String array in output.

doAfterTag() seems to be not runnning.

What can be the solution for this problem ?

OCPJP 6.0 93%
OCPJWCD 5.0 98%
Stoian Azarov
Ranch Hand

Joined: Jun 01, 2011
Posts: 113
Your doAfterTag() method is not executed at all. The problem is that the API method that you have to override is doAfterBody().
That's why it doesn't get called at all. The default implementation of that method is empty and it is skipping the subsequent body invocation.
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

i have changed the method to doAfterBody.
still getting the same output
Hermann Laghom

Joined: May 28, 2011
Posts: 18

After changed the method to doAfterBody, remove the Exception at the declaration and surround the out.println("a") with a try catch, and put your return in the else block

it should work.

OCJP 6, OCE JEE6 JSP and Servlets Developer
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Thanks for Help
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Implementation of CLassic tag Handler
It's not a secret anymore!