tiles-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Petrelli" <antonio.petre...@gmail.com>
Subject Re: [Tiles2] JSTL functions for Tiles taglib?
Date Fri, 26 Jan 2007 14:58:04 GMT
Again sorry for the bad-styled reply...

Joe Germuska <joe@germuska.com> wrote:
Today on the struts user list, someone asked a question about the PutList
tag which relates to something which is fixed in there.

Essentially, if you have a "tiles:putAttribute" tag I think that you
need also a "tiles:putAttributeList", and the "putList" element in
tiles-defs.xml must be renamed accordingly. Anyway I think that the
"attribute" word makes those tags clearer.

Can we wrap up that previous thread -- Antonio, hope you're not super busy
right now -- I'd mostly like to hear if you still have concerns about the
changes which were made which would make it premature to build a new
SNAPSHOT based on SVN head.

I still think that renaming "tiles:attribute" in
"tiles:importAttribute" was not a good idea, see below.

On 1/16/07, Joe Germuska <joe@germuska.com> wrote:
> If I use "<tiles:insertAttribute name="foo" /> and Foo was defined as a
> string, the end result is a visible string in the page.  I have trouble
> perceiving that as a definition, while it naturally fits my concept of
> "insert."

What do you mean? An attribute can be anything (string, name of a
definition, etc.), eventually it depends on the "type" attribute.

> Perhaps your concern is that there might be some indeterminacy between
> whether any given attribute value might refer to a specific definition or is
> actually intended as a mere string value.  I'm open to the position that
> this is unnecessarily confusing, although my current feeling is that that's
> not such a serious problem.

With "confusion" i meant that the "tiles:insertAttribute" tag could be
used as you use insertDefinition and insertTemplate, but they are not
the same! Attributes are the core of the whole Tiles, they define the
"holes" to fill with values. Templates are pages with attributes, and
definitions are templates with filled attributes.

> The original point, however, was that it is valuable to be able to have a
> tag which inserts content based on an attribute's value whether that value
> is a "template" (any valid servlet path) or a "definition" (something which
> Tiles can use to invoke a servlet include including other tilesprocessing.)
> If the tag which does this never includes a literal string, I would not
> find that a big problem.  But if I need to know ahead of time whether I want
> to insert a template or a definition, I think that's a shortcoming.

I had a similar requirement when modifying the showcase: I have an
attribute filled with putList and I have a list of strings, sometimes
they are templates, sometimes they are definitions.
In this particular case I would like to separate the concept of
attribute from the concept of "attribute value" (I will open a new
thread for this), but maybe you're right, a <tiles:insert> tag (as it
was before the refactoring) that chooses to show a template OR a
definition (but not an attribute) could be useful sometimes.


View raw message