Mark Wielaard wrote:
>
> Hi,
>
> A couple of classes in the servlet api are serializable.
> According to the specification, not according to the javadoc.
> I asked Sun about this and they said they should be serializable
> and the javadoc was wrong.
>
> But how do I make sure our classes (de)serialize the same way as
> the classes from Sun? Neither the javadoc nor the specification
> says anything about how these classes are serialized.
I've not actually tried this myself, but it might be worth trying doing
a ObjectStreamClass.lookup on the classes you're interested in, then
looking at the ObjectStreamFields. This ought to get you then type and
(hopefully) name of each serializable field, and if you're lucky you
might be able to make an intelligent guess as to what each means. But
Sun really /ought/ to be documenting this...
Thomas.