Hi Antonio,
Nice to see you're still around!
Concerning put/add-attribute... I'd like to look at some use cases.
There is this one in our selenium test suite:
https://github.com/apache/tiles/blob/TILES_3_0_X/tiles-test-pom/tiles-test/src/main/webapp/testinsertdefinition_inline.jsp
but I think we should look at something more complex.
What do you think of this one:
<c:forEach var="line" items="${orderLines}">
<tiles:insertDefinition name="orderLine">
<tiles:putAttribute name="description">
Item ${line.number}: ${line.product.name} for ${line.price} €
</tiles:putAttribute>
</tiles:insertDefinition>
</c:forEach>
Is this the kind of thing you mean when you talk about moving
JSPFragments around the request?
As for the "body renderer"... I like it, but I don't line the map with a
"generated name" in the request.
I think we could just put the renderer as the value of the new attribute
object that we create in putAttribute?
My 2 cents,
Nick
On 05/30/2016 09:03 AM, Antonio Petrelli wrote:
Hello everyone!
I wish to inform you that I am developing an application with Tiles 3
again. I don't know if I will help in development, but it is nice to see
something familiar :-D
Now the real question.
Currently the body in PutAttributeModel and AddAttributeModel is turned
into a string and then set as a string value for the attribute.
I think that this way of "serialization" is inefficient since the body is
put in memory without real need. I think the best thing is to create a
"body renderer" that acts like any other renderer. Since the
Renderer.render wants a string as a first parameter, I think that a map:
"generated name" -> body
should be created in request scope. The name could be generated like in:
CachingTilesContainer.getNextUniqueDefinitionName
Do you think it is feasible. I mean, I guess that bodies of all supported
technologies (JspFragment for JSP, ASTBlock for Velocity, TemplateDirectiveBody
for Freemarker) can be moved around in the request and their evaluation is
still correct, or not? Is there anything that I am missing?
Moreover, the body can be evaluated at the "right" point, i.e. where the
attribute is inserted, not where the attribute is put.
WDYT?
Moreover, since I am emeritus and I don't know if I will contribute much,
what is the best thing to do for me? Should I fork a project in GitHub or
resurrect my account for Tiles?
Thanks in advance
Antonio Petrelli