tags:

views:

144

answers:

2

I have a problem with map and list in GWT. I need to put a map in to a list but GWT does not support ArrayList and HashMap since they are not serialized types. Exactly I want to create following list with out using ArrayList and HashMap

ArrayList<HashMap<String, Object>> map = new ArrayList<HashMap<String,Object>>();

Thank you for new ideas,

Regards

+2  A: 

Are you sure that's the problem? Maybe you don't conform with other serialization requirements? Like a no-arg constructor?

From the docs:

A user-defined class is serializable if all of the following apply:

  1. It is assignable to IsSerializable or Serializable, either because it directly implements one of these interfaces or because it derives from a superclass that does
  2. All non-final, non-transient instance fields are themselves serializable, and
  3. As of GWT 1.5, it must have a default (zero argument) constructor (with any access modifier) or no constructor at all.
Igor Klimer
+2  A: 

You are using Object in your Hashmap. The Object class is not Serializable. Replace this with a Serializable type.

Carnell
or IsSerializable (from GWT)
helios