jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Riegel" <stefan.rie...@telig.de>
Subject AW: A bit of newbie question
Date Fri, 27 Apr 2001 09:37:35 GMT
Hello, Peter Giannopoulos,

funny, but I did ask a similar question almost the same time :-)

Peter Alfors confirmed, that their is no way to use Custom Tags as attribute
values in Custom Tags. Now we have some design choices:

1. Use scripting: <foo:bar attrib1="baz" attrib2="<%=somevalue%>"/>

This solution is the most flexible and less complicated but the users of
Your tags need to know Java coding.

2. Use some approaches similar to James Strachans proposal:

<foo:bar attrib1="baz">
    <foo:othertag attrib1="">

It can be useful in some situations but the "othertag" has to know about,
that it is beeing used as an attribute.

3. Use a nested attribute tag similar to this:

<foo:bar attrib1="baz">
  <foo:attribute name="attrib2">
    <foo:othertag />

This approach needs also some special coding especially if you want to
permit both possibilities to set the attrib2 value (as common attribute with
the value supplied as a string or attribute tag with a value supplied as
another tag). The use of such tags are also very verbos.

4. ... More ideas? ...

I'am not very happy with none of this possibilities but JSP Custom Tags are
still very usefull. For me it is the best on the road :-)

Stefan Riegel

> -----Urspr√ľngliche Nachricht-----
> Von: Peter Giannopoulos [mailto:Peter.GIANNOPOULOS@gemplus.com]
> Gesendet: Donnerstag, 26. April 2001 20:50
> An: taglibs-dev@jakarta.apache.org
> Betreff: A bit of newbie question
> Hello all,
> I am new to the taglib development world so please bare with me, if I
> sometimes seem to ask silly questions. :-)
> That being said, I would love to know if there is a way to
> use a custom tag
> within another custom tag (as an attribute value)
> For example something like (please let me know if I'm being
> stupid here...is
> there a better way?)
> <foo:bar attrib1="baz" attrib2=" <foo:othertag attrib1=""> " />
> 		OR
> <foo:bar attrib1="baz" attrib2="<%=somevalue%>"> " />
>    ----> I really would rather avoid any code between <% and
> %> on the jsp
> page.
> Basically the page will invoke itself and every time it does
> it passes to
> itself a incremented counter. Based on the value of the
> counter the <foo:bar
> /> tag should modify it's behaviour.
> Any suggestions? Or maybe even pointers to documentation that
> deals with
> this kind of thing? Is it even reasonable want to do this?
> Thanks,
> ---------------------------------------------------------
>  Peter Giannopoulos,            Software Developer
>  Gemplus Software,              Advanced Projects Group
>  Phone: +15147322434
>  Fax:   +15147322401
>  Gemplus Card International,     Http://www.gemplus.fr
> 		I hear and I forget,
>         	I see and I remember,
>         	I do and I understand.
> -----------------------------------------------------------

View raw message