I was thinking more of the following situation: <ww:bean id="dateFormatter" name="'webwork.util.DateFormatter'"> <ww:param name="date" value="'illegal'" /> <ww:property value="formattedDate" /> </ww:bean>
This shows no errors (to the user or the server side logs) and prints out the current date. --Erik On Thu, 7 Nov 2002, Maurice C. Parker wrote: > > On Wednesday, November 6, 2002, at 08:38 PM, Erik Beeson wrote: > > > http://jira.opensymphony.com/secure/ViewIssue.jspa?key=WW-84 > > > >> If an invalid date text is submitted the attribute will > >> get the current date, while a null value is more appropriate. > > > >> The problem is in the DateFormatter constructor where the > >> "date" variable is initialized to "new Date()" > > > > While I see how this could be an issue, setDate does through an > > IllegalArgumentException if the date was invalid. > > I'm not sure this is a bug after all. The IllegalArgumentException > thrown by DateFormatter causes the setValue method call in DateEditor > to be bypassed. See this code snippet from DateEditor. > > public void setAsText(String txt) { > try { > DateFormatter formatter = new DateFormatter(); > > try { > > formatter.setParser(DateFormat.getDateInstance(DateFormat.SHORT, > ActionContext.getContext().getLocale())); > } catch (Exception e) { > //ignore, use default parser > } > > formatter.setDate(txt); > setValue(formatter.getDate()); > } catch (Exception e) { > throw new IllegalArgumentException("Unable to set value for " > + txt); > } > } > > I used a debugger on the BeanUtilTestCase and the setObjDate method did > get called on valid dates, but did not get called when an invalid date > was submitted. > > Please double check my work, but I'm pretty sure there's not really a > bug here. > > -Maurice > > > > ------------------------------------------------------- > This sf.net email is sponsored by: See the NEW Palm > Tungsten T handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork