2011/10/10 Kai <[email protected]> > If yes, list.jsp can be reused anywhere (I mean for any kind of picture >> template), as long as you identify all the needed data that each piece >> needs, and pass them always, even if they don't use it. >> >> And how do I change the called template in the XML-definitions? > Do you suggest to define an additional attribute in the specialised > definition, which holds the path to the template and then inject that > attribute to the template-attribute of the <t:insertAttribute>-Tag? >
No. As I understand, you have two choices: * defining several definitions using list.jsp as a template page, in which the "dynamic" attribute is redefined each time (but probably this is what you are trying to avoid, or not?); * using a view preparer for the definition that computes the attribute to put as "dynamic" attribute. > [..] > > I had expected, that the EL would behave in the same way it behaves, when >>> it is written in the<t:insertAttribute>-Tag like in your last mail... >>> >>> >> No, in my example, the EL expression is evaluated then passed to the >> attribute. In your example, the attribute is rendered and, when rendering, >> the EL expression is evaluated (to nothing). >> >> O.k. > I think, I got that now. > > But in my view, it would be a really nice feature, if it would work how I > had it expected to. It would ease the understandig of how the EL-Expressions > in definitions work and it would hugely widen the applicability of > EL-Expressions in definitions. > > I would like to try to implement that behaviour. But I don't know, if I am > able to find the right lines of code, to alter. So far, I debuged my way > into the class, that creates the TilesApplicationContext for the evaluation > of the expression. But I'm lost there - somwhere... > I think that it would be confusing the way you are interpreting use of EL in Tiles. After all, Tiles is <jsp:include> on steroids and usually it behaves as <jsp:include> behaves. And anyway, I doubt that it is even feasible. However, Tiles has already a well-done scope management for attributes, in which attributes in one included page are not visible outside (the implementation is essentially a stack) with the exception of cascaded attributes. Something like this is not available in EL out-of-the-box, because it relies on the 4 standard scopes (page, request, session, application). IIRC there is a way to create additional scopes but, sincerely, I don't know how. Antonio
