I'm not sure if this is what you're looking for, but I just have a
setStrDate(String strDate) method and do the conversion yourself. Set your
form property to strDate. First test for nullness (if such a thing exists)
and set the date to something your validation rules will pickup.
Z.
Thanks
On 11/16/05, Jesus Salvo Jr. [EMAIL PROTECTED] wrote:
Thanks ... I sort of worked around it by using java.sql.Date instead,
since the built-in converts in commons-beanutils does not really have a
java.util.Date converter,
only a java.sql.Date converter.
However, I still have one problem
The problem is the use of a Date type for the form property. The first
thing Struts does is populate the form bean from the request; this has
to happen before validation, so the validation has a form to work with.
This is one of the many reasons it's recommended to make your form bean
Struts 1.2.7
How do u use a ActionForm formbean with a java.util.Date as a property ?
The form bean is defined as follows in struts-config.xml:
form-bean name=campaignForm
type=com.mig.provisioning.CampaignForm/
.. and the actual bean has the following methods:
public void
Here is some replies when I asked the same question before, hope it helps.
Regards
- Original Message -
From: JEROME RAULINE [EMAIL PROTECTED]
To: Yujun Liang [EMAIL PROTECTED]
Sent: Friday, October 28, 2005 6:53 PM
Subject: java.util.Date in Action Form Bean
Hi,
You'd better use a
Thanks ... I sort of worked around it by using java.sql.Date instead,
since the built-in converts in commons-beanutils does not really have a
java.util.Date converter,
only a java.sql.Date converter.
However, I still have one problem with this.
If a user leave the date field empty in the
The exception happens before validation.
I aksed the same question before and I didn't get a clean solution yet, so
far, if you define it as a java.sql.Timestamp, you have to provide an input
in -mm-dd hh:mm:ss.f format
Did you try beanDef? Maybe you can change the default
The exception happens before validation.
I aksed the same question before and I didn't get a clean solution yet, so
far, if you define it as a java.sql.Timestamp, you have to provide an input
in -mm-dd hh:mm:ss.f format
Did you try beanDef?
Or maybe you can change the default
8 matches
Mail list logo