This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes JSP and the fly likes Custom Tag Query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Custom Tag Query" Watch "Custom Tag Query" New topic

Custom Tag Query

Ankit Nagpal
Ranch Hand

Joined: Sep 09, 2008
Posts: 47


I have a custom tag in my web app which outputs another custom tag.

<myTags:myTag1 /> outputs text <myTags:myTag2 />

Is there any way by which the above output is also evaluated? i.e. result of <myTags:myTag2 /> is expected.

Thanks in advance.
Timothy Schmelter

Joined: Apr 25, 2011
Posts: 7
Hi Ankit,

I am not sure I completely understand your question. Are you saying:
  • You have a custom tag myTag1
  • myTag1 is supposed to output the results of the custom tag myTag2
  • Instead, myTag1 outputs the literal string <myTags:myTag2/>

  • ?

    If so, check to make sure that the declarations of myTag1 are properly configured to accept "scriptless" body content, not "tagdependent." See these links:

  • It sounds like you may have myTag1 configured as tagdependent.

    If not, give us some more details and we can look at it a bit more.

    Ankit Nagpal
    Ranch Hand

    Joined: Sep 09, 2008
    Posts: 47

    Hi Tim,

    Answer to all your questions is yes. myTag1 is printing a string "<myTag:myTag2 />" and I want that the output of this output should be printed. Is there a way that the string returned from the custom tag be rendered again?

    Bear Bibeault
    Author and ninkuma

    Joined: Jan 10, 2002
    Posts: 63226

    No. Custom tags are evaluated at translation time, long before your tag executes.

    The only situation in which embedded custom tags will be evaluated is when the parent tag is a tag file.

    [Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
    I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
    subject: Custom Tag Query
    It's not a secret anymore!