The nested tags extend the Struts html and logic tags. So to use an OO
analogy, the nested tags is to the logic tags the same way that a Ferrari is
to a car. :P

Nested tags organise two things. The bean reference (the "name" attribute),
and the "property" property. The property property is the most important, as
it's what gets everything mixed up.

You could always have in the original tags...

    <html:text name="myBean" property="one.two[1].three(key).prop" />

...the above being the translation of a nested bean down, an indexed list and
a mapped list. But you have to do this for every tag, and it's very messy.
Getting it all to happen quick and easy is another story. The nested tags mean
you can simply go...

  <nested:root name="myBean">
    <nested:nest property="myBean">
      <nested:iterate property="two">
        <nested:iterate property="two">
          <nested:text property="prop" />
        </nested:iterate>
      </nested:iterate>
    </nested:nest>

...and have the complex property property figured out for you.

The rest of the logic tags simply allow other logic to happen against the
current nested object, like value comparisions etc. If you use nested tags for
the html input, the logic tags will also simplify managing around them.

When it all comes down to it, the nested tags figure out the name and the
property of the current object, and call the super class which is the original
Struts html or logic tag and let them do all the grunt work or writing Html etc.

The keyboardmonkey site has a walk-through/tutorial on them if you want to
start playing.


Arron.



> Nested tags rock whereas logic tags, while perhaps doing
> the same thing are more cumbersome.
> 
> Scoping is much more intuitive - instead of having to talk
> about 'myForm.myContainer.myObject, you can just
> use nested:iterate and nested:nest to make your code
> much easier to read. And, since you can write snippets
> to the more localized scope, they can be reused on multiple
> pages.
> 
> And, if that wasn't enough, you can do recursion with nested.
> 
> See the www.keyboardmonkey.com site for examples, etc.
> 
> -jeff
> 
> On Monday, June 9, 2003, at 08:56  PM, Frances Aleah Z. de Guzman wrote:
> 
> > what is the difference between nested tags and html tags?
> > -- 
> > Frances Aleah Z. De Guzman
> > SA/Programmer
> > Ingenium Technology, Inc.
> > http://www.ingenium.com.ph
> >
> > Disclaimer :
> > This message is intended only for the named recipient. If you are not 
> > the
> > intended recipient you are notified that disclosing, copying, 
> > distributing
> > or taking any action in reliance on the contents of this information is
> > strictly prohibited.
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to