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 "Ruth, Brice" <br...@fiskars.com> on 2003/10/27 03:05:17 UTC

[Fwd: Re: Tags creating Tags]


-------- Original Message --------
Subject: 	Re: Tags creating Tags
Date: 	Sun, 26 Oct 2003 20:03:26 -0600
From: 	Ruth, Brice <br...@fiskars.com>
Reply-To: 	Struts Users Mailing List <st...@jakarta.apache.org>
Organization: 	Fiskars Brands, Inc.
To: 	Struts Users Mailing List <st...@jakarta.apache.org>
References: 	<bn...@localhost.localdomain> 
<3F...@apache.org>



One way of accomplishing what you want to do, I think, is simply making 
calls to the appropriate Struts classes that are called when <html:link> 
is parsed & compiled. Instead of outputting an <html:link> - just call 
those methods with the arguments that you would write out as <html:link> 
attributes, and you should get pretty close to what you're trying to 
achieve (without the performance hit ;)

Brice

Craig R. McClanahan wrote:

> Lukas Bradley wrote:
>
>> Hi all,
>>
>> Maybe I'm just tired, but the answer to this is not to be found.  I 
>> could me
>> making this harder than it is, or something might be right in front 
>> of me,
>> and I don't see it.
>>
>> What I want is a custom tag that creates other custom tags.  Here is a
>> simple example:
>>
>> <lukas:myTag lang="en" />
>>
>> Should produce something like this:
>>
>> <table>
>>  <tr><td>English</td></tr>
>>  <tr><td><html:file property="formFile" 
>> styleClass="FormField"/></td></tr>
>>   <!-- Imagine a lot more custom tags here -->
>> </table>
>>
>> Which should then evaluate to:
>>
>> <table>
>>  <tr><td>English</td></tr>
>>  <tr><td><input type="file" name="formFile" value=""
>> class="FormField"></td></tr>
>>   <!-- Imagine a lot more custom tags rendering here. -->
>> </table>
>>
>> I've thought about trying to extend BodyTagSupport, return
>> EVAL_BODY_BUFFERED in doStartTag(), modify the bodyContent in 
>> doAfterBody(),
>> then return EVAL_PAGE() in doEndTag().  However, BodyContent has a 
>> protected
>> constructor, and no way to set its content.
>>
>> I want to maintain the functionality gained from Struts-like custom 
>> tags,
>> while extracting the creation of them in a super-duper momma tag.  
>> Any help?
>>
>>  
>>
>
> It's not much help, except in the sense that it will put your search 
> for the answer out of it's misery :-).  What you are trying to do is 
> not supported by JSP -- the reason is that custom tags are converted 
> into appropriate method calls at page compile time.  After that, they 
> are just executed.  To accomplish what you are after, you would need 
> another layer of compilation.
>
> You'll need to come up with a different approach to accomplish what 
> you are after.
>
>> Lukas
>>
>>  
>>
> Craig
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



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



-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



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