Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating Custom Tags using BodyTagSupport

 
Raman Ghai
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The calling JSP : date.jsp

The TLD File code:

The Tag Handler Code:


The output text is NOT in UpperCase .
Moreover, I get BodyContent = null , and Body Exception = NullPointerException in console.
I am not able to resolve the error. Any suggestions...
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65542
110
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well since your code is hiding the exceptions we'll never know.

I'd strongly suggest refactoring your code to handle the exceptions properly.

Hint: See that throws JspException on the method signature? That's there for a reason.
 
Raman Ghai
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Well since your code is hiding the exceptions we'll never know.

I'd strongly suggest refactoring your code to handle the exceptions properly.

Hint: See that throws JspException on the method signature? That's there for a reason.

I found the error, Instead of using return EVAL_BODY_INCLUDE , I should have used return EVAL_BODY_BUFFERED in doStart() method.
Then it doesn't give any exception and gives me the desired results. Thanks for replying Mr Bear Bibeault
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!