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

Implementation of CLassic tag Handler

 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a implementation of classic Tag Handler.It shows the use of doAfterTag().

Super.jsp


classic.tld



ClassicTagTest1.java




output:

MOvies NOW
Before BOdy
THor
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 ?
 
Stoian Azarov
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have changed the method to doAfterBody.
still getting the same output
 
Hermann Laghom
Greenhorn
Posts: 18
Java Mac PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for Help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic