struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frost, Gary [IT]" <Gary.Fr...@ssmb.com.au>
Subject Dates in Form Objects
Date Mon, 03 Feb 2003 06:56:54 GMT
Hi,

I've got struts going using a nightly build from about a month ago.

Anyway, I'd like to have a form

public class InputForm extends Form
	{
	Integer 		volume;
	java.util.Date 	transferDate;
	String		notes;
	}

And on a JSP page, effectively
	<table>
	<tr><td>Volume</td><td><html:text property="volume" /></td></tr>
	<tr><td>Transfer Date</td><td><html:text  property="transferDate"
size="8" styleId="tradeDate"/>dd/mm/yyyy
<td></tr>
	<tr><td>Notes</td><td><html:text property="notes"/></td></tr>


So that 
	a) When the JSP is called, if the values are completed (not null)
then they are correctly rendered to the page, i.e. how can I have an
appropriate date formatter in their (I am also using JSTL, so would be happy
to put <f:fmt> in their somewhere).
	b) When the page is submitted, the form converts the transferDate
into a java.util.Date object.

At the moment I am getting an exception in  BeanUtils.populate

But looking at the BeanUtils javadoc I should be able to do something with
org.apache.commons.beanutils.locale.converters.DateLocaleFormater correct?
All input greatly appreciated.

Thanks
Gary


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message