This discussion is archived
2 Replies Latest reply: Sep 26, 2011 9:02 AM by rukbat RSS

problem with customtag

Prem Newbie
Currently Being Moderated
Hi sorry to post this problem here...

I have created a custom tag say <test:customTag>

when this tag encounters everything is executed fine but end tag </test:customTag> is encounterd when certain condition is true like this

<%if(condition==true){%>

</test:customTag>

<%i}%>

endTag needs to be executed on certain condition and only at that time doEndTag() needs to be executed as well. But it is giving me compile error ..

Please suggest what needs to do..
  • 1. Re: problem with customtag
    maheshguruswamy Journeyer
    Currently Being Moderated
    Prem wrote:
    Hi sorry to post this problem here...

    I have created a custom tag say <test:customTag>

    when this tag encounters everything is executed fine but end tag </test:customTag> is encounterd when certain condition is true like this

    <%if(condition==true){%>

    </test:customTag>

    <%i}%>

    endTag needs to be executed on certain condition and only at that time doEndTag() needs to be executed as well. But it is giving me compile error ..

    Please suggest what needs to do..
    That doesn't make any sense. Why would you want to execute half a tag? Whatever conditions you need to handle, either handle it outside the tag or handle it in the implementation of the tag.
  • 2. Re: problem with customtag
    rukbat Guru Moderator
    Currently Being Moderated
    Moderator Action:
    ... moved from the Reflections forum to the JSP forum, hopefully for closer topic alignment.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points