This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Creating Custom Tags using BodyTagSupport Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Creating Custom Tags using BodyTagSupport" Watch "Creating Custom Tags using BodyTagSupport" New topic
Author

Creating Custom Tags using BodyTagSupport

Raman Ghai
Ranch Hand

Joined: Jan 01, 2012
Posts: 51
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

Joined: Jan 10, 2002
Posts: 60817
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Raman Ghai
Ranch Hand

Joined: Jan 01, 2012
Posts: 51
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating Custom Tags using BodyTagSupport
 
Similar Threads
Unable to have tagdependent as body content for a classic tag
Unable to use El in custom tags
Not the expected output: EVAL_BODY_TAG
Jsp Custom Tag
Can anybody help me to fix jsp Tag Libraray descriptor file maping