You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Néstor Boscán <ne...@tcs.com.ve> on 2005/05/20 16:52:26 UTC

Using html:text with java.util.Date property

Hi

I'm trying to use the html:text tag with date properties and I'm getting
java.lang.IllegalArgumentException: type mismatch. Any ideas?

Regards,

Néstor Boscán




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


RE: Using html:text with java.util.Date property

Posted by Néstor Boscán <ne...@tcs.com.ve>.
Hi Rick

Thanks for the quick answer. Basically the exception is thrown when calling
the action associated with the DynaActionForm. I want to be able to let the
DynaActionForm populate my DTO objects. Some of these objects have dates. 

Regards,

Néstor Boscán

-----Mensaje original-----
De: Rick Reumann [mailto:struttin@reumann.net] 
Enviado el: Friday, May 20, 2005 12:05 PM
Para: Struts Users Mailing List
Asunto: Re: Using html:text with java.util.Date property

Néstor Boscán wrote the following on 5/20/2005 10:52 AM:

> I'm trying to use the html:text tag with date properties and I'm 
> getting
> java.lang.IllegalArgumentException: type mismatch. Any ideas?

Where are you getting this error, when trying to put your form bean
properties into a value object? Are you using Bean/PropertyUtils? If so,
you'll need to register a converter in order to convert your string date to
a java.util.date (java.sql.date it has by default). I can point you in the
right direction if that's where you are having the trouble, but need a bit
more info as to where you are running into the problem.


--
Rick

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




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


Re: Using html:text with java.util.Date property

Posted by Rick Reumann <st...@reumann.net>.
Néstor Boscán wrote the following on 5/20/2005 10:52 AM:

> I'm trying to use the html:text tag with date properties and I'm getting
> java.lang.IllegalArgumentException: type mismatch. Any ideas?

Where are you getting this error, when trying to put your form bean 
properties into a value object? Are you using Bean/PropertyUtils? If so, 
you'll need to register a converter in order to convert your string date 
to a java.util.date (java.sql.date it has by default). I can point you 
in the right direction if that's where you are having the trouble, but 
need a bit more info as to where you are running into the problem.


-- 
Rick

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


RE: Using html:text with java.util.Date property

Posted by "Freddy Villalba A." <fv...@pericless.com>.
Hello Nestor,

Personally, I consider it a good practice - and simpler - to handle dates as
String objects (in the presentation layer, that is). This will save you lots
of server-side-headaches and ease your way, especially when you have to face
internationalization issues (for instance, different date formats).
Formatting your data on the server's side will save you some time,
especially when you present the same data in several places. The only
important implication I'd see with this approach is the impact that it could
have on client-side components that depend on this data (such as calendars),
but then, if those also handle i18n issues, then there shouldn't be such
impact (or it should be minimum).

My humble opinion,
Freddy.


-----Mensaje original-----
De: Néstor Boscán [mailto:nestor.boscan@tcs.com.ve]
Enviado el: viernes, 20 de mayo de 2005 16:52
Para: 'Struts Users Mailing List'
Asunto: Using html:text with java.util.Date property


Hi

I'm trying to use the html:text tag with date properties and I'm getting
java.lang.IllegalArgumentException: type mismatch. Any ideas?

Regards,

Néstor Boscán




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


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