Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 38C69108F4 for ; Thu, 13 Mar 2014 06:05:50 +0000 (UTC) Received: (qmail 11064 invoked by uid 500); 13 Mar 2014 06:05:49 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 10710 invoked by uid 500); 13 Mar 2014 06:05:48 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 10502 invoked by uid 99); 13 Mar 2014 06:05:43 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Mar 2014 06:05:43 +0000 Date: Thu, 13 Mar 2014 06:05:43 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (WW-4301) includeProperties Does Not Work with a List of Lists MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4301: ------------------------------ Fix Version/s: 2.3.x > includeProperties Does Not Work with a List of Lists > ---------------------------------------------------- > > Key: WW-4301 > URL: https://issues.apache.org/jira/browse/WW-4301 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - JSON > Affects Versions: 2.3.16 > Reporter: Andrew Bernhagen > Priority: Minor > Labels: json > Fix For: 2.3.x > > Original Estimate: 24h > Remaining Estimate: 24h > > I found this issue when using server-side processing with JQuery Datatables and attempting to populate. > Say I have this getter/field on my action: > public List> getListOfLists() { > return listOfLists; > } > My struts.xml is defined as follows: > class="com.example.web.action.WebAction"> > > false > listOfLists\[\d+\]\[\d+\] > > > However, the include patterns that are constructed within JSONUtil are not accurate. Instead of making the expected pattern that would work: > listOfLists > listOfLists\[\d+\] > listOfLists\[\d+\]\[\d+\] > Only the following are created: > listOfLists\[\d+\] > listOfLists\[\d+\]\[\d+\] > Because the first "listOfLists" is not created, the property is excluded in the results. > This all happens because of line 463 in JSONUtil: > addPattern(results, patternExpr.substring(0, patternExpr.lastIndexOf(includePatternData.get(ARRAY_BEGIN_STRING).get(type))), type); > Since we're going at the last index of the ARRAY_BEGIN_STRING string, it's skipping the first index. This could be updated to be smarter to build the include patterns as expected. -- This message was sent by Atlassian JIRA (v6.2#6252)