Forum Stats

  • 3,854,528 Users
  • 2,264,379 Discussions
  • 7,905,718 Comments

Discussions

problem with customtag

Prem
Prem Member Posts: 88
edited Sep 26, 2011 12:02PM in JavaServer Pages (JSP) and JSTL
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..

Answers

  • 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.
  • Moderator Action:
    ... moved from the Reflections forum to the JSP forum, hopefully for closer topic alignment.
This discussion has been closed.