Evaluating struts tags inside my own custom tags...

Discussion in 'Java' started by A. Brinkmann, Apr 13, 2004.

  1. A. Brinkmann

    A. Brinkmann Guest

    Hi,

    I made a custom tag (extending TagSupport),
    which looks like this:

    <test:mytag key="foo"/>

    And in the implementation of this tag, in doStartTag(),
    I do the following:

    out.write("<bean:message key=\""+key+"\"/>");

    But well, the struts tag is just written in the output,
    and not evaluated. In this case, I could just get the
    resource in my implementation instead of using the struts
    tag, but I want to encapsulate other struts tags in the
    same way, and have them evaluated. Is that possible?

    Thanks in advance,

    A. Brinkmann.
    A. Brinkmann, Apr 13, 2004
    #1
    1. Advertising

  2. A. Brinkmann

    Chris Smith Guest

    A. Brinkmann wrote:
    > But well, the struts tag is just written in the output,
    > and not evaluated. In this case, I could just get the
    > resource in my implementation instead of using the struts
    > tag, but I want to encapsulate other struts tags in the
    > same way, and have them evaluated. Is that possible?


    Not in a Java-based tag handler, no. If you're using JSP 2.0, though,
    it's quite possible in a tag file.

    --
    www.designacourse.com
    The Easiest Way to Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
    Chris Smith, Apr 13, 2004
    #2
    1. Advertising

  3. A. Brinkmann

    A. Brinkmann Guest

    > Not in a Java-based tag handler, no. If you're using JSP
    > 2.0, though, it's quite possible in a tag file.


    Thanks! I'm using JSP 2.0, I just didn't know about tag files. I tried it
    and it works great.

    A. Brinkmann.
    A. Brinkmann, Apr 16, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ranganath

    Custom Tags within Custom Tags.

    Ranganath, Oct 17, 2003, in forum: Java
    Replies:
    2
    Views:
    454
    Ranganath
    Oct 21, 2003
  2. Stefan Siegl
    Replies:
    1
    Views:
    769
  3. Greg Smith
    Replies:
    35
    Views:
    3,176
    Alex Kay
    Oct 24, 2004
  4. Dave
    Replies:
    0
    Views:
    449
  5. John M
    Replies:
    1
    Views:
    743
Loading...

Share This Page