nested custom tags in JSP

Discussion in 'Java' started by Saurabh Singhania, Aug 21, 2003.

  1. Hi All,

    Is it possible to pass attributes to a JSP custom tag using another custom
    tag? I.e.:

    <mytag:something parm1="value1" parm2="<mytag:eek:ther/>"/>

    Works as expected if I pass a string or a JSP expression, but embedded
    custom tags are not evaluated. They are simply passed as plain text to my
    code, which is of course not very useful.

    Any help would be appreciated!

    Saurabh
     
    Saurabh Singhania, Aug 21, 2003
    #1
    1. Advertising

  2. Saurabh Singhania wrote:
    >
    > Hi All,
    >
    > Is it possible to pass attributes to a JSP custom tag using another custom
    > tag? I.e.:
    >
    > <mytag:something parm1="value1" parm2="<mytag:eek:ther/>"/>
    >
    > Works as expected if I pass a string or a JSP expression, but embedded
    > custom tags are not evaluated. They are simply passed as plain text to my
    > code, which is of course not very useful.
    >
    > Any help would be appreciated!
    >
    > Saurabh


    JSP obeys XML rules, which don't allow for a tag within another tag (by
    which I mean a tag within the < > for an opening tag).

    But, a tag can be contained by another tag (which would actually fit the
    definition of nesting), such as:

    <mytag:something parm1="value1">
    <mytag:eek:ther />
    </mytag:something>

    Or maybe:

    <mytag:something parm1="value1">
    <param>
    <name>parm2</name>
    <value><mytag:eek:ther /></value>
    </param>
    </mytag:something>


    Then your logic for mytag:eek:ther can set values that the
    mytag:something.doCloseTag can work with.


    --
    Steve
    --
    http://www.steveclaflin.com
     
    Steve Claflin, Aug 24, 2003
    #2
    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:
    470
    Ranganath
    Oct 21, 2003
  2. Mike
    Replies:
    3
    Views:
    890
    Michael Borgwardt
    Jan 9, 2004
  3. Raymond DeCampo

    Custom tags and <jsp:plugin> / <jsp:param>

    Raymond DeCampo, Feb 18, 2004, in forum: Java
    Replies:
    0
    Views:
    644
    Raymond DeCampo
    Feb 18, 2004
  4. koslows
    Replies:
    0
    Views:
    539
    koslows
    May 12, 2005
  5. Dave
    Replies:
    0
    Views:
    456
Loading...

Share This Page