Return-Path: Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: (qmail 31729 invoked from network); 10 Aug 2009 22:37:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Aug 2009 22:37:23 -0000 Received: (qmail 3348 invoked by uid 500); 10 Aug 2009 22:37:30 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 3284 invoked by uid 500); 10 Aug 2009 22:37:30 -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 3276 invoked by uid 99); 10 Aug 2009 22:37:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Aug 2009 22:37:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Aug 2009 22:37:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 9A4B229A0011 for ; Mon, 10 Aug 2009 15:36:59 -0700 (PDT) Message-ID: <1663058090.1249943819630.JavaMail.jira@brutus> Date: Mon, 10 Aug 2009 15:36:59 -0700 (PDT) From: "Musachy Barroso (JIRA)" To: issues@struts.apache.org Subject: [jira] Resolved: (WW-3188) Don't render action errors/messages when have null message In-Reply-To: <508958006.1247584738939.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 2265bf7ad70cb93affdfde3e15287371 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/struts/browse/WW-3188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Musachy Barroso resolved WW-3188. --------------------------------- Resolution: Fixed fixed in trunk. The errors/messages will be printed only if the list contains at least one non blank(null or empty string) element > Don't render action errors/messages when have null message > ---------------------------------------------------------- > > Key: WW-3188 > URL: https://issues.apache.org/struts/browse/WW-3188 > Project: Struts 2 > Issue Type: Improvement > Affects Versions: 2.1.6 > Environment: Freemarker > Reporter: Jasper Rosenberg > Priority: Minor > Fix For: 2.1.8 > > > Often I will end up passing an actionMessage to be rendered via an url such as: > http://www.myco.com/myapp/doit.action?actionMessages=Display+This+Message > This message is often set dynamically in the result for a redirect, for example: > http://www.myco.com/myapp/doit.action?actionMessages=${actionMessages[0]} > But of course there may be no actionMessage actually available, and so the url ends up: > http://www.myco.com/myapp/doit.action?actionMessages= > In this case we end up with one null action message in the actionMessages list, and so when you use the actionmessage tag, you get a list with "null" as the message. > I worked around this by just overriding the actionmessage.ftl and actionerror.ftl templates to check that if the list has content, the first element also "?has_content". This isn't terribly general though. > I think a decent improvement would be to just check each action message with ?has_content (which checks for null and empty string) as you iterate and only render the "li" if it is true. Then just only output the starting "ul" when hit the first one, and the terminating ul if there was a message with content found. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.