Dynamic trees in the dojo plugin causes a freemarker error if the child 
property returns null
---------------------------------------------------------------------------------------------

                 Key: WW-2465
                 URL: https://issues.apache.org/struts/browse/WW-2465
             Project: Struts 2
          Issue Type: Bug
          Components: Plugin - Dojo Tags
    Affects Versions: 2.1.1
            Reporter: Al Sutton
         Attachments: dojo_dynamic_tree_null_children_fix.patch

If the property specified in the childProperty for an s:tree returned a null 
the following freemarker error occurs;

Expression stack.findValue(parameters.childCollectionProperty.toString()) is 
undefined on line 24, column 8 in template/ajax/treenode-include.ftl.
The problematic instruction:
----------
==> list stack.findValue(parameters.childCollectionProperty.toString()) as 
child [on line 24, column 1 in template/ajax/treenode-include.ftl]
 in include "/${parameters.templateDir}/ajax/treenode-include.ftl" [on line 26, 
column 5 in template/ajax/treenode-include.ftl]
 in include "/${parameters.templateDir}/ajax/treenode-include.ftl" [on line 26, 
column 5 in template/ajax/treenode-include.ftl]
 in include "/${parameters.templateDir}/ajax/treenode-include.ftl" [on line 
124, column 5 in template/ajax/tree.ftl]
----------

The attached patch fixes this problem by using a empty list as the default if a 
null is returned.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to