You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Sloan Seaman <sl...@sgi.net> on 2003/02/28 17:57:18 UTC

Nexted tags in custom tag

I have a custom tag that I need to set a value in so that it can do its
thing.

How do I pull something like this off?

Example:

  <request:existsParameter name="campaignIdValue">
   <core:set property="campaignd" value="<request:parameter
name="campaignIdValue"/>"/>
  </request:existsParameter>

  <!-- custom tag -->
  <promotion:list id="promo" campaignId="<core:out value="${campaignId}"/>">
  </promotion:list>

Ideas?

--
Sloan



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Nexted tags in custom tag

Posted by Dave Newton <da...@solaraccess.com>.
On Fri, 2003-02-28 at 11:57, Sloan Seaman wrote:
> I have a custom tag that I need to set a value in so that it can do its
> thing.
> 
> How do I pull something like this off?
> 
> Example:
> 
>   <request:existsParameter name="campaignIdValue">
>    <core:set property="campaignd" value="<request:parameter
> name="campaignIdValue"/>"/>
>   </request:existsParameter>
> 
>   <!-- custom tag -->
>   <promotion:list id="promo" campaignId="<core:out value="${campaignId}"/>">
>   </promotion:list>

If it's a bodyless tag you could just do:

<promotion:list ...>
  <c:out value="${campaignId}"/>
</promotion:list>

and do appropriate things to the body content (stripping
leading/trailing whitespace, for example).

Or you could write the tag such that it looks for a well-known parameter
or attribute. Or you could pass in the name of the parameter or
attribute to the tag and have it look it up based on that dynamic name,
which is probably better:

<promotion:list id="promo" lookup="campaignIdValue"/>

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org