struts-user mailing list archives

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

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
	<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
	<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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message