• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP Tags

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Raj,I also started Custom Tags recently but stuck in tag Library mapping,
https://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!
 
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic