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 0885E1024B for ; Tue, 27 Jan 2015 08:00:56 +0000 (UTC) Received: (qmail 72510 invoked by uid 500); 27 Jan 2015 08:00:56 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 72475 invoked by uid 500); 27 Jan 2015 08:00:56 -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 72277 invoked by uid 99); 27 Jan 2015 08:00:55 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Jan 2015 08:00:55 +0000 Date: Tue, 27 Jan 2015 08:00:55 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4453) tag doesn't report missing value 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-4453?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14293149#comment-14293149 ] ASF subversion and git services commented on WW-4453: ----------------------------------------------------- Commit cd0d8de67aacc531dbf2d5a9840b55ff46bcc817 in struts's branch refs/heads/develop from [~lukaszlenart] [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=cd0d8de ] WW-4453 Reports missing value > tag doesn't report missing value > ------------------------------------------ > > Key: WW-4453 > URL: https://issues.apache.org/jira/browse/WW-4453 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - Tags > Affects Versions: 2.3.21 > Reporter: Lukasz Lenart > Assignee: Lukasz Lenart > Fix For: 2.3.22 > > > If you pass a value which isn't {{Date}} or {{Calendar}}, the {{}} ignores it and doesn't report any problems. The problem is here > {code:java} > public boolean end(Writer writer, String body) { > String msg; > java.util.Date date = null; > // find the name on the valueStack > try { > //suport Calendar also > Object dateObject = findValue(name); > if (dateObject instanceof java.util.Date) { > date = (java.util.Date) dateObject; > } else if(dateObject instanceof Calendar){ > date = ((Calendar) dateObject).getTime(); > } > } catch (Exception e) { > LOG.error("Could not convert object with key '#0' to a java.util.Date instance", name); > } > {code} > there must additional {{else}} clause to report missing value, ie: > {code:java} > if (dateObject instanceof java.util.Date) { > date = (java.util.Date) dateObject; > } else if(dateObject instanceof Calendar){ > date = ((Calendar) dateObject).getTime(); > } else { > LOG.error(...); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)