Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JSP Tags

 
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
 
Marshal
Posts: 67425
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • 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.
 
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,
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!
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic