[ https://issues.apache.org/struts/browse/WW-2333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43623#action_43623 ]
Jeff Brown commented on WW-2333: -------------------------------- Understand the convenience method, but since it does not adhere to the expected Java behavior, reports must be tailored specifically for Struts2 and would not work correctly when run from other frameworks or clients - for example iReport. A flag is probably the way to go because it needs to be somewhat backwardly compatible no matter what. I would vote for the default behavior following the expected Java behavior of a Collection returning a Collection and the flag would cause it to return a ValueStackDataSource if desired for convenience. But, if you feel strongly the other way for seamless backward compatibility, I understand. > ValueStackDataSource implementation leads to class cast exceptions > ------------------------------------------------------------------ > > Key: WW-2333 > URL: https://issues.apache.org/struts/browse/WW-2333 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - JasperReports > Affects Versions: 2.0.11 > Reporter: Thorsten Schäfer > Fix For: Future > > > Assume you have a class Foo that has a Collection of Bar's. Without using > Struts, the expected behavior of a report that takes Foo's as input is, that > a reference $F{bar} returns a java.util.Collection (of Bar's). However, this > will not be the case when using the ValueStackDataSource implementation; an > instance of ValueStackDataSource is returned instead of a collection. If the > method "getFieldValue" gets called, it checks if the field value is > iteratable (which is true for collections) and then returns a new > ValueStackDataSource instead of the field value itself. I assume that this > behavior breaks many reports. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.