You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (Jira)" <ji...@apache.org> on 2026/10/22 08:01:00 UTC
[jira] [Commented] (WW-3835) use TemplateDirectiveModel instead of TemplateTransformModel in org.apache.struts2.views.freemarker.tags.TagModel.
[ https://issues.apache.org/jira/browse/WW-3835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18130190#comment-18130190 ]
Lukasz Lenart commented on WW-3835:
-----------------------------------
Moving this to 8.0.0.
{{TemplateTransformModel}} is not deprecated in FreeMarker 2.3.x, which is the version Struts uses (2.3.35). FreeMarker 2.4 was never released. Only the unreleased FreeMarker 3 branch removes the interface, so nothing forces this change yet.
The switch also changes public extension points, which makes it a breaking change:
* {{TagModel.getWriter(Writer, Map)}} is public and can be overridden by custom tag models.
* {{CallbackWriter}} is public and implements {{TransformControl}}.
* The iterator tag relies on {{REPEAT_EVALUATION}}, and {{CallbackWriter}} buffers the tag body before calling {{Component.end}}. A {{TemplateDirectiveModel}} would need to reimplement both as a loop over {{TemplateDirectiveBody.render()}}.
A major release is the right place for this.
> use TemplateDirectiveModel instead of TemplateTransformModel in org.apache.struts2.views.freemarker.tags.TagModel.
> ------------------------------------------------------------------------------------------------------------------
>
> Key: WW-3835
> URL: https://issues.apache.org/jira/browse/WW-3835
> Project: Struts 2
> Issue Type: Improvement
> Reporter: Yanming Zhou
> Priority: Major
> Fix For: 8.0.0
>
>
> http://freemarker.sourceforge.net/docs/api/freemarker/template/TemplateTransformModel.html
> Objects that implement this interface can be used as user-defined directives (much like macros); you should rather use the newer TemplateDirectiveModel instead. Altough implementing output filters is more handy with this interface, this interface will be certainly deprecated as superfluous, starting from FreeMarker 2.4. But as far as the template engine is concerned, you can use both equivalently as a user-defined directive.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)