File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 63838

    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] [About Bear] [Books by Bear]
    I agree. Here's the link:
    subject: Custom Tag Query
    It's not a secret anymore!