Re: Renaming "parameters" to "attributes" in tags

Lukasz Lenart <[email protected]>
Newsgroups gmane.comp.jakarta.struts.devel
Message-ID <CAMopvkMqQ9=+H07gnuXhMmHKxazHR_vQTUxN4fCQDHeuLWUZBg@mail.gmail.com>
Here is the PR addressing this proposal
https://github.com/apache/struts/pull/1067

niedz., 6 paź 2024 o 07:40 Lukasz Lenart <[email protected]> napisał(a):
>
> Hi,
>
> During investigation of issue WW-5452 [1] I discovered that
> "parameters" used in tags templates are not the same as HttpParameters
> aka "parameters" [2] - the name is just coincidence or a bad design.
> A tag instance supposed to be always on top of the ValueStack and
> evaluating "parameters" should reach the tag's "parameters" [3]
> instead of HttpParameters available via ActionContext [4]
>
> My proposal is to rename "parameters" in templates to "attributes" and
> avoid looking for "attributes" in other scopes. Or at least remove
> ActionContext lookup for "parameters" and also in other scopes (rather
> a hack than fix).
> The first approach is safer but breaks all the templates (also all
> existing plugins providing tags), yet those plugins must be updated to
> use JakartaEE anyway.
>
> Any thoughts?
>
> [1] https://issues.apache.org/jira/browse/WW-5452
> [2] https://github.com/apache/struts/blob/master/core/src/main/java/org/apache/struts2/components/Component.java#L500-L502
> [3] https://github.com/apache/struts/blob/master/core/src/main/java/org/apache/struts2/views/freemarker/ScopesHashModel.java#L93
> [4] https://github.com/apache/struts/blob/master/core/src/main/java/org/apache/struts2/views/freemarker/ScopesHashModel.java#L100
>
>
> Cheers
> --
> Łukasz
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.