Marty,
Thanx for the response , thats what i am doing for now. I just wanted to
know if its possible to do the way i am suggesting .

Thanx
Ivan

-----Original Message-----
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Sunday, December 21, 2003 3:21 PM
To: Struts Users Mailing List
Subject: Re: Multiple Converters for the same class type


Ivan
Take a look at Matt Raible's rather elegant solution for registering
multiple ConvertUtils by implementing Converter
public Object convert(Class type, Object value)  method
http://raibledesigns.com/page/rd/20030111
Hope this helps,
Martin
----- Original Message -----
From: "Ivan De La Pena" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 20, 2003 6:45 PM
Subject: Multiple Converters for the same class type


Guys,

I have a situation where i get a date from the Database in String format , i
have created a custom converter (and registered it ) which creates a Date
object out of that String.....now i have a new situation to take care of the
same date is to be represented in the JSP page as a long. I am going to
create  another converter that takes a long and converts into Date.

Now my question is , is it possible to register two converters for the same
Date ??

So can i do this :
                      ConvertUtils.register(new StringtoDateConverter(),
Date.class)
                      ConvertUtils.register(new LongtoDateConverter(),
Date.class)

If this works....then i have no issues to take care of.....my Date object
gets created just fine from the backend (from String) and the front end
(from a long)...and i guess the Converter that got registered first , would
get precedence over the other.

If it is possible, and what are the pitfalls ??

Thanx
Ivan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to