2008/2/5, Oleg Gorobets <[EMAIL PROTECTED]>: > > Sure, I can use a new definition/preparer for each attribute but that's a > little bit clumsy I guess. If I need to "prepare" every attribute there > will > be a lot of unnecessary definitions.
+1 for the "unnecessary" definitions, but I think that the problem is only in the tiles-defs.xml file. What I mean is that we can still use the Definition class to describe an attribute with a preparer. The difference is that an "anonymous" definition is created whenever an attribute with a preparer is defined in the XML file. For example: <definition name="mydef" template="/mytemplate.jsp"> <put-attribute name="attrib1" value="/firstTile.jsp"/ > <!-- Creates an Attribute of "template" value --> <put-attribute name="attrib1" value="/secondTile.jsp" preparer=" my.package.MyPreparer" /> <!--Creates an attribute of "definition" value, a new "anonymous" definition with the secondTile.jsp as a template and the defined preparer. --> </definition> The second one is a higher abstraction which can be named "attribute > renderer" (as stated in TILES-190). This will allow fully customized > rendering. In fact I was thinking of a "default renderer" dependent on the attribute type, and a custom renderer for the particular attribute. This solution needs a good design though. Anyone is willing to do a Class Diagram? :-) Antonio
