Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 30621 invoked from network); 31 May 2006 17:47:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 May 2006 17:47:10 -0000 Received: (qmail 57484 invoked by uid 500); 31 May 2006 17:47:08 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 57420 invoked by uid 500); 31 May 2006 17:47:08 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 57408 invoked by uid 99); 31 May 2006 17:47:07 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 May 2006 10:47:07 -0700 X-ASF-Spam-Status: No, hits=2.1 required=10.0 tests=SPF_HELO_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [64.190.72.22] (HELO mail.mikon.com) (64.190.72.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 May 2006 10:47:02 -0700 Message-ID: <447DD68D.7080202@apache.org> Date: Wed, 31 May 2006 13:46:53 -0400 From: Paul Spencer MIME-Version: 1.0 To: MyFaces Development Subject: Re: ClassCastException when setting timeZone attribute in using EL References: <447DBCD4.7030606@apache.org> <71235db40605310945j2c8f4278p3fc649f40306fd43@mail.gmail.com> <447DCC0A.2000206@apache.org> In-Reply-To: <447DCC0A.2000206@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Matthias, When I changed my method getTimeZone() to return a TimeZone, things worked as expected. I guess my confusion comes from the TLD Documentation, http://myfaces.apache.org/impl/tlddoc/index.html. "When this value is a value-binding to a TimeZone instance, that timezone is used. Otherwise this value is treated as a String containing a timezone id, ie as the ID parameter of method java.util.TimeZone.getTimeZone(String)." I read this to mean that the converter would converter would treat String value-binding the same way as a String value. Below is a coded version of my expectation. if (UIComponentTag.isValueReference(value)) { ValueBinding vb = facesContext.getApplication().createValueBinding(value); TimeZone timeZone; Object value = vb.getValue(facesContext); if (value instanceof TimeZone) { timeZone = (TimeZone) value; } else { timeZone = TimeZone.getTimeZone(value.toString()) } converter.setTimeZone(timeZone); } Is my expectation in keeping with the spec? If it is case should I enter a JIRA issue? Paul Spencer Paul Spencer wrote: > The type is string > public String getTimeZone() > { > return "GMT-05:00"; > } > > Paul Spencer > > Matthias Wessendorf wrote: >>> >> timeZone="#{phrQueryManager.timeZone}"/> >> >> Is this type of TimeZone ? >> >> *snip* >> if (UIComponentTag.isValueReference(value)) >> { >> ValueBinding vb = >> facesContext.getApplication().createValueBinding(value); >> converter.setTimeZone((TimeZone)vb.getValue(facesContext)); >> } >> *snip* >> >> Regards, >> Matthias >> > > >