You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Laurent Duparchy <du...@esrf.fr> on 2006/07/12 08:40:54 UTC

taglib nested-el

Hi,

(Sorry if you already get this message, I'm sure if it had been sent.)

is there a taglib "nested-el" ?

If not, what is the turnarround to evaluate an expression within a 
<nested> tag ?



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


Re: taglib nested-el

Posted by Laurent Duparchy <du...@esrf.fr>.
Many thanks David for your response.

Do you mean that using properly the JSTL, there is a way to avoid the 
following "hack" ?

<% // hack to evaluate the docattributeCMPData.docattrid - no nested-el 
taglib ! %>
<bean:define id="docattrid" >
<nested:write property="docattributeCMPData.docattrid" />
</bean:define>

<nested:radio property="../docAttributeId" value="<%= docattrid %>"/>



Karr, David wrote:

>When I implemented Struts-EL (4 years ago, I think), I made a judgement
>call on what taglibs had "best value" for implementing as EL taglibs.
>In retrospect, it probably would have been worthwhile to implement both
>nested and tiles, even if they wouldn't be used much.
>
>Thinking about it at this point in time, there's less value in doing
>this.  For one, many of the people who might have been using the nested
>taglib have converted over to a JSP 2.0 container, where the EL taglibs
>aren't necessary.  In any case, if someone really needs this, it is
>pretty easy to implement on your own.  If you look at the very simple
>code in any of the EL taglibs, you'll see that it would be trivial to do
>the same for the nested taglib.  All of the Struts-EL tag
>implementations use a very simple pattern that can be easily templated
>for a different taglib.  It's not a direct "cut/paste" job, but once you
>see the code, I'm sure you'll figure it out.  Don't ignore the BeanInfo
>class.  That's important to make sure you can use the same JSP attribute
>names as in the base taglib. 
>
>  
>
>>-----Original Message-----
>>From: Laurent Duparchy [mailto:duparchy@esrf.fr] 
>>Sent: Wednesday, July 12, 2006 9:17 AM
>>To: Struts Users Mailing List
>>Subject: Re: taglib nested-el
>>
>>
>>Thanks for the response.
>>
>>Unless I missed something,  the taglib "nested" is not just a 
>>cooler way to access child beans, or access  beans inside, 
>>say, collection of collections ;
>>
>>The nested taglib allows *_true recursion_ *within JSPs that 
>>is not possible otherwise with struts standard nor JSTL.
>>
>>    nested is much much more elegant than using "indexed" property. 
>>"Indexed' doesn't allow recursion, anyway.
>>
>>So, I think a nested-el is desirable and relevant.
>>
>>a cool tutorial to nested taglib :
>>
>>http://www.keyboardmonkey.com/index.jsp
>>
>>It allows something like :
>>
>>treenode.jsp
>>...
>>
>>  <nested:root>
>> 
>>    <nested:write property="nodeName" /><br>
>>    <nested:iterate property="childCollection">
>>      <jsp:include page="treenode.jsp" />
>>    </nested:iterate>
>>   
>>  </nested:root> 
>>
>>
>>
>>
>>Lance wrote:
>>
>>    
>>
>>>There is no nested-el. The struts-nested, struts-logic and 
>>>      
>>>
>>struts-bean 
>>    
>>
>>>tags are pretty much dead. If you're not already, use the 
>>>      
>>>
>>JSTL tags as 
>>    
>>
>>>I'm sure most of the people on this list will tell you.
>>>
>>>http://java.sun.com/products/jsp/jstl/
>>>
>>>-----Original Message-----
>>>From: Laurent Duparchy [mailto:duparchy@esrf.fr]
>>>Sent: 12 July 2006 07:41
>>>To: user@struts.apache.org
>>>
>>>Hi,
>>>
>>>(Sorry if you already get this message, I'm sure if it had 
>>>      
>>>
>>been sent.)
>>    
>>
>>>is there a taglib "nested-el" ?
>>>
>>>If not, what is the turnarround to evaluate an expression within a 
>>><nested> tag ?
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>For additional commands, e-mail: user-help@struts.apache.org
>>>
>>> 
>>>
>>>      
>>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>

RE: Re: taglib nested-el

Posted by "Karr, David" <da...@wamu.net>.
When I implemented Struts-EL (4 years ago, I think), I made a judgement
call on what taglibs had "best value" for implementing as EL taglibs.
In retrospect, it probably would have been worthwhile to implement both
nested and tiles, even if they wouldn't be used much.

Thinking about it at this point in time, there's less value in doing
this.  For one, many of the people who might have been using the nested
taglib have converted over to a JSP 2.0 container, where the EL taglibs
aren't necessary.  In any case, if someone really needs this, it is
pretty easy to implement on your own.  If you look at the very simple
code in any of the EL taglibs, you'll see that it would be trivial to do
the same for the nested taglib.  All of the Struts-EL tag
implementations use a very simple pattern that can be easily templated
for a different taglib.  It's not a direct "cut/paste" job, but once you
see the code, I'm sure you'll figure it out.  Don't ignore the BeanInfo
class.  That's important to make sure you can use the same JSP attribute
names as in the base taglib. 

> -----Original Message-----
> From: Laurent Duparchy [mailto:duparchy@esrf.fr] 
> Sent: Wednesday, July 12, 2006 9:17 AM
> To: Struts Users Mailing List
> Subject: Re: taglib nested-el
> 
> 
> Thanks for the response.
> 
> Unless I missed something,  the taglib "nested" is not just a 
> cooler way to access child beans, or access  beans inside, 
> say, collection of collections ;
> 
> The nested taglib allows *_true recursion_ *within JSPs that 
> is not possible otherwise with struts standard nor JSTL.
> 
>     nested is much much more elegant than using "indexed" property. 
> "Indexed' doesn't allow recursion, anyway.
> 
> So, I think a nested-el is desirable and relevant.
> 
> a cool tutorial to nested taglib :
> 
> http://www.keyboardmonkey.com/index.jsp
> 
> It allows something like :
> 
> treenode.jsp
> ...
> 
>   <nested:root>
>  
>     <nested:write property="nodeName" /><br>
>     <nested:iterate property="childCollection">
>       <jsp:include page="treenode.jsp" />
>     </nested:iterate>
>    
>   </nested:root> 
> 
> 
> 
> 
> Lance wrote:
> 
> >There is no nested-el. The struts-nested, struts-logic and 
> struts-bean 
> >tags are pretty much dead. If you're not already, use the 
> JSTL tags as 
> >I'm sure most of the people on this list will tell you.
> >
> >http://java.sun.com/products/jsp/jstl/
> >
> >-----Original Message-----
> >From: Laurent Duparchy [mailto:duparchy@esrf.fr]
> >Sent: 12 July 2006 07:41
> >To: user@struts.apache.org
> >
> >Hi,
> >
> >(Sorry if you already get this message, I'm sure if it had 
> been sent.)
> >
> >is there a taglib "nested-el" ?
> >
> >If not, what is the turnarround to evaluate an expression within a 
> ><nested> tag ?
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >For additional commands, e-mail: user-help@struts.apache.org
> >
> >  
> >
> 

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


Re: taglib nested-el

Posted by Laurent Duparchy <du...@esrf.fr>.
Thanks for the response.

Unless I missed something,  the taglib "nested" is not just a cooler way 
to access child beans, or access  beans inside, say, collection of 
collections ;

The nested taglib allows *_true recursion_ *within JSPs that is not 
possible otherwise with struts standard nor JSTL.

    nested is much much more elegant than using "indexed" property. 
"Indexed' doesn't allow recursion, anyway.

So, I think a nested-el is desirable and relevant.

a cool tutorial to nested taglib :

http://www.keyboardmonkey.com/index.jsp

It allows something like :

treenode.jsp
...

  <nested:root>
 
    <nested:write property="nodeName" /><br>
    <nested:iterate property="childCollection">
      <jsp:include page="treenode.jsp" />
    </nested:iterate>
   
  </nested:root> 




Lance wrote:

>There is no nested-el. The struts-nested, struts-logic and struts-bean tags
>are pretty much dead. If you're not already, use the JSTL tags as I'm sure
>most of the people on this list will tell you.
>
>http://java.sun.com/products/jsp/jstl/
>
>-----Original Message-----
>From: Laurent Duparchy [mailto:duparchy@esrf.fr] 
>Sent: 12 July 2006 07:41
>To: user@struts.apache.org
>
>Hi,
>
>(Sorry if you already get this message, I'm sure if it had been sent.)
>
>is there a taglib "nested-el" ?
>
>If not, what is the turnarround to evaluate an expression within a 
><nested> tag ?
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>  
>

RE: taglib nested-el

Posted by Lance <la...@marketpipe.com>.
There is no nested-el. The struts-nested, struts-logic and struts-bean tags
are pretty much dead. If you're not already, use the JSTL tags as I'm sure
most of the people on this list will tell you.

http://java.sun.com/products/jsp/jstl/

-----Original Message-----
From: Laurent Duparchy [mailto:duparchy@esrf.fr] 
Sent: 12 July 2006 07:41
To: user@struts.apache.org
Subject: taglib nested-el

Hi,

(Sorry if you already get this message, I'm sure if it had been sent.)

is there a taglib "nested-el" ?

If not, what is the turnarround to evaluate an expression within a 
<nested> tag ?



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




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