Hi,

i had the same troubles in my project once i moved from 1.5.2 to
2.0m2. I found the following solution:

1. create a class on the client code:

public class SerializableWhiteList implements IsSerializable {
        @SuppressWarnings("unused")
        private MyBean myBean;
        @SuppressWarnings("unused")
        private MySecondBean mySecondBean;
        // Put here all Beans wich need this special treatment
}

2. Create a Method in your Service and ServiceAsync and ServiceImpl:

public interface MyService extends RemoteService {
        public SerializableWhiteList serializableWhiteList
(SerializableWhiteList s);
}
public interface MyServiceAsync {
        public void serializableWhiteList(SerializableWhiteList s,
AsyncCallback<SerializableWhiteList> cb);
}
public class MyServiceImpl extends RemoteServiceServlet implements
MyService {
        @Override
        public SerializableWhiteList serializableWhiteList
(SerializableWhiteList s) {
                throw new RuntimeException("This Method is only used to put 
Beans to
the SerializationPolicy, please do not call it");
        }
}

Greetings


On Nov 16, 4:51 am, Edgenius <[email protected]> wrote:
> It is not new questions in this group. But I face a new problem in
> 2.0M2 as SerializationPolicy logic is changed.  I know GWT will put
> serializition class into SerializationPolicy whitelist. Before 2.0, I
> create a dummy method which hold all classes I want to pass to client
> side but they are not inside any method's  parameters or exceptions.
> It looks:
>
> public interface RemoteServiceAsync {
> public void serialPolicy(ClientAuthenticationException
> ae,ClientAccessDeniedException ade, CaptchaVerifiedException ce
>                         TextModel textModel,LinkModel linkModel, 
> MessageListModel mlm,
> AsyncCallback<Object> callback);
>                         }
>
> These Exception classes are a kind of "runtime exception" - For
> example, ClientAuthenticationException is thrown when login failed.
> It won't be checked exception as almost all methods have the
> possibilty to throw this exception. It is bad to write on every method
> like "int myMethod() throws ClientAuthenticationException.
>
> I guess 2.0 becomes smarter - it can distinguish the unused method and
> kick out my runtime exceptions classes from SerializationPolicy
> whitelist.  Unfortunately, it brings troubles as well.  So, do we have
> an easy to way to expand whitelist?

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=.


Reply via email to