Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 19210 invoked from network); 14 Jul 2009 06:17:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Jul 2009 06:17:42 -0000 Received: (qmail 33581 invoked by uid 500); 14 Jul 2009 06:17:49 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 33526 invoked by uid 500); 14 Jul 2009 06:17:48 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 33516 invoked by uid 99); 14 Jul 2009 06:17:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jul 2009 06:17:48 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of thechrispratt@gmail.com designates 209.85.221.201 as permitted sender) Received: from [209.85.221.201] (HELO mail-qy0-f201.google.com) (209.85.221.201) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jul 2009 06:17:41 +0000 Received: by qyk39 with SMTP id 39so2366939qyk.23 for ; Mon, 13 Jul 2009 23:17:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=8Elh+myQTjXacMTVOxtBzEeAonaPuG006PxseJ/5o60=; b=HhEcqjEhcJYyubrBDrZcb0GXDSVkYUiC8d4z3BNNGcolnVUrvGAZwseg4+nBFQKWFq 7ocR/KllVNGYrPRY0u0mnFzUyblrlgvxTM2TvPjMFk4w3sJ7SWq3YAiH3JwdoFIJ5JA0 iw8tChRzQ1JGiv3KlwzhyuVoCwY4CuwO1pfKg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=V16FHCQ4qSmFt6fUGnXkVSr6QC0hbnmUPE5c40BpkCwAmSU3VU1mGDT2kTPMBdAbMQ C/KLb/VH0YUVrorE60YwO9hOIxVZhSea0fGsfvy9MTJWU6hef5frHFg43kN1NvOY3wxj m8Mi6JinziQEd9REC+NTJTNjVkmyLgFxe4Yo4= MIME-Version: 1.0 Received: by 10.229.84.201 with SMTP id k9mr1104514qcl.84.1247552240001; Mon, 13 Jul 2009 23:17:20 -0700 (PDT) Date: Mon, 13 Jul 2009 23:17:19 -0700 Message-ID: <42db7f0a0907132317l114574f3pda134022a7d19f4b@mail.gmail.com> Subject: JSON Plugin and S:Action From: Chris Pratt To: Struts Users Mailing List Content-Type: multipart/alternative; boundary=0016364ee2ea1aa388046ea4646b X-Virus-Checked: Checked by ClamAV on apache.org --0016364ee2ea1aa388046ea4646b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I'm having a problem using with an action whose result type is json. It doesn't insert the results. My Action is something like: public class InitCalendarAction { private List> json; /** * Get the JSON Object to be Serialized * * @return JSON Object */ public Object getJson () { return json; } //getJson /** * Prepare the Object to be Serialized using JSON * * @return "success"; */ public String execute () { Category cat; Category[] daily = user.getPlan().getDailyCategories(); Calendar cal = Calendar.getInstance(); cal.set(Calendar.DATE,1); int first = cal.get(Calendar.DAY_OF_WEEK) - 1; List row; json = new ArrayList>(); for(int day = 1;day <= cal.getMaximum(Calendar.DATE);day++) { row = new ArrayList(); row.add("true"); cat = daily[(day + first) % 7]; row.add(cat.name().toLowerCase()); row.add(cat.name()); json.add(row); } return "success"; } //execute } //*InitCalendarAction I have the action defined as: json In my JSP, I have: var hilights = ""; But instead of the expected: var hilights = "[ [ "true", "cardio", "Cardio"], [ "true", "upperbody", "Upper Body"] ... ]"; I get: var hilights = ""; There are no errors in the logs and when I write out each row in the array, everything is there as expected, but there's just no output. Any idea's why? (*Chris*) --0016364ee2ea1aa388046ea4646b--