Re: S2 type conversion problem with generics

2008-08-20 Thread Jukka Välimaa
A look into documentationsolved this. Apparently Struts 2 only supports generics for Collections or arrays. On Wed, Aug 20, 2008 at 9:32 PM, Chris Pratt <[EMAIL PROTECTED]>wrote: > Are you sure they do?

Re: S2 type conversion problem with generics

2008-08-20 Thread Chris Pratt
Are you sure they do? Or is it just recognizing that it's a Collection and treating it appropriately for a Collection of Objects? (*Chris*) On Wed, Aug 20, 2008 at 10:16 AM, Jukka Välimaa <[EMAIL PROTECTED]>wrote: > Sounds reasonable, thanks for the answer. But why do the generics used in > ja

Re: S2 type conversion problem with generics

2008-08-20 Thread Jukka Välimaa
Sounds reasonable, thanks for the answer. But why do the generics used in java collections work with type conversion, and generics in my custom class won't? On Wed, Aug 20, 2008 at 7:06 PM, Chris Pratt <[EMAIL PROTECTED]>wrote: > My bet is that, because Struts uses run-time introspection to deter

Re: S2 type conversion problem with generics

2008-08-20 Thread Chris Pratt
My bet is that, because Struts uses run-time introspection to determine how to pass the parameters, and the new Java Generics use type erasure to ensure backward portability, what Struts see's isn't your generic type, it's an Object. So it passes in the unconverted value that it got from Request.g

S2 type conversion problem with generics

2008-08-20 Thread Jukka Välimaa
Hi all, I have the following problem which I think is caused by Struts 2 type conversion. I have a class I use to wrap a map for easier interface with view: public class ObjectWeekHandler { private Map weekDayObjects = new HashMap(); public Map getWeekDayObjects() { return weekD