[
https://issues.apache.org/struts/browse/WW-1133?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ted Husted resolved WW-1133.
----------------------------
Resolution: Not A Problem
> Deprecate the ww:push tag
> -------------------------
>
> Key: WW-1133
> URL: https://issues.apache.org/struts/browse/WW-1133
> Project: Struts 2
> Issue Type: Improvement
> Components: Views
> Affects Versions: WW 2.2
> Reporter: Gabriel Zimmerman
> Fix For: Future
>
>
> I think it would be an improvement for webwork to deprecate the push tag, and
> perhaps modify how the iterator tag places each iterated object on the stack
> by setting as discussed in XW-329, making the ww:iterator tag work more like
> the JSTL iterator tag in that respect.
> The reasons "setting" is better in my opinion than "pushing" for views are
> the following:
> 1) When you see a set object, it gives you the context of where it is coming
> from. <ww:property value="child.name"/> is more descriptive than simply
> <ww:property value="name"/>
> 2) With pushing, there is a large possibility of clashing of property names.
> If I inadvertently push a "parent" object on the stack and later push a
> "child" object on the stack, then <ww:property value="name"/> would give you
> the child's name, there would be no way of accessing the parent's.
> 3) Setting is probably somewhat better for performance than pushing is. When
> XWork searches on the stack for a pushed Object, it looks at all the
> properties of each object until it finds the latest on the stack. That amount
> of introspection is bad for performance, worse, at least than if it had to
> look up "child" in a Map, where a Map was the latest object on the stack (as
> it would be if setting was done as discussed in XW-329.
> 4) It would be easier to implement "track back" features without pushing. If
> you have a <ww:property value="name"/>, it would be harder to find where that
> name came from than if you have <ww:property value="child.name"/>, where
> "child" was set sometime earlier.
> 5) It simplifies the API by removing a technology that adds nothing (pushing
> adds nothing to setting when doing so within a given JSP)
> 6) It makes the API closer to JSTL, which makes it simpler to explain to a
> user who knows JSTL.
> Thus, overall, I propose that the pushing should be done for actions onto the
> stack, but only setting should be done within a given JSP.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.