2010/12/10 Nathan Bubna <nbu...@gmail.com>:
> I haven't actually looked at the autotag stuff.  Can you give an
> example usecase?

Write this:
<snip>
public class PutAttributeModel {

    public void execute(@Parameter(required = true) String name, Object value,
            String expression, String role, String type, boolean cascade,
            Request request, ModelBody modelBody) throws IOException {
        Deque<Object> composeStack = ComposeStackUtil.getComposeStack(request);
        Attribute attribute = new Attribute();
        composeStack.push(attribute);
        String currentBody = modelBody.evaluateAsString();
        TilesContainer container = TilesAccess.getCurrentContainer(request);
        attribute = (Attribute) composeStack.pop();
        putAttributeInParent(attribute, container, composeStack, name,
                value, expression, currentBody, role, type, cascade, request);
    }
</snip>

And automatically have JSP tags, Freemarker directive models and
Velocity directive (one parameter: a map) mapping all that parameters.
Notice the compose stack (allows to nest tags between them in a
technology agnostic way), the Request (request abstraction) and
ModelBody (tag/directive body abstraction).
No more implicit parameter maps, no more TLDs to write, only a simple
"execute" method with explicit parameters.

Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org

Reply via email to