aspose file tools*
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
Author

Custom Tag Query

Ankit Nagpal
Ranch Hand

Joined: Sep 09, 2008
Posts: 47

Hi,

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

E.g.
<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
Greenhorn

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:
  • http://www.coderanch.com/t/173754/java-Web-Component-SCWCD/certification/Scriptless-vs-Tag-Dependent
  • http://www.coderanch.com/t/452499/java-Web-Component-SCWCD/certification/Tags-body-content-element
  • http://www.coderanch.com/how-to/java/BodyTagContent


  • 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.

    --Tim
    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?

    Thanks.
    Bear Bibeault
    Author and ninkuma
    Marshal

    Joined: Jan 10, 2002
    Posts: 61662
        
      67

    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]
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: Custom Tag Query