Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP Tags  RSS feed

 
Raj Mehta
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a custom tag handler which extends from TagSupport class.

I see that the doStartTag() method can return one of the two : SKIP_BODY or EVAL_BODY_INCLUDE. But what i want to do is to process the body but not include it in the output. If I use SKIP_BODY the content of the body wont be processed and if I use EVA_BODY_INCLUDE the content would be included in the output.

Can someone suggest how this can be done?

Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65825
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are extending the wrong class in that case. If you want to process the body yourself, extend the BodyTagSupport class.
 
Raj Mehta
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I want to include the output of the body only if a certain condition is met. What i am stuck at right now is that I cant get whatever is between the tags to appear on the JSP.

Eg.
<abc:myTag>

</abc:myTag>

What i want is the output betwen the tags to appear on the main JSP if a certain condition is met. I am processing the content of the body inside the doAfterBody() method and setting a session variable.

Tried extending BodyTagSupport class. But cant figure out how to do this. Help appreciated.
 
Satya Komirisetti
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raj,I also started Custom Tags recently but stuck in tag Library mapping,
http://www.coderanch.com/t/285035/JSP/java/anybody-help-me-fix-jsp
I am curious to know ,what tool u are using.Does it require settings anywhere.
Thanks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!